feat: add ddl task service (#53)

* feat: add ddl task service

* chore: apply suggestions from CR

* chore: add path to build.rs
This commit is contained in:
Weny Xu
2023-06-28 16:21:47 +09:00
committed by GitHub
parent 7aeaeaba1e
commit f82201d712
8 changed files with 857 additions and 321 deletions
+64
View File
@@ -0,0 +1,64 @@
// Copyright 2023 Greptime Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package greptime.v1.meta;
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
import "greptime/v1/meta/common.proto";
service DdlTask {
// Submits a DDL task to meta.
rpc SubmitDdlTask(SubmitDdlTaskRequest) returns (SubmitDdlTaskResponse);
}
enum DdlTaskType {
Create = 0;
}
message Task {
DdlTaskType type = 1;
oneof payload { bytes pd = 2; }
}
message SubmitDdlTaskRequest {
RequestHeader header = 1;
// The following information plays a bigger role in making messages traceable
// and facilitating debugging.
string subject = 2;
string from = 3;
string to = 4;
// The unix timestamp in milliseconds.
int64 timestamp_millis = 5;
Task task = 6;
}
enum Status {
Done = 0;
Failed = 1;
Cancelled = 2;
}
message SubmitDdlTaskResponse {
ResponseHeader header = 1;
// Key is the identifier for the ddl task.
bytes key = 2;
Status status = 3;
}
-10
View File
@@ -21,8 +21,6 @@ option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"
import "greptime/v1/meta/common.proto";
service Router {
rpc Create(CreateRequest) returns (RouteResponse) {}
// Fetch routing information for tables. The smallest unit is the complete
// routing information(all regions) of a table.
//
@@ -47,14 +45,6 @@ service Router {
rpc Delete(DeleteRequest) returns (RouteResponse) {}
}
message CreateRequest {
RequestHeader header = 1;
TableName table_name = 2;
repeated Partition partitions = 3;
bytes table_info = 4;
}
message RouteRequest {
RequestHeader header = 1;