chore: format proto file (#254)

* chore: proto file format using buf

* generate go file
This commit is contained in:
fys
2025-07-16 11:25:57 +08:00
committed by GitHub
parent ceb1af4fa9
commit 855dff1b87
30 changed files with 432 additions and 354 deletions
+4 -4
View File
@@ -16,12 +16,12 @@ syntax = "proto3";
package greptime.v1;
option java_package = "io.greptime.v1";
option java_outer_classname = "Columns";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
import "greptime/v1/common.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
option java_outer_classname = "Columns";
option java_package = "io.greptime.v1";
message Column {
string column_name = 1;
SemanticType semantic_type = 2;
+17 -7
View File
@@ -16,9 +16,9 @@ syntax = "proto3";
package greptime.v1;
option java_package = "io.greptime.v1";
option java_outer_classname = "Common";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
option java_outer_classname = "Common";
option java_package = "io.greptime.v1";
message QueryContext {
string current_catalog = 1;
@@ -61,7 +61,9 @@ message RequestHeader {
string timezone = 6;
}
message ResponseHeader { Status status = 1; }
message ResponseHeader {
Status status = 1;
}
message Status {
// Corresponding to the `StatusCode` definition of GreptimeDB
@@ -81,7 +83,9 @@ message Basic {
string password = 2;
}
message Token { string token = 1; }
message Token {
string token = 1;
}
message TableName {
string catalog_name = 1;
@@ -89,11 +93,17 @@ message TableName {
string table_name = 3;
}
message AffectedRows { uint32 value = 1; }
message AffectedRows {
uint32 value = 1;
}
message Metrics { bytes metrics = 1; }
message Metrics {
bytes metrics = 1;
}
message ExpireAfter { int64 value = 1; }
message ExpireAfter {
int64 value = 1;
}
message FlightMetadata {
AffectedRows affected_rows = 1;
+22 -12
View File
@@ -16,15 +16,15 @@ syntax = "proto3";
package greptime.v1;
option java_package = "io.greptime.v1";
option java_outer_classname = "Database";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
import "greptime/v1/ddl.proto";
import "greptime/v1/column.proto";
import "greptime/v1/row.proto";
import "greptime/v1/prom.proto";
import "greptime/v1/common.proto";
import "greptime/v1/ddl.proto";
import "greptime/v1/prom.proto";
import "greptime/v1/row.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
option java_outer_classname = "Database";
option java_package = "io.greptime.v1";
service GreptimeDatabase {
rpc Handle(GreptimeRequest) returns (GreptimeResponse);
@@ -46,7 +46,9 @@ message GreptimeRequest {
message GreptimeResponse {
ResponseHeader header = 1;
oneof response { AffectedRows affected_rows = 2; }
oneof response {
AffectedRows affected_rows = 2;
}
}
message QueryRequest {
@@ -65,7 +67,9 @@ message InsertIntoPlan {
bytes logical_plan = 2;
}
message InsertRequests { repeated InsertRequest inserts = 1; }
message InsertRequests {
repeated InsertRequest inserts = 1;
}
message InsertRequest {
string table_name = 1;
@@ -79,7 +83,9 @@ message InsertRequest {
uint32 row_count = 4;
}
message DeleteRequests { repeated DeleteRequest deletes = 1; }
message DeleteRequests {
repeated DeleteRequest deletes = 1;
}
message DeleteRequest {
// The table name to delete from. Catalog name and schema name are in the
@@ -93,7 +99,9 @@ message DeleteRequest {
uint32 row_count = 4;
}
message RowInsertRequests { repeated RowInsertRequest inserts = 1; }
message RowInsertRequests {
repeated RowInsertRequest inserts = 1;
}
message RowInsertRequest {
string table_name = 1;
@@ -102,7 +110,9 @@ message RowInsertRequest {
Rows rows = 2;
}
message RowDeleteRequests { repeated RowDeleteRequest deletes = 1; }
message RowDeleteRequests {
repeated RowDeleteRequest deletes = 1;
}
message RowDeleteRequest {
// The table name to delete from. Catalog name and schema name are in the
+77 -65
View File
@@ -16,12 +16,12 @@ syntax = "proto3";
package greptime.v1;
option java_package = "io.greptime.v1";
option java_outer_classname = "Ddl";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
import "greptime/v1/common.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
option java_outer_classname = "Ddl";
option java_package = "io.greptime.v1";
// "Data Definition Language" requests, that create, modify or delete the
// database structures but not the data. `DdlRequest` could carry more
// information than plain SQL, for example, the "table_id" in `CreateTableExpr`.
@@ -174,11 +174,17 @@ message DropDefaults {
repeated DropDefault drop_defaults = 1;
}
message DropColumns { repeated DropColumn drop_columns = 1; }
message DropColumns {
repeated DropColumn drop_columns = 1;
}
message ModifyColumnTypes { repeated ModifyColumnType modify_column_types = 1; }
message ModifyColumnTypes {
repeated ModifyColumnType modify_column_types = 1;
}
message RenameTable { string new_table_name = 1; }
message RenameTable {
string new_table_name = 1;
}
message AddColumn {
ColumnDef column_def = 1;
@@ -198,18 +204,24 @@ message Option {
}
message SetTableOptions {
repeated Option table_options = 1;
repeated Option table_options = 1;
}
message UnsetTableOptions {
repeated string keys = 1;
repeated string keys = 1;
}
message DropColumn { string name = 1; }
message DropColumn {
string name = 1;
}
message TableId { uint32 id = 1; }
message TableId {
uint32 id = 1;
}
message FlowId { uint32 id = 1; }
message FlowId {
uint32 id = 1;
}
message ColumnDef {
string name = 1;
@@ -236,104 +248,104 @@ message AddColumnLocation {
}
enum Analyzer {
ENGLISH = 0;
CHINESE = 1;
ENGLISH = 0;
CHINESE = 1;
}
enum FulltextBackend {
TANTIVY = 0;
BLOOM = 1;
TANTIVY = 0;
BLOOM = 1;
}
message SetFulltext {
string column_name = 1;
bool enable = 2;
Analyzer analyzer = 3;
bool case_sensitive = 4;
FulltextBackend backend = 5;
// The granularity for the fulltext index (for bloom backend only).
uint64 granularity = 6;
// The false positive rate for the fulltext index (for bloom backend only).
double false_positive_rate = 7;
string column_name = 1;
bool enable = 2;
Analyzer analyzer = 3;
bool case_sensitive = 4;
FulltextBackend backend = 5;
// The granularity for the fulltext index (for bloom backend only).
uint64 granularity = 6;
// The false positive rate for the fulltext index (for bloom backend only).
double false_positive_rate = 7;
}
message UnsetFulltext {
string column_name = 1;
string column_name = 1;
}
message SetInverted {
string column_name = 1;
string column_name = 1;
}
message UnsetInverted {
string column_name = 1;
string column_name = 1;
}
enum SkippingIndexType {
BLOOM_FILTER = 0;
BLOOM_FILTER = 0;
}
message SetSkipping {
string column_name = 1;
bool enable = 2;
uint64 granularity = 3;
SkippingIndexType skipping_index_type = 4;
double false_positive_rate = 5;
string column_name = 1;
bool enable = 2;
uint64 granularity = 3;
SkippingIndexType skipping_index_type = 4;
double false_positive_rate = 5;
}
message UnsetSkipping {
string column_name = 1;
string column_name = 1;
}
message AlterDatabaseExpr {
string catalog_name = 1;
string schema_name = 2;
oneof kind {
SetDatabaseOptions set_database_options = 3;
UnsetDatabaseOptions unset_database_options = 4;
}
string catalog_name = 1;
string schema_name = 2;
oneof kind {
SetDatabaseOptions set_database_options = 3;
UnsetDatabaseOptions unset_database_options = 4;
}
}
message SetDatabaseOptions {
repeated Option set_database_options = 1;
repeated Option set_database_options = 1;
}
message UnsetDatabaseOptions {
repeated string keys = 1;
repeated string keys = 1;
}
// The create trigger expression.
message CreateTriggerExpr {
string catalog_name = 1;
string trigger_name = 2;
bool create_if_not_exists = 3;
// The SQL statement to be executed periodically.
string sql = 4;
// The channels for sending notifications.
repeated NotifyChannel channels = 5;
// The user-defined labels.
map<string, string> labels = 6;
// The user-defined annotations.
map<string, string> annotations = 7;
// The execution interval for sql query in seconds.
uint64 interval = 8;
string catalog_name = 1;
string trigger_name = 2;
bool create_if_not_exists = 3;
// The SQL statement to be executed periodically.
string sql = 4;
// The channels for sending notifications.
repeated NotifyChannel channels = 5;
// The user-defined labels.
map<string, string> labels = 6;
// The user-defined annotations.
map<string, string> annotations = 7;
// The execution interval for sql query in seconds.
uint64 interval = 8;
}
// The notification channel for trigger.
message NotifyChannel {
string name = 1;
oneof channel_type {
WebhookOptions webhook = 2;
}
string name = 1;
oneof channel_type {
WebhookOptions webhook = 2;
}
}
// The options for webhook.
message WebhookOptions {
string url = 1;
map<string, string> opts = 2;
string url = 1;
map<string, string> opts = 2;
}
message DropTriggerExpr {
string catalog_name = 1;
string trigger_name = 2;
bool drop_if_exists = 3;
string catalog_name = 1;
string trigger_name = 2;
bool drop_if_exists = 3;
}
+10 -6
View File
@@ -16,14 +16,14 @@ syntax = "proto3";
package greptime.v1.flow;
option java_package = "io.greptime.v1.flow";
option java_outer_classname = "Server";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/flow";
import "greptime/v1/common.proto";
import "greptime/v1/ddl.proto";
import "greptime/v1/row.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/flow";
option java_outer_classname = "Server";
option java_package = "io.greptime.v1.flow";
service Flow {
// Handle the control plane request for creating or removing a flow.
rpc HandleCreateRemove(FlowRequest) returns (FlowResponse);
@@ -56,7 +56,9 @@ message FlowRequestHeader {
QueryContext query_context = 2;
}
message InsertRequests {repeated InsertRequest requests = 1;}
message InsertRequests {
repeated InsertRequest requests = 1;
}
message InsertRequest {
uint64 region_id = 1;
@@ -98,7 +100,9 @@ message CreateRequest {
bool or_replace = 9;
}
message DropRequest {FlowId flow_id = 1;}
message DropRequest {
FlowId flow_id = 1;
}
message FlushFlow {
FlowId flow_id = 1;
+2 -2
View File
@@ -16,9 +16,9 @@ syntax = "proto3";
package greptime.v1.frontend;
option java_package = "io.greptime.v1.frontend";
option java_outer_classname = "Server";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/frontend";
option java_outer_classname = "Server";
option java_package = "io.greptime.v1.frontend";
service Frontend {
// List all running processes on frontend.
+2 -2
View File
@@ -16,9 +16,9 @@ syntax = "proto3";
package greptime.v1;
option java_package = "io.greptime.v1";
option java_outer_classname = "Health";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
option java_outer_classname = "Health";
option java_package = "io.greptime.v1";
service HealthCheck {
rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse);
+18 -18
View File
@@ -20,33 +20,33 @@ option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/index
// BloomFilterMeta defines the metadata for a bloom filter.
message BloomFilterMeta {
// The number of rows per segment.
uint64 rows_per_segment = 1;
// The number of rows per segment.
uint64 rows_per_segment = 1;
// The number of segments.
uint64 segment_count = 2;
// The number of segments.
uint64 segment_count = 2;
// The number of total rows.
uint64 row_count = 3;
// The number of total rows.
uint64 row_count = 3;
// The size of the bloom filter in bytes excluding the metadata.
uint64 bloom_filter_size = 4;
// The size of the bloom filter in bytes excluding the metadata.
uint64 bloom_filter_size = 4;
// The indices to the bloom filter location of each segment.
repeated uint64 segment_loc_indices = 5;
// The indices to the bloom filter location of each segment.
repeated uint64 segment_loc_indices = 5;
// The bloom filter locations.
repeated BloomFilterLoc bloom_filter_locs = 6;
// The bloom filter locations.
repeated BloomFilterLoc bloom_filter_locs = 6;
}
// BloomFilterLoc defines the location of a bloom filter.
message BloomFilterLoc {
// The byte offset of the bloom filter data.
uint64 offset = 1;
// The byte offset of the bloom filter data.
uint64 offset = 1;
// The size of the bloom filter data.
uint64 size = 2;
// The size of the bloom filter data.
uint64 size = 2;
// The number of elements in the bloom filter.
uint64 element_count = 3;
// The number of elements in the bloom filter.
uint64 element_count = 3;
}
+41 -41
View File
@@ -21,70 +21,70 @@ option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/index
// InvertedIndexMetas defines the metadata for an inverted index
// within an inverted index blob.
message InvertedIndexMetas {
// A map of tag names to their respective metadata corresponding to an individual
// inverted index within the inverted index blob.
map<string, InvertedIndexMeta> metas = 1;
// A map of tag names to their respective metadata corresponding to an individual
// inverted index within the inverted index blob.
map<string, InvertedIndexMeta> metas = 1;
// The total count of rows within the inverted index blob.
// This is used to determine the number of segments within the bitmap.
uint64 total_row_count = 2;
// The total count of rows within the inverted index blob.
// This is used to determine the number of segments within the bitmap.
uint64 total_row_count = 2;
// The number of rows per group for bitmap indexing which determines how rows are
// batched for indexing. Each batch corresponds to a segment in the bitmap and allows
// for efficient retrieval during queries by reducing the search space.
uint64 segment_row_count = 3;
// The number of rows per group for bitmap indexing which determines how rows are
// batched for indexing. Each batch corresponds to a segment in the bitmap and allows
// for efficient retrieval during queries by reducing the search space.
uint64 segment_row_count = 3;
}
// InvertedIndexMeta contains the metadata for a specific tag's inverted index.
message InvertedIndexMeta {
// Name of the tag associated with the inverted index.
string name = 1;
// Name of the tag associated with the inverted index.
string name = 1;
// The base byte offset for this tag's inverted index data within the blob.
// Other offsets in this message are relative to this base offset.
uint64 base_offset = 2;
// The base byte offset for this tag's inverted index data within the blob.
// Other offsets in this message are relative to this base offset.
uint64 base_offset = 2;
// The total size in bytes of this tag's inverted index data, including bitmaps,
// FST data.
uint64 inverted_index_size = 3;
// The total size in bytes of this tag's inverted index data, including bitmaps,
// FST data.
uint64 inverted_index_size = 3;
// The byte offset of the Finite State Transducer (FST) data relative to the `base_offset`.
uint32 relative_fst_offset = 4;
// The byte offset of the Finite State Transducer (FST) data relative to the `base_offset`.
uint32 relative_fst_offset = 4;
// The size in bytes of the FST data.
uint32 fst_size = 5;
// The size in bytes of the FST data.
uint32 fst_size = 5;
// The byte offset relative to the `base_offset` where the null bitmap for this tag
// starts.
uint32 relative_null_bitmap_offset = 6;
// The byte offset relative to the `base_offset` where the null bitmap for this tag
// starts.
uint32 relative_null_bitmap_offset = 6;
// The size in bytes of the null bitmap.
uint32 null_bitmap_size = 7;
// The size in bytes of the null bitmap.
uint32 null_bitmap_size = 7;
// Statistical information about the tag's inverted index.
InvertedIndexStats stats = 8;
// Statistical information about the tag's inverted index.
InvertedIndexStats stats = 8;
// The type of bitmap used for indexing.
BitmapType bitmap_type = 9;
// The type of bitmap used for indexing.
BitmapType bitmap_type = 9;
}
// InvertedIndexStats provides statistical data on a tag's inverted index.
message InvertedIndexStats {
// The count of null entries within the tag's column.
uint64 null_count = 1;
// The count of null entries within the tag's column.
uint64 null_count = 1;
// The number of distinct values within the tag's column.
uint64 distinct_count = 2;
// The number of distinct values within the tag's column.
uint64 distinct_count = 2;
// The minimum value found within the tag's column, encoded as bytes.
bytes min_value = 3;
// The minimum value found within the tag's column, encoded as bytes.
bytes min_value = 3;
// The maximum value found within the tag's column, encoded as bytes.
bytes max_value = 4;
// The maximum value found within the tag's column, encoded as bytes.
bytes max_value = 4;
}
// BitmapType defines the type of bitmap used for indexing.
enum BitmapType {
BitVec = 0;
Roaring = 1;
BitVec = 0;
Roaring = 1;
}
+5 -3
View File
@@ -16,11 +16,11 @@ 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/store.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
// Cluster service is used for communication between meta nodes.
service Cluster {
// Batch get kvs by input keys from leader's in_memory kv store.
@@ -33,7 +33,9 @@ service Cluster {
rpc MetasrvPeers(MetasrvPeersRequest) returns (MetasrvPeersResponse);
}
message MetasrvPeersRequest { RequestHeader header = 1; }
message MetasrvPeersRequest {
RequestHeader header = 1;
}
message MetasrvPeersResponse {
ResponseHeader header = 1;
+3 -1
View File
@@ -65,4 +65,6 @@ message KeyValue {
}
// Procedure identifier
message ProcedureId { bytes key = 1; }
message ProcedureId {
bytes key = 1;
}
+59 -53
View File
@@ -16,110 +16,116 @@ syntax = "proto3";
package greptime.v1.meta;
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
import "greptime/v1/common.proto";
import "greptime/v1/ddl.proto";
import "greptime/v1/meta/common.proto";
import "greptime/v1/meta/route.proto";
import "greptime/v1/ddl.proto";
import "greptime/v1/common.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
enum DdlTaskType {
Create = 0;
Drop = 1;
Create = 0;
Drop = 1;
}
message CreateDatabaseTask {
CreateDatabaseExpr create_database = 1;
CreateDatabaseExpr create_database = 1;
}
message CreateTableTask {
CreateTableExpr create_table = 1;
repeated Partition partitions = 2;
bytes table_info = 3;
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 CreateTableTasks {
repeated CreateTableTask tasks = 1;
}
message DropTableTasks { repeated DropTableTask tasks = 1; }
message AlterTableTask{
AlterTableExpr alter_table = 1;
message DropTableTask {
DropTableExpr drop_table = 1;
}
message AlterTableTasks { repeated AlterTableTask tasks = 1; }
message DropTableTasks {
repeated DropTableTask tasks = 1;
}
message AlterTableTask {
AlterTableExpr alter_table = 1;
}
message AlterTableTasks {
repeated AlterTableTask tasks = 1;
}
message TruncateTableTask {
TruncateTableExpr truncate_table = 1;
TruncateTableExpr truncate_table = 1;
}
message DropDatabaseTask {
DropDatabaseExpr drop_database = 1;
DropDatabaseExpr drop_database = 1;
}
message CreateFlowTask {
CreateFlowExpr create_flow = 1;
CreateFlowExpr create_flow = 1;
}
message DropFlowTask {
DropFlowExpr drop_flow = 1;
DropFlowExpr drop_flow = 1;
}
// Create a view task
message CreateViewTask {
CreateViewExpr create_view = 1;
bytes view_info = 2;
CreateViewExpr create_view = 1;
bytes view_info = 2;
}
// Drop a view task
message DropViewTask {
DropViewExpr drop_view = 1;
DropViewExpr drop_view = 1;
}
// Alter database tasks
message AlterDatabaseTask {
AlterDatabaseExpr task = 1;
AlterDatabaseExpr task = 1;
}
message CreateTriggerTask {
CreateTriggerExpr create_trigger = 1;
CreateTriggerExpr create_trigger = 1;
}
message DropTriggerTask {
DropTriggerExpr drop_trigger = 1;
DropTriggerExpr drop_trigger = 1;
}
message DdlTaskRequest {
RequestHeader header = 1;
QueryContext query_context = 64;
RequestHeader header = 1;
QueryContext query_context = 64;
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;
DropDatabaseTask drop_database_task = 9;
CreateDatabaseTask create_database_task = 10;
CreateFlowTask create_flow_task = 11;
DropFlowTask drop_flow_task = 12;
CreateViewTask create_view_task = 13;
DropViewTask drop_view_task = 14;
AlterDatabaseTask alter_database_task = 15;
CreateTriggerTask create_trigger_task = 16;
DropTriggerTask drop_trigger_task = 17;
}
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;
DropDatabaseTask drop_database_task = 9;
CreateDatabaseTask create_database_task = 10;
CreateFlowTask create_flow_task = 11;
DropFlowTask drop_flow_task = 12;
CreateViewTask create_view_task = 13;
DropViewTask drop_view_task = 14;
AlterDatabaseTask alter_database_task = 15;
CreateTriggerTask create_trigger_task = 16;
DropTriggerTask drop_trigger_task = 17;
}
}
message DdlTaskResponse {
ResponseHeader header = 1;
ProcedureId pid = 2;
ResponseHeader header = 1;
ProcedureId pid = 2;
// Returns if the tables created.
repeated TableId table_ids = 5;
// Returns if the tables created.
repeated TableId table_ids = 5;
}
+8 -4
View File
@@ -16,10 +16,10 @@ syntax = "proto3";
package greptime.v1.meta;
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
import "greptime/v1/meta/common.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
service Heartbeat {
// Heartbeat, there may be many contents of the heartbeat, such as:
// 1. Metadata to be registered to meta server and discoverable by other
@@ -138,7 +138,9 @@ message RegionLease {
repeated uint64 closeable_region_ids = 4;
}
message AskLeaderRequest { RequestHeader header = 1; }
message AskLeaderRequest {
RequestHeader header = 1;
}
message AskLeaderResponse {
ResponseHeader header = 1;
@@ -156,5 +158,7 @@ message MailboxMessage {
// The unix timestamp in milliseconds.
int64 timestamp_millis = 5;
// The message body.
oneof payload { string json = 6; }
oneof payload {
string json = 6;
}
}
+5 -3
View File
@@ -16,10 +16,10 @@ syntax = "proto3";
package greptime.v1.meta;
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
import "greptime/v1/meta/common.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
service Lock {
// Lock acquires a distributed shared lock on a given named lock. On success,
// it will return a unique key that exists so long as the lock is held by the
@@ -55,4 +55,6 @@ message UnlockRequest {
bytes key = 2;
}
message UnlockResponse { ResponseHeader header = 1; }
message UnlockResponse {
ResponseHeader header = 1;
}
+32 -32
View File
@@ -6,62 +6,62 @@ 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/ddl.proto";
import "greptime/v1/meta/region.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
enum ProcedureStatus {
Running = 0;
Done = 1;
Retrying = 2;
Failed = 3;
PrepareRollback = 4;
RollingBack = 5;
Poisoned = 6;
Running = 0;
Done = 1;
Retrying = 2;
Failed = 3;
PrepareRollback = 4;
RollingBack = 5;
Poisoned = 6;
}
message ProcedureMeta {
ProcedureId id = 1;
string type_name = 2;
ProcedureStatus status = 3;
int64 start_time_ms = 4;
int64 end_time_ms = 5;
repeated string lock_keys = 6;
string error = 7;
ProcedureId id = 1;
string type_name = 2;
ProcedureStatus status = 3;
int64 start_time_ms = 4;
int64 end_time_ms = 5;
repeated string lock_keys = 6;
string error = 7;
}
message QueryProcedureRequest {
RequestHeader header = 1;
ProcedureId pid = 2;
RequestHeader header = 1;
ProcedureId pid = 2;
}
message ProcedureStateResponse {
ResponseHeader header = 1;
ProcedureStatus status = 2;
string error = 3;
ResponseHeader header = 1;
ProcedureStatus status = 2;
string error = 3;
}
message ProcedureDetailRequest {
RequestHeader header = 1;
RequestHeader header = 1;
}
message ProcedureDetailResponse {
ResponseHeader header = 1;
repeated ProcedureMeta procedures = 2;
ResponseHeader header = 1;
repeated ProcedureMeta procedures = 2;
}
service ProcedureService {
// Query a submitted procedure state
rpc query(QueryProcedureRequest) returns (ProcedureStateResponse);
// Query a submitted procedure state
rpc query(QueryProcedureRequest) returns (ProcedureStateResponse);
// Submits a DDL task
rpc ddl(DdlTaskRequest) returns (DdlTaskResponse);
// Submits a DDL task
rpc ddl(DdlTaskRequest) returns (DdlTaskResponse);
// Submits a region migration task
rpc migrate(MigrateRegionRequest) returns (MigrateRegionResponse);
// Submits a region migration task
rpc migrate(MigrateRegionRequest) returns (MigrateRegionResponse);
// Query all submitted procedures details
rpc details(ProcedureDetailRequest) returns (ProcedureDetailResponse);
// Query all submitted procedures details
rpc details(ProcedureDetailRequest) returns (ProcedureDetailResponse);
}
+9 -9
View File
@@ -16,19 +16,19 @@ syntax = "proto3";
package greptime.v1.meta;
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
import "greptime/v1/meta/common.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
message MigrateRegionRequest {
RequestHeader header = 1;
uint64 region_id = 3;
uint64 from_peer = 4;
uint64 to_peer = 5;
uint32 timeout_secs = 6;
RequestHeader header = 1;
uint64 region_id = 3;
uint64 from_peer = 4;
uint64 to_peer = 5;
uint32 timeout_secs = 6;
}
message MigrateRegionResponse {
ResponseHeader header = 1;
ProcedureId pid = 2;
ResponseHeader header = 1;
ProcedureId pid = 2;
}
+4 -4
View File
@@ -16,10 +16,10 @@ 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/common.proto";
import "greptime/v1/meta/common.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
message TableRoute {
Table table = 1;
@@ -60,4 +60,4 @@ message Partition {
message TableRouteValue {
repeated Peer peers = 1;
TableRoute table_route = 2;
}
}
+2 -2
View File
@@ -16,10 +16,10 @@ syntax = "proto3";
package greptime.v1.meta;
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
import "greptime/v1/meta/common.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta";
service Store {
// Range gets the keys in the range from the key-value store.
rpc Range(RangeRequest) returns (RangeResponse);
+4 -4
View File
@@ -16,12 +16,12 @@ syntax = "proto3";
package greptime.v1;
option java_package = "io.greptime.v1";
option java_outer_classname = "Prometheus";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
import "greptime/v1/common.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
option java_outer_classname = "Prometheus";
option java_package = "io.greptime.v1";
// PrometheusGateway behaves absolutely the same as Prometheus HTTP API
service PrometheusGateway {
rpc Handle(PromqlRequest) returns (PromqlResponse);
+46 -22
View File
@@ -16,15 +16,17 @@ syntax = "proto3";
package greptime.v1.region;
option java_package = "io.greptime.v1.region";
option java_outer_classname = "Server";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/region";
import "greptime/v1/common.proto";
import "greptime/v1/row.proto";
import "greptime/v1/ddl.proto";
import "greptime/v1/row.proto";
service Region { rpc Handle(RegionRequest) returns (RegionResponse); }
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/region";
option java_outer_classname = "Server";
option java_package = "io.greptime.v1.region";
service Region {
rpc Handle(RegionRequest) returns (RegionResponse);
}
message RegionRequestHeader {
// Encoded trace_id & span_id, follow the w3c Trace Context
@@ -70,9 +72,13 @@ message RegionResponse {
bytes metadata = 4;
}
message InsertRequests { repeated InsertRequest requests = 1; }
message InsertRequests {
repeated InsertRequest requests = 1;
}
message DeleteRequests { repeated DeleteRequest requests = 1; }
message DeleteRequests {
repeated DeleteRequest requests = 1;
}
message InsertRequest {
uint64 region_id = 1;
@@ -94,7 +100,9 @@ message QueryRequest {
// Create a batch of regions at once, usually used to create multiple logical
// regions at once. Different engines can choose whether to support this
// request. Metric Engine needs it.
message CreateRequests { repeated CreateRequest requests = 1; }
message CreateRequests {
repeated CreateRequest requests = 1;
}
message CreateRequest {
uint64 region_id = 1;
@@ -112,7 +120,9 @@ message CreateRequest {
}
// Same as CreateRequests, but for dropping regions.
message DropRequests { repeated DropRequest requests = 1; }
message DropRequests {
repeated DropRequest requests = 1;
}
message DropRequest {
uint64 region_id = 1;
@@ -132,9 +142,13 @@ message OpenRequest {
map<string, string> options = 4;
}
message CloseRequest { uint64 region_id = 1; }
message CloseRequest {
uint64 region_id = 1;
}
message AlterRequests { repeated AlterRequest requests = 1; }
message AlterRequests {
repeated AlterRequest requests = 1;
}
message AlterRequest {
uint64 region_id = 1;
@@ -152,18 +166,26 @@ message AlterRequest {
uint64 schema_version = 4;
}
message AddColumns { repeated AddColumn add_columns = 1; }
message AddColumns {
repeated AddColumn add_columns = 1;
}
message DropColumns { repeated DropColumn drop_columns = 1; }
message DropColumns {
repeated DropColumn drop_columns = 1;
}
message AddColumn {
RegionColumnDef column_def = 1;
AddColumnLocation location = 3;
}
message DropColumn { string name = 1; }
message DropColumn {
string name = 1;
}
message FlushRequest { uint64 region_id = 1; }
message FlushRequest {
uint64 region_id = 1;
}
/// Regular compaction
message Regular {}
@@ -174,14 +196,16 @@ message StrictWindow {
}
message CompactRequest {
uint64 region_id = 1;
oneof options {
Regular regular = 2;
StrictWindow strict_window = 3;
}
uint64 region_id = 1;
oneof options {
Regular regular = 2;
StrictWindow strict_window = 3;
}
}
message TruncateRequest { uint64 region_id = 1; }
message TruncateRequest {
uint64 region_id = 1;
}
// The column definition of a region. Unlike the message `ColumnDef` in
// `ddl.proto` which is for clients outside GreptimeDB, this `RegionColumnDef`
+7 -5
View File
@@ -16,12 +16,12 @@ syntax = "proto3";
package greptime.v1;
option java_package = "io.greptime.v1";
option java_outer_classname = "RowData";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
import "greptime/v1/common.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
option java_outer_classname = "RowData";
option java_package = "io.greptime.v1";
message Rows {
repeated ColumnSchema schema = 1;
repeated Row rows = 2;
@@ -39,7 +39,9 @@ message ColumnSchema {
ColumnOptions options = 5;
}
message Row { repeated Value values = 1; }
message Row {
repeated Value values = 1;
}
message Value {
oneof value_data {
+3 -3
View File
@@ -16,10 +16,10 @@ syntax = "proto3";
package greptime.v1;
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
import "greptime/v1/row.proto";
import "greptime/v1/common.proto";
import "greptime/v1/row.proto";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
// Type of operation to rows.
enum OpType {