From 3fb80643ac2dc7895a9db7e44fa703b60c074357 Mon Sep 17 00:00:00 2001 From: luofucong Date: Thu, 25 May 2023 10:46:54 +0800 Subject: [PATCH 1/3] feat: make InsertRequest in a batch --- proto/greptime/v1/database.proto | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proto/greptime/v1/database.proto b/proto/greptime/v1/database.proto index 7fa7fb0a..b1f82cc9 100644 --- a/proto/greptime/v1/database.proto +++ b/proto/greptime/v1/database.proto @@ -34,7 +34,7 @@ service GreptimeDatabase { message GreptimeRequest { RequestHeader header = 1; oneof request { - InsertRequest insert = 2; + InsertRequests inserts = 2; QueryRequest query = 3; DdlRequest ddl = 4; DeleteRequest delete = 5; @@ -54,6 +54,10 @@ message QueryRequest { } } +message InsertRequests { + repeated InsertRequest insert = 1; +} + message InsertRequest { string table_name = 1; From 17b6e356729fdb0982fd6822c76483cc227ab8d1 Mon Sep 17 00:00:00 2001 From: luofucong Date: Thu, 25 May 2023 11:27:48 +0800 Subject: [PATCH 2/3] feat: make InsertRequest in a batch --- proto/greptime/v1/database.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/greptime/v1/database.proto b/proto/greptime/v1/database.proto index b1f82cc9..059dd029 100644 --- a/proto/greptime/v1/database.proto +++ b/proto/greptime/v1/database.proto @@ -55,7 +55,7 @@ message QueryRequest { } message InsertRequests { - repeated InsertRequest insert = 1; + repeated InsertRequest inserts = 1; } message InsertRequest { From 05377a30934fdfd83b9d6c7a78a2e031d8e22068 Mon Sep 17 00:00:00 2001 From: luofucong Date: Thu, 1 Jun 2023 11:07:36 +0800 Subject: [PATCH 3/3] feat: make InsertRequest in a batch --- go/greptime/v1/database.pb.go | 291 ++-- .../src/main/java/io/greptime/v1/Columns.java | 6 + java/src/main/java/io/greptime/v1/Common.java | 20 +- .../main/java/io/greptime/v1/Database.java | 1472 +++++++++++++---- java/src/main/java/io/greptime/v1/Ddl.java | 56 +- .../main/java/io/greptime/v1/Prometheus.java | 14 +- 6 files changed, 1408 insertions(+), 451 deletions(-) diff --git a/go/greptime/v1/database.pb.go b/go/greptime/v1/database.pb.go index a41371c5..73a389d6 100644 --- a/go/greptime/v1/database.pb.go +++ b/go/greptime/v1/database.pb.go @@ -42,7 +42,7 @@ type GreptimeRequest struct { Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // Types that are assignable to Request: // - // *GreptimeRequest_Insert + // *GreptimeRequest_Inserts // *GreptimeRequest_Query // *GreptimeRequest_Ddl // *GreptimeRequest_Delete @@ -95,9 +95,9 @@ func (m *GreptimeRequest) GetRequest() isGreptimeRequest_Request { return nil } -func (x *GreptimeRequest) GetInsert() *InsertRequest { - if x, ok := x.GetRequest().(*GreptimeRequest_Insert); ok { - return x.Insert +func (x *GreptimeRequest) GetInserts() *InsertRequests { + if x, ok := x.GetRequest().(*GreptimeRequest_Inserts); ok { + return x.Inserts } return nil } @@ -127,8 +127,8 @@ type isGreptimeRequest_Request interface { isGreptimeRequest_Request() } -type GreptimeRequest_Insert struct { - Insert *InsertRequest `protobuf:"bytes,2,opt,name=insert,proto3,oneof"` +type GreptimeRequest_Inserts struct { + Inserts *InsertRequests `protobuf:"bytes,2,opt,name=inserts,proto3,oneof"` } type GreptimeRequest_Query struct { @@ -143,7 +143,7 @@ type GreptimeRequest_Delete struct { Delete *DeleteRequest `protobuf:"bytes,5,opt,name=delete,proto3,oneof"` } -func (*GreptimeRequest_Insert) isGreptimeRequest_Request() {} +func (*GreptimeRequest_Inserts) isGreptimeRequest_Request() {} func (*GreptimeRequest_Query) isGreptimeRequest_Request() {} @@ -321,6 +321,53 @@ func (*QueryRequest_LogicalPlan) isQueryRequest_Query() {} func (*QueryRequest_PromRangeQuery) isQueryRequest_Query() {} +type InsertRequests struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Inserts []*InsertRequest `protobuf:"bytes,1,rep,name=inserts,proto3" json:"inserts,omitempty"` +} + +func (x *InsertRequests) Reset() { + *x = InsertRequests{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_database_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InsertRequests) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InsertRequests) ProtoMessage() {} + +func (x *InsertRequests) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_database_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InsertRequests.ProtoReflect.Descriptor instead. +func (*InsertRequests) Descriptor() ([]byte, []int) { + return file_greptime_v1_database_proto_rawDescGZIP(), []int{3} +} + +func (x *InsertRequests) GetInserts() []*InsertRequest { + if x != nil { + return x.Inserts + } + return nil +} + type InsertRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -340,7 +387,7 @@ type InsertRequest struct { func (x *InsertRequest) Reset() { *x = InsertRequest{} if protoimpl.UnsafeEnabled { - mi := &file_greptime_v1_database_proto_msgTypes[3] + mi := &file_greptime_v1_database_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -353,7 +400,7 @@ func (x *InsertRequest) String() string { func (*InsertRequest) ProtoMessage() {} func (x *InsertRequest) ProtoReflect() protoreflect.Message { - mi := &file_greptime_v1_database_proto_msgTypes[3] + mi := &file_greptime_v1_database_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -366,7 +413,7 @@ func (x *InsertRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use InsertRequest.ProtoReflect.Descriptor instead. func (*InsertRequest) Descriptor() ([]byte, []int) { - return file_greptime_v1_database_proto_rawDescGZIP(), []int{3} + return file_greptime_v1_database_proto_rawDescGZIP(), []int{4} } func (x *InsertRequest) GetTableName() string { @@ -416,7 +463,7 @@ type DeleteRequest struct { func (x *DeleteRequest) Reset() { *x = DeleteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_greptime_v1_database_proto_msgTypes[4] + mi := &file_greptime_v1_database_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -429,7 +476,7 @@ func (x *DeleteRequest) String() string { func (*DeleteRequest) ProtoMessage() {} func (x *DeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_greptime_v1_database_proto_msgTypes[4] + mi := &file_greptime_v1_database_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -442,7 +489,7 @@ func (x *DeleteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. func (*DeleteRequest) Descriptor() ([]byte, []int) { - return file_greptime_v1_database_proto_rawDescGZIP(), []int{4} + return file_greptime_v1_database_proto_rawDescGZIP(), []int{5} } func (x *DeleteRequest) GetTableName() string { @@ -484,82 +531,86 @@ var file_greptime_v1_database_proto_rawDesc = []byte{ 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x02, 0x0a, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9f, 0x02, 0x0a, 0x0f, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x65, 0x70, - 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2b, 0x0a, - 0x03, 0x64, 0x64, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x65, - 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x64, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x03, 0x64, 0x64, 0x6c, 0x12, 0x34, 0x0a, 0x06, 0x64, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, - 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x95, 0x01, 0x0a, 0x10, - 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x33, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x0d, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, - 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x66, 0x66, 0x65, 0x63, - 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x66, 0x66, 0x65, 0x63, - 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x99, 0x01, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x03, 0x73, 0x71, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x00, 0x52, 0x03, 0x73, 0x71, 0x6c, 0x12, 0x23, 0x0a, 0x0c, 0x6c, 0x6f, 0x67, 0x69, - 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, - 0x52, 0x0b, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x47, 0x0a, - 0x10, 0x70, 0x72, 0x6f, 0x6d, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, - 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6d, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, - 0x9f, 0x01, 0x0a, 0x0d, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x2d, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, - 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x77, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x08, 0x72, 0x6f, 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, - 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x22, 0xa6, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x6f, - 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x63, + 0x61, 0x64, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x07, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x73, 0x48, 0x00, 0x52, 0x07, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x73, 0x12, 0x31, 0x0a, + 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x2b, 0x0a, 0x03, 0x64, 0x64, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x64, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x03, 0x64, 0x64, 0x6c, 0x12, 0x34, 0x0a, + 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x95, + 0x01, 0x0a, 0x10, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x0d, 0x61, 0x66, 0x66, 0x65, + 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x99, 0x01, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x03, 0x73, 0x71, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x73, 0x71, 0x6c, 0x12, 0x23, 0x0a, 0x0c, 0x6c, + 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x48, 0x00, 0x52, 0x0b, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x50, 0x6c, 0x61, 0x6e, + 0x12, 0x47, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x6d, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x65, + 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x52, 0x61, 0x6e, + 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6d, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x22, 0x46, 0x0a, 0x0e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x52, 0x07, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x0d, 0x49, + 0x6e, 0x73, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, - 0x6e, 0x52, 0x0a, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x1b, 0x0a, - 0x09, 0x72, 0x6f, 0x77, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x08, 0x72, 0x6f, 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xaa, 0x01, 0x0a, 0x10, 0x47, - 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, - 0x45, 0x0a, 0x06, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x65, 0x70, - 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, - 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, - 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x42, 0x51, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x67, 0x72, - 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x44, 0x61, 0x74, 0x61, 0x62, - 0x61, 0x73, 0x65, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x2f, 0x67, 0x72, 0x65, - 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x67, - 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, + 0x77, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, + 0x6f, 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x67, 0x69, 0x6f, + 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, + 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xa6, 0x01, 0x0a, + 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, + 0x0d, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x12, 0x34, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, + 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x0a, 0x6b, 0x65, + 0x79, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x77, 0x5f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x6f, 0x77, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xaa, 0x01, 0x0a, 0x10, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, + 0x6d, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x06, 0x48, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x4f, 0x0a, 0x0e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x73, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x28, 0x01, 0x42, 0x51, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, + 0x65, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5a, 0x35, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x65, 0x70, 0x74, + 0x69, 0x6d, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x2f, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, + 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, + 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -574,40 +625,42 @@ func file_greptime_v1_database_proto_rawDescGZIP() []byte { return file_greptime_v1_database_proto_rawDescData } -var file_greptime_v1_database_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_greptime_v1_database_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_greptime_v1_database_proto_goTypes = []interface{}{ (*GreptimeRequest)(nil), // 0: greptime.v1.GreptimeRequest (*GreptimeResponse)(nil), // 1: greptime.v1.GreptimeResponse (*QueryRequest)(nil), // 2: greptime.v1.QueryRequest - (*InsertRequest)(nil), // 3: greptime.v1.InsertRequest - (*DeleteRequest)(nil), // 4: greptime.v1.DeleteRequest - (*RequestHeader)(nil), // 5: greptime.v1.RequestHeader - (*DdlRequest)(nil), // 6: greptime.v1.DdlRequest - (*ResponseHeader)(nil), // 7: greptime.v1.ResponseHeader - (*AffectedRows)(nil), // 8: greptime.v1.AffectedRows - (*PromRangeQuery)(nil), // 9: greptime.v1.PromRangeQuery - (*Column)(nil), // 10: greptime.v1.Column + (*InsertRequests)(nil), // 3: greptime.v1.InsertRequests + (*InsertRequest)(nil), // 4: greptime.v1.InsertRequest + (*DeleteRequest)(nil), // 5: greptime.v1.DeleteRequest + (*RequestHeader)(nil), // 6: greptime.v1.RequestHeader + (*DdlRequest)(nil), // 7: greptime.v1.DdlRequest + (*ResponseHeader)(nil), // 8: greptime.v1.ResponseHeader + (*AffectedRows)(nil), // 9: greptime.v1.AffectedRows + (*PromRangeQuery)(nil), // 10: greptime.v1.PromRangeQuery + (*Column)(nil), // 11: greptime.v1.Column } var file_greptime_v1_database_proto_depIdxs = []int32{ - 5, // 0: greptime.v1.GreptimeRequest.header:type_name -> greptime.v1.RequestHeader - 3, // 1: greptime.v1.GreptimeRequest.insert:type_name -> greptime.v1.InsertRequest + 6, // 0: greptime.v1.GreptimeRequest.header:type_name -> greptime.v1.RequestHeader + 3, // 1: greptime.v1.GreptimeRequest.inserts:type_name -> greptime.v1.InsertRequests 2, // 2: greptime.v1.GreptimeRequest.query:type_name -> greptime.v1.QueryRequest - 6, // 3: greptime.v1.GreptimeRequest.ddl:type_name -> greptime.v1.DdlRequest - 4, // 4: greptime.v1.GreptimeRequest.delete:type_name -> greptime.v1.DeleteRequest - 7, // 5: greptime.v1.GreptimeResponse.header:type_name -> greptime.v1.ResponseHeader - 8, // 6: greptime.v1.GreptimeResponse.affected_rows:type_name -> greptime.v1.AffectedRows - 9, // 7: greptime.v1.QueryRequest.prom_range_query:type_name -> greptime.v1.PromRangeQuery - 10, // 8: greptime.v1.InsertRequest.columns:type_name -> greptime.v1.Column - 10, // 9: greptime.v1.DeleteRequest.key_columns:type_name -> greptime.v1.Column - 0, // 10: greptime.v1.GreptimeDatabase.Handle:input_type -> greptime.v1.GreptimeRequest - 0, // 11: greptime.v1.GreptimeDatabase.HandleRequests:input_type -> greptime.v1.GreptimeRequest - 1, // 12: greptime.v1.GreptimeDatabase.Handle:output_type -> greptime.v1.GreptimeResponse - 1, // 13: greptime.v1.GreptimeDatabase.HandleRequests:output_type -> greptime.v1.GreptimeResponse - 12, // [12:14] is the sub-list for method output_type - 10, // [10:12] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 7, // 3: greptime.v1.GreptimeRequest.ddl:type_name -> greptime.v1.DdlRequest + 5, // 4: greptime.v1.GreptimeRequest.delete:type_name -> greptime.v1.DeleteRequest + 8, // 5: greptime.v1.GreptimeResponse.header:type_name -> greptime.v1.ResponseHeader + 9, // 6: greptime.v1.GreptimeResponse.affected_rows:type_name -> greptime.v1.AffectedRows + 10, // 7: greptime.v1.QueryRequest.prom_range_query:type_name -> greptime.v1.PromRangeQuery + 4, // 8: greptime.v1.InsertRequests.inserts:type_name -> greptime.v1.InsertRequest + 11, // 9: greptime.v1.InsertRequest.columns:type_name -> greptime.v1.Column + 11, // 10: greptime.v1.DeleteRequest.key_columns:type_name -> greptime.v1.Column + 0, // 11: greptime.v1.GreptimeDatabase.Handle:input_type -> greptime.v1.GreptimeRequest + 0, // 12: greptime.v1.GreptimeDatabase.HandleRequests:input_type -> greptime.v1.GreptimeRequest + 1, // 13: greptime.v1.GreptimeDatabase.Handle:output_type -> greptime.v1.GreptimeResponse + 1, // 14: greptime.v1.GreptimeDatabase.HandleRequests:output_type -> greptime.v1.GreptimeResponse + 13, // [13:15] is the sub-list for method output_type + 11, // [11:13] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_greptime_v1_database_proto_init() } @@ -657,7 +710,7 @@ func file_greptime_v1_database_proto_init() { } } file_greptime_v1_database_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InsertRequest); i { + switch v := v.(*InsertRequests); i { case 0: return &v.state case 1: @@ -669,6 +722,18 @@ func file_greptime_v1_database_proto_init() { } } file_greptime_v1_database_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InsertRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_database_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteRequest); i { case 0: return &v.state @@ -682,7 +747,7 @@ func file_greptime_v1_database_proto_init() { } } file_greptime_v1_database_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*GreptimeRequest_Insert)(nil), + (*GreptimeRequest_Inserts)(nil), (*GreptimeRequest_Query)(nil), (*GreptimeRequest_Ddl)(nil), (*GreptimeRequest_Delete)(nil), @@ -701,7 +766,7 @@ func file_greptime_v1_database_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_greptime_v1_database_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/java/src/main/java/io/greptime/v1/Columns.java b/java/src/main/java/io/greptime/v1/Columns.java index 4c2e0261..e1aff52c 100644 --- a/java/src/main/java/io/greptime/v1/Columns.java +++ b/java/src/main/java/io/greptime/v1/Columns.java @@ -477,6 +477,8 @@ private Column( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -1400,6 +1402,8 @@ private Values( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -5889,6 +5893,8 @@ private ColumnDef( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); diff --git a/java/src/main/java/io/greptime/v1/Common.java b/java/src/main/java/io/greptime/v1/Common.java index 63e85fc2..6b9a0c03 100644 --- a/java/src/main/java/io/greptime/v1/Common.java +++ b/java/src/main/java/io/greptime/v1/Common.java @@ -74,6 +74,8 @@ private ResponseHeader( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -613,6 +615,8 @@ private RequestHeader( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -1791,6 +1795,8 @@ private AuthHeader( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -2358,8 +2364,9 @@ public Builder mergeBasic(io.greptime.v1.Common.Basic value) { } else { if (authSchemeCase_ == 1) { basicBuilder_.mergeFrom(value); + } else { + basicBuilder_.setMessage(value); } - basicBuilder_.setMessage(value); } authSchemeCase_ = 1; return this; @@ -2499,8 +2506,9 @@ public Builder mergeToken(io.greptime.v1.Common.Token value) { } else { if (authSchemeCase_ == 2) { tokenBuilder_.mergeFrom(value); + } else { + tokenBuilder_.setMessage(value); } - tokenBuilder_.setMessage(value); } authSchemeCase_ = 2; return this; @@ -2716,6 +2724,8 @@ private Basic( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -3415,6 +3425,8 @@ private Token( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -3975,6 +3987,8 @@ private AffectedRows( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -4480,6 +4494,8 @@ private FlightMetadata( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); diff --git a/java/src/main/java/io/greptime/v1/Database.java b/java/src/main/java/io/greptime/v1/Database.java index e6f8e113..2ffe758a 100644 --- a/java/src/main/java/io/greptime/v1/Database.java +++ b/java/src/main/java/io/greptime/v1/Database.java @@ -34,19 +34,19 @@ public interface GreptimeRequestOrBuilder extends io.greptime.v1.Common.RequestHeaderOrBuilder getHeaderOrBuilder(); /** - * .greptime.v1.InsertRequest insert = 2; - * @return Whether the insert field is set. + * .greptime.v1.InsertRequests inserts = 2; + * @return Whether the inserts field is set. */ - boolean hasInsert(); + boolean hasInserts(); /** - * .greptime.v1.InsertRequest insert = 2; - * @return The insert. + * .greptime.v1.InsertRequests inserts = 2; + * @return The inserts. */ - io.greptime.v1.Database.InsertRequest getInsert(); + io.greptime.v1.Database.InsertRequests getInserts(); /** - * .greptime.v1.InsertRequest insert = 2; + * .greptime.v1.InsertRequests inserts = 2; */ - io.greptime.v1.Database.InsertRequestOrBuilder getInsertOrBuilder(); + io.greptime.v1.Database.InsertRequestsOrBuilder getInsertsOrBuilder(); /** * .greptime.v1.QueryRequest query = 3; @@ -154,14 +154,14 @@ private GreptimeRequest( break; } case 18: { - io.greptime.v1.Database.InsertRequest.Builder subBuilder = null; + io.greptime.v1.Database.InsertRequests.Builder subBuilder = null; if (requestCase_ == 2) { - subBuilder = ((io.greptime.v1.Database.InsertRequest) request_).toBuilder(); + subBuilder = ((io.greptime.v1.Database.InsertRequests) request_).toBuilder(); } request_ = - input.readMessage(io.greptime.v1.Database.InsertRequest.parser(), extensionRegistry); + input.readMessage(io.greptime.v1.Database.InsertRequests.parser(), extensionRegistry); if (subBuilder != null) { - subBuilder.mergeFrom((io.greptime.v1.Database.InsertRequest) request_); + subBuilder.mergeFrom((io.greptime.v1.Database.InsertRequests) request_); request_ = subBuilder.buildPartial(); } requestCase_ = 2; @@ -220,6 +220,8 @@ private GreptimeRequest( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -246,7 +248,7 @@ private GreptimeRequest( public enum RequestCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { - INSERT(2), + INSERTS(2), QUERY(3), DDL(4), DELETE(5), @@ -267,7 +269,7 @@ public static RequestCase valueOf(int value) { public static RequestCase forNumber(int value) { switch (value) { - case 2: return INSERT; + case 2: return INSERTS; case 3: return QUERY; case 4: return DDL; case 5: return DELETE; @@ -312,35 +314,35 @@ public io.greptime.v1.Common.RequestHeaderOrBuilder getHeaderOrBuilder() { return getHeader(); } - public static final int INSERT_FIELD_NUMBER = 2; + public static final int INSERTS_FIELD_NUMBER = 2; /** - * .greptime.v1.InsertRequest insert = 2; - * @return Whether the insert field is set. + * .greptime.v1.InsertRequests inserts = 2; + * @return Whether the inserts field is set. */ @java.lang.Override - public boolean hasInsert() { + public boolean hasInserts() { return requestCase_ == 2; } /** - * .greptime.v1.InsertRequest insert = 2; - * @return The insert. + * .greptime.v1.InsertRequests inserts = 2; + * @return The inserts. */ @java.lang.Override - public io.greptime.v1.Database.InsertRequest getInsert() { + public io.greptime.v1.Database.InsertRequests getInserts() { if (requestCase_ == 2) { - return (io.greptime.v1.Database.InsertRequest) request_; + return (io.greptime.v1.Database.InsertRequests) request_; } - return io.greptime.v1.Database.InsertRequest.getDefaultInstance(); + return io.greptime.v1.Database.InsertRequests.getDefaultInstance(); } /** - * .greptime.v1.InsertRequest insert = 2; + * .greptime.v1.InsertRequests inserts = 2; */ @java.lang.Override - public io.greptime.v1.Database.InsertRequestOrBuilder getInsertOrBuilder() { + public io.greptime.v1.Database.InsertRequestsOrBuilder getInsertsOrBuilder() { if (requestCase_ == 2) { - return (io.greptime.v1.Database.InsertRequest) request_; + return (io.greptime.v1.Database.InsertRequests) request_; } - return io.greptime.v1.Database.InsertRequest.getDefaultInstance(); + return io.greptime.v1.Database.InsertRequests.getDefaultInstance(); } public static final int QUERY_FIELD_NUMBER = 3; @@ -454,7 +456,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) output.writeMessage(1, getHeader()); } if (requestCase_ == 2) { - output.writeMessage(2, (io.greptime.v1.Database.InsertRequest) request_); + output.writeMessage(2, (io.greptime.v1.Database.InsertRequests) request_); } if (requestCase_ == 3) { output.writeMessage(3, (io.greptime.v1.Database.QueryRequest) request_); @@ -480,7 +482,7 @@ public int getSerializedSize() { } if (requestCase_ == 2) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, (io.greptime.v1.Database.InsertRequest) request_); + .computeMessageSize(2, (io.greptime.v1.Database.InsertRequests) request_); } if (requestCase_ == 3) { size += com.google.protobuf.CodedOutputStream @@ -517,8 +519,8 @@ public boolean equals(final java.lang.Object obj) { if (!getRequestCase().equals(other.getRequestCase())) return false; switch (requestCase_) { case 2: - if (!getInsert() - .equals(other.getInsert())) return false; + if (!getInserts() + .equals(other.getInserts())) return false; break; case 3: if (!getQuery() @@ -552,8 +554,8 @@ public int hashCode() { } switch (requestCase_) { case 2: - hash = (37 * hash) + INSERT_FIELD_NUMBER; - hash = (53 * hash) + getInsert().hashCode(); + hash = (37 * hash) + INSERTS_FIELD_NUMBER; + hash = (53 * hash) + getInserts().hashCode(); break; case 3: hash = (37 * hash) + QUERY_FIELD_NUMBER; @@ -743,10 +745,10 @@ public io.greptime.v1.Database.GreptimeRequest buildPartial() { result.header_ = headerBuilder_.build(); } if (requestCase_ == 2) { - if (insertBuilder_ == null) { + if (insertsBuilder_ == null) { result.request_ = request_; } else { - result.request_ = insertBuilder_.build(); + result.request_ = insertsBuilder_.build(); } } if (requestCase_ == 3) { @@ -823,8 +825,8 @@ public Builder mergeFrom(io.greptime.v1.Database.GreptimeRequest other) { mergeHeader(other.getHeader()); } switch (other.getRequestCase()) { - case INSERT: { - mergeInsert(other.getInsert()); + case INSERTS: { + mergeInserts(other.getInserts()); break; } case QUERY: { @@ -1007,71 +1009,71 @@ public io.greptime.v1.Common.RequestHeaderOrBuilder getHeaderOrBuilder() { } private com.google.protobuf.SingleFieldBuilderV3< - io.greptime.v1.Database.InsertRequest, io.greptime.v1.Database.InsertRequest.Builder, io.greptime.v1.Database.InsertRequestOrBuilder> insertBuilder_; + io.greptime.v1.Database.InsertRequests, io.greptime.v1.Database.InsertRequests.Builder, io.greptime.v1.Database.InsertRequestsOrBuilder> insertsBuilder_; /** - * .greptime.v1.InsertRequest insert = 2; - * @return Whether the insert field is set. + * .greptime.v1.InsertRequests inserts = 2; + * @return Whether the inserts field is set. */ @java.lang.Override - public boolean hasInsert() { + public boolean hasInserts() { return requestCase_ == 2; } /** - * .greptime.v1.InsertRequest insert = 2; - * @return The insert. + * .greptime.v1.InsertRequests inserts = 2; + * @return The inserts. */ @java.lang.Override - public io.greptime.v1.Database.InsertRequest getInsert() { - if (insertBuilder_ == null) { + public io.greptime.v1.Database.InsertRequests getInserts() { + if (insertsBuilder_ == null) { if (requestCase_ == 2) { - return (io.greptime.v1.Database.InsertRequest) request_; + return (io.greptime.v1.Database.InsertRequests) request_; } - return io.greptime.v1.Database.InsertRequest.getDefaultInstance(); + return io.greptime.v1.Database.InsertRequests.getDefaultInstance(); } else { if (requestCase_ == 2) { - return insertBuilder_.getMessage(); + return insertsBuilder_.getMessage(); } - return io.greptime.v1.Database.InsertRequest.getDefaultInstance(); + return io.greptime.v1.Database.InsertRequests.getDefaultInstance(); } } /** - * .greptime.v1.InsertRequest insert = 2; + * .greptime.v1.InsertRequests inserts = 2; */ - public Builder setInsert(io.greptime.v1.Database.InsertRequest value) { - if (insertBuilder_ == null) { + public Builder setInserts(io.greptime.v1.Database.InsertRequests value) { + if (insertsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } request_ = value; onChanged(); } else { - insertBuilder_.setMessage(value); + insertsBuilder_.setMessage(value); } requestCase_ = 2; return this; } /** - * .greptime.v1.InsertRequest insert = 2; + * .greptime.v1.InsertRequests inserts = 2; */ - public Builder setInsert( - io.greptime.v1.Database.InsertRequest.Builder builderForValue) { - if (insertBuilder_ == null) { + public Builder setInserts( + io.greptime.v1.Database.InsertRequests.Builder builderForValue) { + if (insertsBuilder_ == null) { request_ = builderForValue.build(); onChanged(); } else { - insertBuilder_.setMessage(builderForValue.build()); + insertsBuilder_.setMessage(builderForValue.build()); } requestCase_ = 2; return this; } /** - * .greptime.v1.InsertRequest insert = 2; + * .greptime.v1.InsertRequests inserts = 2; */ - public Builder mergeInsert(io.greptime.v1.Database.InsertRequest value) { - if (insertBuilder_ == null) { + public Builder mergeInserts(io.greptime.v1.Database.InsertRequests value) { + if (insertsBuilder_ == null) { if (requestCase_ == 2 && - request_ != io.greptime.v1.Database.InsertRequest.getDefaultInstance()) { - request_ = io.greptime.v1.Database.InsertRequest.newBuilder((io.greptime.v1.Database.InsertRequest) request_) + request_ != io.greptime.v1.Database.InsertRequests.getDefaultInstance()) { + request_ = io.greptime.v1.Database.InsertRequests.newBuilder((io.greptime.v1.Database.InsertRequests) request_) .mergeFrom(value).buildPartial(); } else { request_ = value; @@ -1079,18 +1081,19 @@ public Builder mergeInsert(io.greptime.v1.Database.InsertRequest value) { onChanged(); } else { if (requestCase_ == 2) { - insertBuilder_.mergeFrom(value); + insertsBuilder_.mergeFrom(value); + } else { + insertsBuilder_.setMessage(value); } - insertBuilder_.setMessage(value); } requestCase_ = 2; return this; } /** - * .greptime.v1.InsertRequest insert = 2; + * .greptime.v1.InsertRequests inserts = 2; */ - public Builder clearInsert() { - if (insertBuilder_ == null) { + public Builder clearInserts() { + if (insertsBuilder_ == null) { if (requestCase_ == 2) { requestCase_ = 0; request_ = null; @@ -1101,50 +1104,50 @@ public Builder clearInsert() { requestCase_ = 0; request_ = null; } - insertBuilder_.clear(); + insertsBuilder_.clear(); } return this; } /** - * .greptime.v1.InsertRequest insert = 2; + * .greptime.v1.InsertRequests inserts = 2; */ - public io.greptime.v1.Database.InsertRequest.Builder getInsertBuilder() { - return getInsertFieldBuilder().getBuilder(); + public io.greptime.v1.Database.InsertRequests.Builder getInsertsBuilder() { + return getInsertsFieldBuilder().getBuilder(); } /** - * .greptime.v1.InsertRequest insert = 2; + * .greptime.v1.InsertRequests inserts = 2; */ @java.lang.Override - public io.greptime.v1.Database.InsertRequestOrBuilder getInsertOrBuilder() { - if ((requestCase_ == 2) && (insertBuilder_ != null)) { - return insertBuilder_.getMessageOrBuilder(); + public io.greptime.v1.Database.InsertRequestsOrBuilder getInsertsOrBuilder() { + if ((requestCase_ == 2) && (insertsBuilder_ != null)) { + return insertsBuilder_.getMessageOrBuilder(); } else { if (requestCase_ == 2) { - return (io.greptime.v1.Database.InsertRequest) request_; + return (io.greptime.v1.Database.InsertRequests) request_; } - return io.greptime.v1.Database.InsertRequest.getDefaultInstance(); + return io.greptime.v1.Database.InsertRequests.getDefaultInstance(); } } /** - * .greptime.v1.InsertRequest insert = 2; + * .greptime.v1.InsertRequests inserts = 2; */ private com.google.protobuf.SingleFieldBuilderV3< - io.greptime.v1.Database.InsertRequest, io.greptime.v1.Database.InsertRequest.Builder, io.greptime.v1.Database.InsertRequestOrBuilder> - getInsertFieldBuilder() { - if (insertBuilder_ == null) { + io.greptime.v1.Database.InsertRequests, io.greptime.v1.Database.InsertRequests.Builder, io.greptime.v1.Database.InsertRequestsOrBuilder> + getInsertsFieldBuilder() { + if (insertsBuilder_ == null) { if (!(requestCase_ == 2)) { - request_ = io.greptime.v1.Database.InsertRequest.getDefaultInstance(); + request_ = io.greptime.v1.Database.InsertRequests.getDefaultInstance(); } - insertBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - io.greptime.v1.Database.InsertRequest, io.greptime.v1.Database.InsertRequest.Builder, io.greptime.v1.Database.InsertRequestOrBuilder>( - (io.greptime.v1.Database.InsertRequest) request_, + insertsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.greptime.v1.Database.InsertRequests, io.greptime.v1.Database.InsertRequests.Builder, io.greptime.v1.Database.InsertRequestsOrBuilder>( + (io.greptime.v1.Database.InsertRequests) request_, getParentForChildren(), isClean()); request_ = null; } requestCase_ = 2; onChanged();; - return insertBuilder_; + return insertsBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< @@ -1221,8 +1224,9 @@ public Builder mergeQuery(io.greptime.v1.Database.QueryRequest value) { } else { if (requestCase_ == 3) { queryBuilder_.mergeFrom(value); + } else { + queryBuilder_.setMessage(value); } - queryBuilder_.setMessage(value); } requestCase_ = 3; return this; @@ -1362,8 +1366,9 @@ public Builder mergeDdl(io.greptime.v1.Ddl.DdlRequest value) { } else { if (requestCase_ == 4) { ddlBuilder_.mergeFrom(value); + } else { + ddlBuilder_.setMessage(value); } - ddlBuilder_.setMessage(value); } requestCase_ = 4; return this; @@ -1503,8 +1508,9 @@ public Builder mergeDelete(io.greptime.v1.Database.DeleteRequest value) { } else { if (requestCase_ == 5) { deleteBuilder_.mergeFrom(value); + } else { + deleteBuilder_.setMessage(value); } - deleteBuilder_.setMessage(value); } requestCase_ = 5; return this; @@ -1741,6 +1747,8 @@ private GreptimeResponse( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -2424,8 +2432,9 @@ public Builder mergeAffectedRows(io.greptime.v1.Common.AffectedRows value) { } else { if (responseCase_ == 2) { affectedRowsBuilder_.mergeFrom(value); + } else { + affectedRowsBuilder_.setMessage(value); } - affectedRowsBuilder_.setMessage(value); } responseCase_ = 2; return this; @@ -2673,6 +2682,8 @@ private QueryRequest( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -3240,277 +3251,1073 @@ public boolean hasSql() { return queryCase_ == 1; } /** - * string sql = 1; - * @return The sql. + * string sql = 1; + * @return The sql. + */ + @java.lang.Override + public java.lang.String getSql() { + java.lang.Object ref = ""; + if (queryCase_ == 1) { + ref = query_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (queryCase_ == 1) { + query_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string sql = 1; + * @return The bytes for sql. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSqlBytes() { + java.lang.Object ref = ""; + if (queryCase_ == 1) { + ref = query_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (queryCase_ == 1) { + query_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string sql = 1; + * @param value The sql to set. + * @return This builder for chaining. + */ + public Builder setSql( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + queryCase_ = 1; + query_ = value; + onChanged(); + return this; + } + /** + * string sql = 1; + * @return This builder for chaining. + */ + public Builder clearSql() { + if (queryCase_ == 1) { + queryCase_ = 0; + query_ = null; + onChanged(); + } + return this; + } + /** + * string sql = 1; + * @param value The bytes for sql to set. + * @return This builder for chaining. + */ + public Builder setSqlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + queryCase_ = 1; + query_ = value; + onChanged(); + return this; + } + + /** + * bytes logical_plan = 2; + * @return Whether the logicalPlan field is set. + */ + public boolean hasLogicalPlan() { + return queryCase_ == 2; + } + /** + * bytes logical_plan = 2; + * @return The logicalPlan. + */ + public com.google.protobuf.ByteString getLogicalPlan() { + if (queryCase_ == 2) { + return (com.google.protobuf.ByteString) query_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * bytes logical_plan = 2; + * @param value The logicalPlan to set. + * @return This builder for chaining. + */ + public Builder setLogicalPlan(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + queryCase_ = 2; + query_ = value; + onChanged(); + return this; + } + /** + * bytes logical_plan = 2; + * @return This builder for chaining. + */ + public Builder clearLogicalPlan() { + if (queryCase_ == 2) { + queryCase_ = 0; + query_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.greptime.v1.Prometheus.PromRangeQuery, io.greptime.v1.Prometheus.PromRangeQuery.Builder, io.greptime.v1.Prometheus.PromRangeQueryOrBuilder> promRangeQueryBuilder_; + /** + * .greptime.v1.PromRangeQuery prom_range_query = 3; + * @return Whether the promRangeQuery field is set. + */ + @java.lang.Override + public boolean hasPromRangeQuery() { + return queryCase_ == 3; + } + /** + * .greptime.v1.PromRangeQuery prom_range_query = 3; + * @return The promRangeQuery. + */ + @java.lang.Override + public io.greptime.v1.Prometheus.PromRangeQuery getPromRangeQuery() { + if (promRangeQueryBuilder_ == null) { + if (queryCase_ == 3) { + return (io.greptime.v1.Prometheus.PromRangeQuery) query_; + } + return io.greptime.v1.Prometheus.PromRangeQuery.getDefaultInstance(); + } else { + if (queryCase_ == 3) { + return promRangeQueryBuilder_.getMessage(); + } + return io.greptime.v1.Prometheus.PromRangeQuery.getDefaultInstance(); + } + } + /** + * .greptime.v1.PromRangeQuery prom_range_query = 3; + */ + public Builder setPromRangeQuery(io.greptime.v1.Prometheus.PromRangeQuery value) { + if (promRangeQueryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + query_ = value; + onChanged(); + } else { + promRangeQueryBuilder_.setMessage(value); + } + queryCase_ = 3; + return this; + } + /** + * .greptime.v1.PromRangeQuery prom_range_query = 3; + */ + public Builder setPromRangeQuery( + io.greptime.v1.Prometheus.PromRangeQuery.Builder builderForValue) { + if (promRangeQueryBuilder_ == null) { + query_ = builderForValue.build(); + onChanged(); + } else { + promRangeQueryBuilder_.setMessage(builderForValue.build()); + } + queryCase_ = 3; + return this; + } + /** + * .greptime.v1.PromRangeQuery prom_range_query = 3; + */ + public Builder mergePromRangeQuery(io.greptime.v1.Prometheus.PromRangeQuery value) { + if (promRangeQueryBuilder_ == null) { + if (queryCase_ == 3 && + query_ != io.greptime.v1.Prometheus.PromRangeQuery.getDefaultInstance()) { + query_ = io.greptime.v1.Prometheus.PromRangeQuery.newBuilder((io.greptime.v1.Prometheus.PromRangeQuery) query_) + .mergeFrom(value).buildPartial(); + } else { + query_ = value; + } + onChanged(); + } else { + if (queryCase_ == 3) { + promRangeQueryBuilder_.mergeFrom(value); + } else { + promRangeQueryBuilder_.setMessage(value); + } + } + queryCase_ = 3; + return this; + } + /** + * .greptime.v1.PromRangeQuery prom_range_query = 3; + */ + public Builder clearPromRangeQuery() { + if (promRangeQueryBuilder_ == null) { + if (queryCase_ == 3) { + queryCase_ = 0; + query_ = null; + onChanged(); + } + } else { + if (queryCase_ == 3) { + queryCase_ = 0; + query_ = null; + } + promRangeQueryBuilder_.clear(); + } + return this; + } + /** + * .greptime.v1.PromRangeQuery prom_range_query = 3; + */ + public io.greptime.v1.Prometheus.PromRangeQuery.Builder getPromRangeQueryBuilder() { + return getPromRangeQueryFieldBuilder().getBuilder(); + } + /** + * .greptime.v1.PromRangeQuery prom_range_query = 3; + */ + @java.lang.Override + public io.greptime.v1.Prometheus.PromRangeQueryOrBuilder getPromRangeQueryOrBuilder() { + if ((queryCase_ == 3) && (promRangeQueryBuilder_ != null)) { + return promRangeQueryBuilder_.getMessageOrBuilder(); + } else { + if (queryCase_ == 3) { + return (io.greptime.v1.Prometheus.PromRangeQuery) query_; + } + return io.greptime.v1.Prometheus.PromRangeQuery.getDefaultInstance(); + } + } + /** + * .greptime.v1.PromRangeQuery prom_range_query = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.greptime.v1.Prometheus.PromRangeQuery, io.greptime.v1.Prometheus.PromRangeQuery.Builder, io.greptime.v1.Prometheus.PromRangeQueryOrBuilder> + getPromRangeQueryFieldBuilder() { + if (promRangeQueryBuilder_ == null) { + if (!(queryCase_ == 3)) { + query_ = io.greptime.v1.Prometheus.PromRangeQuery.getDefaultInstance(); + } + promRangeQueryBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.greptime.v1.Prometheus.PromRangeQuery, io.greptime.v1.Prometheus.PromRangeQuery.Builder, io.greptime.v1.Prometheus.PromRangeQueryOrBuilder>( + (io.greptime.v1.Prometheus.PromRangeQuery) query_, + getParentForChildren(), + isClean()); + query_ = null; + } + queryCase_ = 3; + onChanged();; + return promRangeQueryBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:greptime.v1.QueryRequest) + } + + // @@protoc_insertion_point(class_scope:greptime.v1.QueryRequest) + private static final io.greptime.v1.Database.QueryRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.greptime.v1.Database.QueryRequest(); + } + + public static io.greptime.v1.Database.QueryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.greptime.v1.Database.QueryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface InsertRequestsOrBuilder extends + // @@protoc_insertion_point(interface_extends:greptime.v1.InsertRequests) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .greptime.v1.InsertRequest inserts = 1; + */ + java.util.List + getInsertsList(); + /** + * repeated .greptime.v1.InsertRequest inserts = 1; + */ + io.greptime.v1.Database.InsertRequest getInserts(int index); + /** + * repeated .greptime.v1.InsertRequest inserts = 1; + */ + int getInsertsCount(); + /** + * repeated .greptime.v1.InsertRequest inserts = 1; + */ + java.util.List + getInsertsOrBuilderList(); + /** + * repeated .greptime.v1.InsertRequest inserts = 1; + */ + io.greptime.v1.Database.InsertRequestOrBuilder getInsertsOrBuilder( + int index); + } + /** + * Protobuf type {@code greptime.v1.InsertRequests} + */ + public static final class InsertRequests extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:greptime.v1.InsertRequests) + InsertRequestsOrBuilder { + private static final long serialVersionUID = 0L; + // Use InsertRequests.newBuilder() to construct. + private InsertRequests(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private InsertRequests() { + inserts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new InsertRequests(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private InsertRequests( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + inserts_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + inserts_.add( + input.readMessage(io.greptime.v1.Database.InsertRequest.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + inserts_ = java.util.Collections.unmodifiableList(inserts_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.greptime.v1.Database.internal_static_greptime_v1_InsertRequests_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.greptime.v1.Database.internal_static_greptime_v1_InsertRequests_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.greptime.v1.Database.InsertRequests.class, io.greptime.v1.Database.InsertRequests.Builder.class); + } + + public static final int INSERTS_FIELD_NUMBER = 1; + private java.util.List inserts_; + /** + * repeated .greptime.v1.InsertRequest inserts = 1; + */ + @java.lang.Override + public java.util.List getInsertsList() { + return inserts_; + } + /** + * repeated .greptime.v1.InsertRequest inserts = 1; + */ + @java.lang.Override + public java.util.List + getInsertsOrBuilderList() { + return inserts_; + } + /** + * repeated .greptime.v1.InsertRequest inserts = 1; + */ + @java.lang.Override + public int getInsertsCount() { + return inserts_.size(); + } + /** + * repeated .greptime.v1.InsertRequest inserts = 1; + */ + @java.lang.Override + public io.greptime.v1.Database.InsertRequest getInserts(int index) { + return inserts_.get(index); + } + /** + * repeated .greptime.v1.InsertRequest inserts = 1; + */ + @java.lang.Override + public io.greptime.v1.Database.InsertRequestOrBuilder getInsertsOrBuilder( + int index) { + return inserts_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < inserts_.size(); i++) { + output.writeMessage(1, inserts_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < inserts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, inserts_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.greptime.v1.Database.InsertRequests)) { + return super.equals(obj); + } + io.greptime.v1.Database.InsertRequests other = (io.greptime.v1.Database.InsertRequests) obj; + + if (!getInsertsList() + .equals(other.getInsertsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getInsertsCount() > 0) { + hash = (37 * hash) + INSERTS_FIELD_NUMBER; + hash = (53 * hash) + getInsertsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.greptime.v1.Database.InsertRequests parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.greptime.v1.Database.InsertRequests parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.greptime.v1.Database.InsertRequests parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.greptime.v1.Database.InsertRequests parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.greptime.v1.Database.InsertRequests parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.greptime.v1.Database.InsertRequests parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.greptime.v1.Database.InsertRequests parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.greptime.v1.Database.InsertRequests parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.greptime.v1.Database.InsertRequests parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.greptime.v1.Database.InsertRequests parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.greptime.v1.Database.InsertRequests parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.greptime.v1.Database.InsertRequests parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.greptime.v1.Database.InsertRequests prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code greptime.v1.InsertRequests} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:greptime.v1.InsertRequests) + io.greptime.v1.Database.InsertRequestsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.greptime.v1.Database.internal_static_greptime_v1_InsertRequests_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.greptime.v1.Database.internal_static_greptime_v1_InsertRequests_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.greptime.v1.Database.InsertRequests.class, io.greptime.v1.Database.InsertRequests.Builder.class); + } + + // Construct using io.greptime.v1.Database.InsertRequests.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getInsertsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (insertsBuilder_ == null) { + inserts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + insertsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.greptime.v1.Database.internal_static_greptime_v1_InsertRequests_descriptor; + } + + @java.lang.Override + public io.greptime.v1.Database.InsertRequests getDefaultInstanceForType() { + return io.greptime.v1.Database.InsertRequests.getDefaultInstance(); + } + + @java.lang.Override + public io.greptime.v1.Database.InsertRequests build() { + io.greptime.v1.Database.InsertRequests result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.greptime.v1.Database.InsertRequests buildPartial() { + io.greptime.v1.Database.InsertRequests result = new io.greptime.v1.Database.InsertRequests(this); + int from_bitField0_ = bitField0_; + if (insertsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + inserts_ = java.util.Collections.unmodifiableList(inserts_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.inserts_ = inserts_; + } else { + result.inserts_ = insertsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.greptime.v1.Database.InsertRequests) { + return mergeFrom((io.greptime.v1.Database.InsertRequests)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.greptime.v1.Database.InsertRequests other) { + if (other == io.greptime.v1.Database.InsertRequests.getDefaultInstance()) return this; + if (insertsBuilder_ == null) { + if (!other.inserts_.isEmpty()) { + if (inserts_.isEmpty()) { + inserts_ = other.inserts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInsertsIsMutable(); + inserts_.addAll(other.inserts_); + } + onChanged(); + } + } else { + if (!other.inserts_.isEmpty()) { + if (insertsBuilder_.isEmpty()) { + insertsBuilder_.dispose(); + insertsBuilder_ = null; + inserts_ = other.inserts_; + bitField0_ = (bitField0_ & ~0x00000001); + insertsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getInsertsFieldBuilder() : null; + } else { + insertsBuilder_.addAllMessages(other.inserts_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.greptime.v1.Database.InsertRequests parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.greptime.v1.Database.InsertRequests) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List inserts_ = + java.util.Collections.emptyList(); + private void ensureInsertsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + inserts_ = new java.util.ArrayList(inserts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.greptime.v1.Database.InsertRequest, io.greptime.v1.Database.InsertRequest.Builder, io.greptime.v1.Database.InsertRequestOrBuilder> insertsBuilder_; + + /** + * repeated .greptime.v1.InsertRequest inserts = 1; */ - @java.lang.Override - public java.lang.String getSql() { - java.lang.Object ref = ""; - if (queryCase_ == 1) { - ref = query_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (queryCase_ == 1) { - query_ = s; - } - return s; + public java.util.List getInsertsList() { + if (insertsBuilder_ == null) { + return java.util.Collections.unmodifiableList(inserts_); } else { - return (java.lang.String) ref; + return insertsBuilder_.getMessageList(); } } /** - * string sql = 1; - * @return The bytes for sql. + * repeated .greptime.v1.InsertRequest inserts = 1; */ - @java.lang.Override - public com.google.protobuf.ByteString - getSqlBytes() { - java.lang.Object ref = ""; - if (queryCase_ == 1) { - ref = query_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (queryCase_ == 1) { - query_ = b; - } - return b; + public int getInsertsCount() { + if (insertsBuilder_ == null) { + return inserts_.size(); } else { - return (com.google.protobuf.ByteString) ref; + return insertsBuilder_.getCount(); } } /** - * string sql = 1; - * @param value The sql to set. - * @return This builder for chaining. + * repeated .greptime.v1.InsertRequest inserts = 1; */ - public Builder setSql( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - queryCase_ = 1; - query_ = value; - onChanged(); - return this; + public io.greptime.v1.Database.InsertRequest getInserts(int index) { + if (insertsBuilder_ == null) { + return inserts_.get(index); + } else { + return insertsBuilder_.getMessage(index); + } } /** - * string sql = 1; - * @return This builder for chaining. + * repeated .greptime.v1.InsertRequest inserts = 1; */ - public Builder clearSql() { - if (queryCase_ == 1) { - queryCase_ = 0; - query_ = null; + public Builder setInserts( + int index, io.greptime.v1.Database.InsertRequest value) { + if (insertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInsertsIsMutable(); + inserts_.set(index, value); onChanged(); + } else { + insertsBuilder_.setMessage(index, value); } return this; } /** - * string sql = 1; - * @param value The bytes for sql to set. - * @return This builder for chaining. + * repeated .greptime.v1.InsertRequest inserts = 1; */ - public Builder setSqlBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - queryCase_ = 1; - query_ = value; - onChanged(); + public Builder setInserts( + int index, io.greptime.v1.Database.InsertRequest.Builder builderForValue) { + if (insertsBuilder_ == null) { + ensureInsertsIsMutable(); + inserts_.set(index, builderForValue.build()); + onChanged(); + } else { + insertsBuilder_.setMessage(index, builderForValue.build()); + } return this; } - - /** - * bytes logical_plan = 2; - * @return Whether the logicalPlan field is set. - */ - public boolean hasLogicalPlan() { - return queryCase_ == 2; - } /** - * bytes logical_plan = 2; - * @return The logicalPlan. + * repeated .greptime.v1.InsertRequest inserts = 1; */ - public com.google.protobuf.ByteString getLogicalPlan() { - if (queryCase_ == 2) { - return (com.google.protobuf.ByteString) query_; + public Builder addInserts(io.greptime.v1.Database.InsertRequest value) { + if (insertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInsertsIsMutable(); + inserts_.add(value); + onChanged(); + } else { + insertsBuilder_.addMessage(value); } - return com.google.protobuf.ByteString.EMPTY; - } - /** - * bytes logical_plan = 2; - * @param value The logicalPlan to set. - * @return This builder for chaining. - */ - public Builder setLogicalPlan(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - queryCase_ = 2; - query_ = value; - onChanged(); return this; } /** - * bytes logical_plan = 2; - * @return This builder for chaining. + * repeated .greptime.v1.InsertRequest inserts = 1; */ - public Builder clearLogicalPlan() { - if (queryCase_ == 2) { - queryCase_ = 0; - query_ = null; + public Builder addInserts( + int index, io.greptime.v1.Database.InsertRequest value) { + if (insertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInsertsIsMutable(); + inserts_.add(index, value); onChanged(); + } else { + insertsBuilder_.addMessage(index, value); } return this; } - - private com.google.protobuf.SingleFieldBuilderV3< - io.greptime.v1.Prometheus.PromRangeQuery, io.greptime.v1.Prometheus.PromRangeQuery.Builder, io.greptime.v1.Prometheus.PromRangeQueryOrBuilder> promRangeQueryBuilder_; - /** - * .greptime.v1.PromRangeQuery prom_range_query = 3; - * @return Whether the promRangeQuery field is set. - */ - @java.lang.Override - public boolean hasPromRangeQuery() { - return queryCase_ == 3; - } /** - * .greptime.v1.PromRangeQuery prom_range_query = 3; - * @return The promRangeQuery. + * repeated .greptime.v1.InsertRequest inserts = 1; */ - @java.lang.Override - public io.greptime.v1.Prometheus.PromRangeQuery getPromRangeQuery() { - if (promRangeQueryBuilder_ == null) { - if (queryCase_ == 3) { - return (io.greptime.v1.Prometheus.PromRangeQuery) query_; - } - return io.greptime.v1.Prometheus.PromRangeQuery.getDefaultInstance(); + public Builder addInserts( + io.greptime.v1.Database.InsertRequest.Builder builderForValue) { + if (insertsBuilder_ == null) { + ensureInsertsIsMutable(); + inserts_.add(builderForValue.build()); + onChanged(); } else { - if (queryCase_ == 3) { - return promRangeQueryBuilder_.getMessage(); - } - return io.greptime.v1.Prometheus.PromRangeQuery.getDefaultInstance(); + insertsBuilder_.addMessage(builderForValue.build()); } + return this; } /** - * .greptime.v1.PromRangeQuery prom_range_query = 3; + * repeated .greptime.v1.InsertRequest inserts = 1; */ - public Builder setPromRangeQuery(io.greptime.v1.Prometheus.PromRangeQuery value) { - if (promRangeQueryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - query_ = value; + public Builder addInserts( + int index, io.greptime.v1.Database.InsertRequest.Builder builderForValue) { + if (insertsBuilder_ == null) { + ensureInsertsIsMutable(); + inserts_.add(index, builderForValue.build()); onChanged(); } else { - promRangeQueryBuilder_.setMessage(value); + insertsBuilder_.addMessage(index, builderForValue.build()); } - queryCase_ = 3; return this; } /** - * .greptime.v1.PromRangeQuery prom_range_query = 3; + * repeated .greptime.v1.InsertRequest inserts = 1; */ - public Builder setPromRangeQuery( - io.greptime.v1.Prometheus.PromRangeQuery.Builder builderForValue) { - if (promRangeQueryBuilder_ == null) { - query_ = builderForValue.build(); + public Builder addAllInserts( + java.lang.Iterable values) { + if (insertsBuilder_ == null) { + ensureInsertsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, inserts_); onChanged(); } else { - promRangeQueryBuilder_.setMessage(builderForValue.build()); + insertsBuilder_.addAllMessages(values); } - queryCase_ = 3; return this; } /** - * .greptime.v1.PromRangeQuery prom_range_query = 3; + * repeated .greptime.v1.InsertRequest inserts = 1; */ - public Builder mergePromRangeQuery(io.greptime.v1.Prometheus.PromRangeQuery value) { - if (promRangeQueryBuilder_ == null) { - if (queryCase_ == 3 && - query_ != io.greptime.v1.Prometheus.PromRangeQuery.getDefaultInstance()) { - query_ = io.greptime.v1.Prometheus.PromRangeQuery.newBuilder((io.greptime.v1.Prometheus.PromRangeQuery) query_) - .mergeFrom(value).buildPartial(); - } else { - query_ = value; - } + public Builder clearInserts() { + if (insertsBuilder_ == null) { + inserts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { - if (queryCase_ == 3) { - promRangeQueryBuilder_.mergeFrom(value); - } - promRangeQueryBuilder_.setMessage(value); + insertsBuilder_.clear(); } - queryCase_ = 3; return this; } /** - * .greptime.v1.PromRangeQuery prom_range_query = 3; + * repeated .greptime.v1.InsertRequest inserts = 1; */ - public Builder clearPromRangeQuery() { - if (promRangeQueryBuilder_ == null) { - if (queryCase_ == 3) { - queryCase_ = 0; - query_ = null; - onChanged(); - } + public Builder removeInserts(int index) { + if (insertsBuilder_ == null) { + ensureInsertsIsMutable(); + inserts_.remove(index); + onChanged(); } else { - if (queryCase_ == 3) { - queryCase_ = 0; - query_ = null; - } - promRangeQueryBuilder_.clear(); + insertsBuilder_.remove(index); } return this; } /** - * .greptime.v1.PromRangeQuery prom_range_query = 3; + * repeated .greptime.v1.InsertRequest inserts = 1; */ - public io.greptime.v1.Prometheus.PromRangeQuery.Builder getPromRangeQueryBuilder() { - return getPromRangeQueryFieldBuilder().getBuilder(); + public io.greptime.v1.Database.InsertRequest.Builder getInsertsBuilder( + int index) { + return getInsertsFieldBuilder().getBuilder(index); } /** - * .greptime.v1.PromRangeQuery prom_range_query = 3; + * repeated .greptime.v1.InsertRequest inserts = 1; */ - @java.lang.Override - public io.greptime.v1.Prometheus.PromRangeQueryOrBuilder getPromRangeQueryOrBuilder() { - if ((queryCase_ == 3) && (promRangeQueryBuilder_ != null)) { - return promRangeQueryBuilder_.getMessageOrBuilder(); + public io.greptime.v1.Database.InsertRequestOrBuilder getInsertsOrBuilder( + int index) { + if (insertsBuilder_ == null) { + return inserts_.get(index); } else { + return insertsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .greptime.v1.InsertRequest inserts = 1; + */ + public java.util.List + getInsertsOrBuilderList() { + if (insertsBuilder_ != null) { + return insertsBuilder_.getMessageOrBuilderList(); } else { - if (queryCase_ == 3) { - return (io.greptime.v1.Prometheus.PromRangeQuery) query_; - } - return io.greptime.v1.Prometheus.PromRangeQuery.getDefaultInstance(); + return java.util.Collections.unmodifiableList(inserts_); } } /** - * .greptime.v1.PromRangeQuery prom_range_query = 3; + * repeated .greptime.v1.InsertRequest inserts = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< - io.greptime.v1.Prometheus.PromRangeQuery, io.greptime.v1.Prometheus.PromRangeQuery.Builder, io.greptime.v1.Prometheus.PromRangeQueryOrBuilder> - getPromRangeQueryFieldBuilder() { - if (promRangeQueryBuilder_ == null) { - if (!(queryCase_ == 3)) { - query_ = io.greptime.v1.Prometheus.PromRangeQuery.getDefaultInstance(); - } - promRangeQueryBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - io.greptime.v1.Prometheus.PromRangeQuery, io.greptime.v1.Prometheus.PromRangeQuery.Builder, io.greptime.v1.Prometheus.PromRangeQueryOrBuilder>( - (io.greptime.v1.Prometheus.PromRangeQuery) query_, + public io.greptime.v1.Database.InsertRequest.Builder addInsertsBuilder() { + return getInsertsFieldBuilder().addBuilder( + io.greptime.v1.Database.InsertRequest.getDefaultInstance()); + } + /** + * repeated .greptime.v1.InsertRequest inserts = 1; + */ + public io.greptime.v1.Database.InsertRequest.Builder addInsertsBuilder( + int index) { + return getInsertsFieldBuilder().addBuilder( + index, io.greptime.v1.Database.InsertRequest.getDefaultInstance()); + } + /** + * repeated .greptime.v1.InsertRequest inserts = 1; + */ + public java.util.List + getInsertsBuilderList() { + return getInsertsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.greptime.v1.Database.InsertRequest, io.greptime.v1.Database.InsertRequest.Builder, io.greptime.v1.Database.InsertRequestOrBuilder> + getInsertsFieldBuilder() { + if (insertsBuilder_ == null) { + insertsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.greptime.v1.Database.InsertRequest, io.greptime.v1.Database.InsertRequest.Builder, io.greptime.v1.Database.InsertRequestOrBuilder>( + inserts_, + ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - query_ = null; + inserts_ = null; } - queryCase_ = 3; - onChanged();; - return promRangeQueryBuilder_; + return insertsBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -3525,41 +4332,41 @@ public final Builder mergeUnknownFields( } - // @@protoc_insertion_point(builder_scope:greptime.v1.QueryRequest) + // @@protoc_insertion_point(builder_scope:greptime.v1.InsertRequests) } - // @@protoc_insertion_point(class_scope:greptime.v1.QueryRequest) - private static final io.greptime.v1.Database.QueryRequest DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:greptime.v1.InsertRequests) + private static final io.greptime.v1.Database.InsertRequests DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new io.greptime.v1.Database.QueryRequest(); + DEFAULT_INSTANCE = new io.greptime.v1.Database.InsertRequests(); } - public static io.greptime.v1.Database.QueryRequest getDefaultInstance() { + public static io.greptime.v1.Database.InsertRequests getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public QueryRequest parsePartialFrom( + public InsertRequests parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new QueryRequest(input, extensionRegistry); + return new InsertRequests(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public io.greptime.v1.Database.QueryRequest getDefaultInstanceForType() { + public io.greptime.v1.Database.InsertRequests getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -3730,6 +4537,8 @@ private InsertRequest( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -4979,6 +5788,8 @@ private DeleteRequest( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -6100,6 +6911,11 @@ public io.greptime.v1.Database.DeleteRequest getDefaultInstanceForType() { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_greptime_v1_QueryRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_greptime_v1_InsertRequests_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_greptime_v1_InsertRequests_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_greptime_v1_InsertRequest_descriptor; private static final @@ -6122,32 +6938,34 @@ public io.greptime.v1.Database.DeleteRequest getDefaultInstanceForType() { "\n\032greptime/v1/database.proto\022\013greptime.v" + "1\032\025greptime/v1/ddl.proto\032\030greptime/v1/co" + "lumn.proto\032\026greptime/v1/prom.proto\032\030grep" + - "time/v1/common.proto\"\370\001\n\017GreptimeRequest" + + "time/v1/common.proto\"\372\001\n\017GreptimeRequest" + "\022*\n\006header\030\001 \001(\0132\032.greptime.v1.RequestHe" + - "ader\022,\n\006insert\030\002 \001(\0132\032.greptime.v1.Inser" + - "tRequestH\000\022*\n\005query\030\003 \001(\0132\031.greptime.v1." + - "QueryRequestH\000\022&\n\003ddl\030\004 \001(\0132\027.greptime.v" + - "1.DdlRequestH\000\022,\n\006delete\030\005 \001(\0132\032.greptim" + - "e.v1.DeleteRequestH\000B\t\n\007request\"\177\n\020Grept" + - "imeResponse\022+\n\006header\030\001 \001(\0132\033.greptime.v" + - "1.ResponseHeader\0222\n\raffected_rows\030\002 \001(\0132" + - "\031.greptime.v1.AffectedRowsH\000B\n\n\010response" + - "\"w\n\014QueryRequest\022\r\n\003sql\030\001 \001(\tH\000\022\026\n\014logic" + - "al_plan\030\002 \001(\014H\000\0227\n\020prom_range_query\030\003 \001(" + - "\0132\033.greptime.v1.PromRangeQueryH\000B\007\n\005quer" + - "y\"s\n\rInsertRequest\022\022\n\ntable_name\030\001 \001(\t\022$" + - "\n\007columns\030\003 \003(\0132\023.greptime.v1.Column\022\021\n\t" + - "row_count\030\004 \001(\r\022\025\n\rregion_number\030\005 \001(\r\"w" + - "\n\rDeleteRequest\022\022\n\ntable_name\030\001 \001(\t\022\025\n\rr" + - "egion_number\030\002 \001(\r\022(\n\013key_columns\030\003 \003(\0132" + - "\023.greptime.v1.Column\022\021\n\trow_count\030\004 \001(\r2" + - "\252\001\n\020GreptimeDatabase\022E\n\006Handle\022\034.greptim" + - "e.v1.GreptimeRequest\032\035.greptime.v1.Grept" + - "imeResponse\022O\n\016HandleRequests\022\034.greptime" + - ".v1.GreptimeRequest\032\035.greptime.v1.Grepti" + - "meResponse(\001BQ\n\016io.greptime.v1B\010Database" + - "Z5github.com/GreptimeTeam/greptime-proto" + - "/go/greptime/v1b\006proto3" + "ader\022.\n\007inserts\030\002 \001(\0132\033.greptime.v1.Inse" + + "rtRequestsH\000\022*\n\005query\030\003 \001(\0132\031.greptime.v" + + "1.QueryRequestH\000\022&\n\003ddl\030\004 \001(\0132\027.greptime" + + ".v1.DdlRequestH\000\022,\n\006delete\030\005 \001(\0132\032.grept" + + "ime.v1.DeleteRequestH\000B\t\n\007request\"\177\n\020Gre" + + "ptimeResponse\022+\n\006header\030\001 \001(\0132\033.greptime" + + ".v1.ResponseHeader\0222\n\raffected_rows\030\002 \001(" + + "\0132\031.greptime.v1.AffectedRowsH\000B\n\n\010respon" + + "se\"w\n\014QueryRequest\022\r\n\003sql\030\001 \001(\tH\000\022\026\n\014log" + + "ical_plan\030\002 \001(\014H\000\0227\n\020prom_range_query\030\003 " + + "\001(\0132\033.greptime.v1.PromRangeQueryH\000B\007\n\005qu" + + "ery\"=\n\016InsertRequests\022+\n\007inserts\030\001 \003(\0132\032" + + ".greptime.v1.InsertRequest\"s\n\rInsertRequ" + + "est\022\022\n\ntable_name\030\001 \001(\t\022$\n\007columns\030\003 \003(\013" + + "2\023.greptime.v1.Column\022\021\n\trow_count\030\004 \001(\r" + + "\022\025\n\rregion_number\030\005 \001(\r\"w\n\rDeleteRequest" + + "\022\022\n\ntable_name\030\001 \001(\t\022\025\n\rregion_number\030\002 " + + "\001(\r\022(\n\013key_columns\030\003 \003(\0132\023.greptime.v1.C" + + "olumn\022\021\n\trow_count\030\004 \001(\r2\252\001\n\020GreptimeDat" + + "abase\022E\n\006Handle\022\034.greptime.v1.GreptimeRe" + + "quest\032\035.greptime.v1.GreptimeResponse\022O\n\016" + + "HandleRequests\022\034.greptime.v1.GreptimeReq" + + "uest\032\035.greptime.v1.GreptimeResponse(\001BQ\n" + + "\016io.greptime.v1B\010DatabaseZ5github.com/Gr" + + "eptimeTeam/greptime-proto/go/greptime/v1" + + "b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -6162,7 +6980,7 @@ public io.greptime.v1.Database.DeleteRequest getDefaultInstanceForType() { internal_static_greptime_v1_GreptimeRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_greptime_v1_GreptimeRequest_descriptor, - new java.lang.String[] { "Header", "Insert", "Query", "Ddl", "Delete", "Request", }); + new java.lang.String[] { "Header", "Inserts", "Query", "Ddl", "Delete", "Request", }); internal_static_greptime_v1_GreptimeResponse_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_greptime_v1_GreptimeResponse_fieldAccessorTable = new @@ -6175,14 +6993,20 @@ public io.greptime.v1.Database.DeleteRequest getDefaultInstanceForType() { com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_greptime_v1_QueryRequest_descriptor, new java.lang.String[] { "Sql", "LogicalPlan", "PromRangeQuery", "Query", }); - internal_static_greptime_v1_InsertRequest_descriptor = + internal_static_greptime_v1_InsertRequests_descriptor = getDescriptor().getMessageTypes().get(3); + internal_static_greptime_v1_InsertRequests_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_greptime_v1_InsertRequests_descriptor, + new java.lang.String[] { "Inserts", }); + internal_static_greptime_v1_InsertRequest_descriptor = + getDescriptor().getMessageTypes().get(4); internal_static_greptime_v1_InsertRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_greptime_v1_InsertRequest_descriptor, new java.lang.String[] { "TableName", "Columns", "RowCount", "RegionNumber", }); internal_static_greptime_v1_DeleteRequest_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(5); internal_static_greptime_v1_DeleteRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_greptime_v1_DeleteRequest_descriptor, diff --git a/java/src/main/java/io/greptime/v1/Ddl.java b/java/src/main/java/io/greptime/v1/Ddl.java index 792db1e3..1addfb60 100644 --- a/java/src/main/java/io/greptime/v1/Ddl.java +++ b/java/src/main/java/io/greptime/v1/Ddl.java @@ -228,6 +228,8 @@ private DdlRequest( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -979,8 +981,9 @@ public Builder mergeCreateDatabase(io.greptime.v1.Ddl.CreateDatabaseExpr value) } else { if (exprCase_ == 1) { createDatabaseBuilder_.mergeFrom(value); + } else { + createDatabaseBuilder_.setMessage(value); } - createDatabaseBuilder_.setMessage(value); } exprCase_ = 1; return this; @@ -1120,8 +1123,9 @@ public Builder mergeCreateTable(io.greptime.v1.Ddl.CreateTableExpr value) { } else { if (exprCase_ == 2) { createTableBuilder_.mergeFrom(value); + } else { + createTableBuilder_.setMessage(value); } - createTableBuilder_.setMessage(value); } exprCase_ = 2; return this; @@ -1261,8 +1265,9 @@ public Builder mergeAlter(io.greptime.v1.Ddl.AlterExpr value) { } else { if (exprCase_ == 3) { alterBuilder_.mergeFrom(value); + } else { + alterBuilder_.setMessage(value); } - alterBuilder_.setMessage(value); } exprCase_ = 3; return this; @@ -1402,8 +1407,9 @@ public Builder mergeDropTable(io.greptime.v1.Ddl.DropTableExpr value) { } else { if (exprCase_ == 4) { dropTableBuilder_.mergeFrom(value); + } else { + dropTableBuilder_.setMessage(value); } - dropTableBuilder_.setMessage(value); } exprCase_ = 4; return this; @@ -1543,8 +1549,9 @@ public Builder mergeFlushTable(io.greptime.v1.Ddl.FlushTableExpr value) { } else { if (exprCase_ == 5) { flushTableBuilder_.mergeFrom(value); + } else { + flushTableBuilder_.setMessage(value); } - flushTableBuilder_.setMessage(value); } exprCase_ = 5; return this; @@ -1805,9 +1812,11 @@ boolean containsTableOptions( * map<string, string> table_options = 9; */ - java.lang.String getTableOptionsOrDefault( + /* nullable */ +java.lang.String getTableOptionsOrDefault( java.lang.String key, - java.lang.String defaultValue); + /* nullable */ +java.lang.String defaultValue); /** * map<string, string> table_options = 9; */ @@ -2031,6 +2040,8 @@ private CreateTableExpr( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -4566,6 +4577,8 @@ private AlterExpr( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -5585,8 +5598,9 @@ public Builder mergeAddColumns(io.greptime.v1.Ddl.AddColumns value) { } else { if (kindCase_ == 4) { addColumnsBuilder_.mergeFrom(value); + } else { + addColumnsBuilder_.setMessage(value); } - addColumnsBuilder_.setMessage(value); } kindCase_ = 4; return this; @@ -5726,8 +5740,9 @@ public Builder mergeDropColumns(io.greptime.v1.Ddl.DropColumns value) { } else { if (kindCase_ == 5) { dropColumnsBuilder_.mergeFrom(value); + } else { + dropColumnsBuilder_.setMessage(value); } - dropColumnsBuilder_.setMessage(value); } kindCase_ = 5; return this; @@ -5867,8 +5882,9 @@ public Builder mergeRenameTable(io.greptime.v1.Ddl.RenameTable value) { } else { if (kindCase_ == 6) { renameTableBuilder_.mergeFrom(value); + } else { + renameTableBuilder_.setMessage(value); } - renameTableBuilder_.setMessage(value); } kindCase_ = 6; return this; @@ -6103,6 +6119,8 @@ private DropTableExpr( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -6988,6 +7006,8 @@ private FlushTableExpr( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -7925,6 +7945,8 @@ private CreateDatabaseExpr( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -8597,6 +8619,8 @@ private AddColumns( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -9390,6 +9414,8 @@ private DropColumns( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -10167,6 +10193,8 @@ private RenameTable( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -10783,6 +10811,8 @@ private AddColumn( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -10901,6 +10931,8 @@ private Location( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -12413,6 +12445,8 @@ private DropColumn( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -12973,6 +13007,8 @@ private TableId( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); diff --git a/java/src/main/java/io/greptime/v1/Prometheus.java b/java/src/main/java/io/greptime/v1/Prometheus.java index 2dac8d14..5a6bc9b9 100644 --- a/java/src/main/java/io/greptime/v1/Prometheus.java +++ b/java/src/main/java/io/greptime/v1/Prometheus.java @@ -162,6 +162,8 @@ private PromqlRequest( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -904,8 +906,9 @@ public Builder mergeInstantQuery(io.greptime.v1.Prometheus.PromInstantQuery valu } else { if (promqlCase_ == 2) { instantQueryBuilder_.mergeFrom(value); + } else { + instantQueryBuilder_.setMessage(value); } - instantQueryBuilder_.setMessage(value); } promqlCase_ = 2; return this; @@ -1045,8 +1048,9 @@ public Builder mergeRangeQuery(io.greptime.v1.Prometheus.PromRangeQuery value) { } else { if (promqlCase_ == 3) { rangeQueryBuilder_.mergeFrom(value); + } else { + rangeQueryBuilder_.setMessage(value); } - rangeQueryBuilder_.setMessage(value); } promqlCase_ = 3; return this; @@ -1268,6 +1272,8 @@ private PromqlResponse( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -1977,6 +1983,8 @@ private PromInstantQuery( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); @@ -2733,6 +2741,8 @@ private PromRangeQuery( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this);