519b1d0757
* feat: support batch create table * feat: ddl batch * feat: batch ddl task * feat: response table ids
85 lines
2.2 KiB
Protocol Buffer
85 lines
2.2 KiB
Protocol Buffer
// 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";
|
|
import "greptime/v1/meta/route.proto";
|
|
import "greptime/v1/ddl.proto";
|
|
|
|
|
|
service DdlTask {
|
|
// Submits a DDL task to meta.
|
|
rpc SubmitDdlTask(SubmitDdlTaskRequest) returns (SubmitDdlTaskResponse);
|
|
}
|
|
|
|
enum DdlTaskType {
|
|
Create = 0;
|
|
Drop = 1;
|
|
}
|
|
|
|
message CreateTableTask {
|
|
CreateTableExpr create_table = 1;
|
|
repeated Partition partitions = 2;
|
|
bytes table_info = 3;
|
|
}
|
|
|
|
message CreateTableTasks { repeated CreateTableTask tasks = 1; }
|
|
|
|
message DropTableTask{
|
|
DropTableExpr drop_table = 1;
|
|
}
|
|
|
|
message DropTableTasks { repeated DropTableTask tasks = 1; }
|
|
|
|
message AlterTableTask{
|
|
AlterExpr alter_table = 1;
|
|
}
|
|
|
|
message AlterTableTasks { repeated AlterTableTask tasks = 1; }
|
|
|
|
message TruncateTableTask {
|
|
TruncateTableExpr truncate_table = 1;
|
|
}
|
|
|
|
message SubmitDdlTaskRequest {
|
|
RequestHeader header = 1;
|
|
|
|
oneof task {
|
|
CreateTableTask create_table_task = 2;
|
|
DropTableTask drop_table_task = 3;
|
|
AlterTableTask alter_table_task = 4;
|
|
TruncateTableTask truncate_table_task = 5;
|
|
CreateTableTasks create_table_tasks = 6;
|
|
DropTableTasks drop_table_tasks = 7;
|
|
AlterTableTasks alter_table_tasks = 8;
|
|
}
|
|
}
|
|
|
|
message SubmitDdlTaskResponse {
|
|
ResponseHeader header = 1;
|
|
// Key is the identifier for the ddl task.
|
|
bytes key = 2;
|
|
|
|
// Returns if table created.
|
|
// TODO(jeremy): remove it?
|
|
TableId table_id = 4;
|
|
// Returns if the tables created.
|
|
repeated TableId table_ids = 5;
|
|
}
|