feat: Add DropTableTask, AlterTableTask (#54)
* feat: use type instead of pb bytes * feat: add table_info to CreateTableTask * fix: remove unused fields * feat: bring create route method back * feat: add table_id in SubmitDdlTaskResponse * feat: add drop table task * feat: add alter table task * chore: allow large_enum_variant * chore: apply suggestions from CR
This commit is contained in:
@@ -19,6 +19,9 @@ package greptime.v1.meta;
|
||||
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
|
||||
|
||||
import "greptime/v1/meta/common.proto";
|
||||
import "greptime/v1/meta/route.proto";
|
||||
import "greptime/v1/ddl.proto";
|
||||
|
||||
|
||||
service DdlTask {
|
||||
// Submits a DDL task to meta.
|
||||
@@ -27,32 +30,31 @@ service DdlTask {
|
||||
|
||||
enum DdlTaskType {
|
||||
Create = 0;
|
||||
Drop = 1;
|
||||
}
|
||||
|
||||
message Task {
|
||||
DdlTaskType type = 1;
|
||||
|
||||
oneof payload { bytes pd = 2; }
|
||||
message CreateTableTask {
|
||||
CreateTableExpr create_table = 1;
|
||||
repeated Partition partitions = 2;
|
||||
bytes table_info = 3;
|
||||
}
|
||||
|
||||
message DropTableTask{
|
||||
DropTableExpr drop_table = 1;
|
||||
}
|
||||
|
||||
message AlterTableTask{
|
||||
AlterExpr alter_table = 1;
|
||||
}
|
||||
|
||||
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;
|
||||
oneof task {
|
||||
CreateTableTask create_table_task = 2;
|
||||
DropTableTask drop_table_task = 3;
|
||||
AlterTableTask alter_table_task = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message SubmitDdlTaskResponse {
|
||||
@@ -60,5 +62,6 @@ message SubmitDdlTaskResponse {
|
||||
// Key is the identifier for the ddl task.
|
||||
bytes key = 2;
|
||||
|
||||
Status status = 3;
|
||||
// Returns if table created.
|
||||
TableId table_id = 4;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ 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.
|
||||
//
|
||||
@@ -45,6 +47,14 @@ 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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user