From 917ca3a42b92b5689779001b506eaa82edf351bf Mon Sep 17 00:00:00 2001 From: zyy17 Date: Tue, 14 Feb 2023 16:16:57 +0800 Subject: [PATCH 1/6] feat: add go protobuf generation --- .gitignore | 2 + Makefile | 19 +- README.md | 43 +- go.mod | 16 + go.sum | 20 + go/greptime/v1/column.pb.go | 721 +++++++++++++ go/greptime/v1/database.pb.go | 635 +++++++++++ go/greptime/v1/ddl.pb.go | 1127 ++++++++++++++++++++ go/greptime/v1/meta/cluster.pb.go | 262 +++++ go/greptime/v1/meta/cluster_grpc.pb.go | 145 +++ go/greptime/v1/meta/common.pb.go | 632 +++++++++++ go/greptime/v1/meta/heartbeat.pb.go | 851 +++++++++++++++ go/greptime/v1/meta/heartbeat_grpc.pb.go | 184 ++++ go/greptime/v1/meta/lock.pb.go | 408 +++++++ go/greptime/v1/meta/lock_grpc.pb.go | 147 +++ go/greptime/v1/meta/route.pb.go | 967 +++++++++++++++++ go/greptime/v1/meta/route_grpc.pb.go | 215 ++++ go/greptime/v1/meta/store.pb.go | 1236 ++++++++++++++++++++++ go/greptime/v1/meta/store_grpc.pb.go | 299 ++++++ go/prometheus/remote/remote.pb.go | 647 +++++++++++ go/prometheus/remote/types.pb.go | 1142 ++++++++++++++++++++ proto/greptime/v1/column.proto | 1 + proto/greptime/v1/database.proto | 1 + proto/greptime/v1/ddl.proto | 1 + proto/greptime/v1/meta/cluster.proto | 2 + proto/greptime/v1/meta/common.proto | 2 + proto/greptime/v1/meta/heartbeat.proto | 2 + proto/greptime/v1/meta/lock.proto | 2 + proto/greptime/v1/meta/route.proto | 2 + proto/greptime/v1/meta/store.proto | 2 + proto/prometheus/remote/remote.proto | 2 +- proto/prometheus/remote/types.proto | 2 +- scripts/generate-go.sh | 24 + scripts/install-protobuf-go-plugins.sh | 11 + scripts/install-protoc.sh | 43 + 35 files changed, 9807 insertions(+), 8 deletions(-) create mode 100644 go.mod create mode 100644 go.sum create mode 100644 go/greptime/v1/column.pb.go create mode 100644 go/greptime/v1/database.pb.go create mode 100644 go/greptime/v1/ddl.pb.go create mode 100644 go/greptime/v1/meta/cluster.pb.go create mode 100644 go/greptime/v1/meta/cluster_grpc.pb.go create mode 100644 go/greptime/v1/meta/common.pb.go create mode 100644 go/greptime/v1/meta/heartbeat.pb.go create mode 100644 go/greptime/v1/meta/heartbeat_grpc.pb.go create mode 100644 go/greptime/v1/meta/lock.pb.go create mode 100644 go/greptime/v1/meta/lock_grpc.pb.go create mode 100644 go/greptime/v1/meta/route.pb.go create mode 100644 go/greptime/v1/meta/route_grpc.pb.go create mode 100644 go/greptime/v1/meta/store.pb.go create mode 100644 go/greptime/v1/meta/store_grpc.pb.go create mode 100644 go/prometheus/remote/remote.pb.go create mode 100644 go/prometheus/remote/types.pb.go create mode 100755 scripts/generate-go.sh create mode 100755 scripts/install-protobuf-go-plugins.sh create mode 100755 scripts/install-protoc.sh diff --git a/.gitignore b/.gitignore index 088ba6ba..1dd7e771 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ Cargo.lock # These are backup files generated by rustfmt **/*.rs.bk + +bin/ diff --git a/Makefile b/Makefile index eb4ac0f7..544f4265 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,21 @@ -.PHONY: all rust +.PHONY: all rust go go-deps install-protoc clean -all: rust +all: rust go rust: cargo build + +go: install-protoc install-protobuf-go-plugins go-deps + ./scripts/generate-go.sh + +go-deps: + go mod download + +install-protoc: + ./scripts/install-protoc.sh + +install-protobuf-go-plugins: + ./scripts/install-protobuf-go-plugins.sh + +clean: + rm -rf bin diff --git a/README.md b/README.md index 0c3774e6..5006830f 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,27 @@ GreptimeDB protobuf files. ### Command -```text -make -``` +- **Compile for Rust** + + ```console + make rust + ``` + +- **Compile for Go** + + ```console + make go + ``` + + The compilation will install `protoc`/ `protoc-gen-go` / `protoc-gen-go-grpc` locally. + +- **Install protoc locally** + + ```console + make install-protoc + ``` + + Then the `protoc` will install in `./bin/`. ## Usage @@ -34,6 +52,23 @@ use greptime_proto::v1::meta::*; use greptime_proto::prometheus::remote::*; ``` +### Go + +Download the go module: + +```console +go get github.com/GreptimeTeam/greptime-proto@main +``` + +Then use greptime-proto as the normal Go module: + +```go +import ( + greptimev1 "github.com/GreptimeTeam/greptime-proto/go/greptime/v1" +) +... +``` + ## For SDK developers GreptimeDB's gRPC service is built on top of [Arrow Flight RPC](https://arrow.apache.org/docs/format/Flight.html). You can find the Arrow's official implementation status of each programming language [here](https://arrow.apache.org/docs/status.html#flight-rpc). @@ -42,7 +77,7 @@ GreptimeDB's gRPC service is built on top of [Arrow Flight RPC](https://arrow.ap Once the Arrow Flight client is ready, you only need to care about the following 3 protobuf files to accomplish our SDK writing: -```text +```console . ├── greptime │   └── v1 diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..72d10e37 --- /dev/null +++ b/go.mod @@ -0,0 +1,16 @@ +module github.com/GreptimeTeam/greptime-proto + +go 1.18 + +require ( + google.golang.org/grpc v1.53.0 + google.golang.org/protobuf v1.28.1 +) + +require ( + github.com/golang/protobuf v1.5.2 // indirect + golang.org/x/net v0.5.0 // indirect + golang.org/x/sys v0.4.0 // indirect + golang.org/x/text v0.6.0 // indirect + google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..751fe9d3 --- /dev/null +++ b/go.sum @@ -0,0 +1,20 @@ +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/go/greptime/v1/column.pb.go b/go/greptime/v1/column.pb.go new file mode 100644 index 00000000..0d1af94d --- /dev/null +++ b/go/greptime/v1/column.pb.go @@ -0,0 +1,721 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.7 +// source: greptime/v1/column.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ColumnDataType int32 + +const ( + ColumnDataType_BOOLEAN ColumnDataType = 0 + ColumnDataType_INT8 ColumnDataType = 1 + ColumnDataType_INT16 ColumnDataType = 2 + ColumnDataType_INT32 ColumnDataType = 3 + ColumnDataType_INT64 ColumnDataType = 4 + ColumnDataType_UINT8 ColumnDataType = 5 + ColumnDataType_UINT16 ColumnDataType = 6 + ColumnDataType_UINT32 ColumnDataType = 7 + ColumnDataType_UINT64 ColumnDataType = 8 + ColumnDataType_FLOAT32 ColumnDataType = 9 + ColumnDataType_FLOAT64 ColumnDataType = 10 + ColumnDataType_BINARY ColumnDataType = 11 + ColumnDataType_STRING ColumnDataType = 12 + ColumnDataType_DATE ColumnDataType = 13 + ColumnDataType_DATETIME ColumnDataType = 14 + ColumnDataType_TIMESTAMP_SECOND ColumnDataType = 15 + ColumnDataType_TIMESTAMP_MILLISECOND ColumnDataType = 16 + ColumnDataType_TIMESTAMP_MICROSECOND ColumnDataType = 17 + ColumnDataType_TIMESTAMP_NANOSECOND ColumnDataType = 18 +) + +// Enum value maps for ColumnDataType. +var ( + ColumnDataType_name = map[int32]string{ + 0: "BOOLEAN", + 1: "INT8", + 2: "INT16", + 3: "INT32", + 4: "INT64", + 5: "UINT8", + 6: "UINT16", + 7: "UINT32", + 8: "UINT64", + 9: "FLOAT32", + 10: "FLOAT64", + 11: "BINARY", + 12: "STRING", + 13: "DATE", + 14: "DATETIME", + 15: "TIMESTAMP_SECOND", + 16: "TIMESTAMP_MILLISECOND", + 17: "TIMESTAMP_MICROSECOND", + 18: "TIMESTAMP_NANOSECOND", + } + ColumnDataType_value = map[string]int32{ + "BOOLEAN": 0, + "INT8": 1, + "INT16": 2, + "INT32": 3, + "INT64": 4, + "UINT8": 5, + "UINT16": 6, + "UINT32": 7, + "UINT64": 8, + "FLOAT32": 9, + "FLOAT64": 10, + "BINARY": 11, + "STRING": 12, + "DATE": 13, + "DATETIME": 14, + "TIMESTAMP_SECOND": 15, + "TIMESTAMP_MILLISECOND": 16, + "TIMESTAMP_MICROSECOND": 17, + "TIMESTAMP_NANOSECOND": 18, + } +) + +func (x ColumnDataType) Enum() *ColumnDataType { + p := new(ColumnDataType) + *p = x + return p +} + +func (x ColumnDataType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ColumnDataType) Descriptor() protoreflect.EnumDescriptor { + return file_greptime_v1_column_proto_enumTypes[0].Descriptor() +} + +func (ColumnDataType) Type() protoreflect.EnumType { + return &file_greptime_v1_column_proto_enumTypes[0] +} + +func (x ColumnDataType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ColumnDataType.Descriptor instead. +func (ColumnDataType) EnumDescriptor() ([]byte, []int) { + return file_greptime_v1_column_proto_rawDescGZIP(), []int{0} +} + +type Column_SemanticType int32 + +const ( + Column_TAG Column_SemanticType = 0 + Column_FIELD Column_SemanticType = 1 + Column_TIMESTAMP Column_SemanticType = 2 +) + +// Enum value maps for Column_SemanticType. +var ( + Column_SemanticType_name = map[int32]string{ + 0: "TAG", + 1: "FIELD", + 2: "TIMESTAMP", + } + Column_SemanticType_value = map[string]int32{ + "TAG": 0, + "FIELD": 1, + "TIMESTAMP": 2, + } +) + +func (x Column_SemanticType) Enum() *Column_SemanticType { + p := new(Column_SemanticType) + *p = x + return p +} + +func (x Column_SemanticType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Column_SemanticType) Descriptor() protoreflect.EnumDescriptor { + return file_greptime_v1_column_proto_enumTypes[1].Descriptor() +} + +func (Column_SemanticType) Type() protoreflect.EnumType { + return &file_greptime_v1_column_proto_enumTypes[1] +} + +func (x Column_SemanticType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Column_SemanticType.Descriptor instead. +func (Column_SemanticType) EnumDescriptor() ([]byte, []int) { + return file_greptime_v1_column_proto_rawDescGZIP(), []int{0, 0} +} + +type Column struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ColumnName string `protobuf:"bytes,1,opt,name=column_name,json=columnName,proto3" json:"column_name,omitempty"` + SemanticType Column_SemanticType `protobuf:"varint,2,opt,name=semantic_type,json=semanticType,proto3,enum=greptime.v1.Column_SemanticType" json:"semantic_type,omitempty"` + // The array of non-null values in this column. + // + // For example: suppose there is a column "foo" that contains some int32 values (1, 2, 3, 4, 5, null, 7, 8, 9, null); + // column: + // column_name: foo + // semantic_type: Tag + // values: 1, 2, 3, 4, 5, 7, 8, 9 + // null_masks: 00100000 00000010 + Values *Column_Values `protobuf:"bytes,3,opt,name=values,proto3" json:"values,omitempty"` + // Mask maps the positions of null values. + // If a bit in null_mask is 1, it indicates that the column value at that position is null. + NullMask []byte `protobuf:"bytes,4,opt,name=null_mask,json=nullMask,proto3" json:"null_mask,omitempty"` + // Helpful in creating vector from column. + Datatype ColumnDataType `protobuf:"varint,5,opt,name=datatype,proto3,enum=greptime.v1.ColumnDataType" json:"datatype,omitempty"` +} + +func (x *Column) Reset() { + *x = Column{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_column_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Column) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Column) ProtoMessage() {} + +func (x *Column) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_column_proto_msgTypes[0] + 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 Column.ProtoReflect.Descriptor instead. +func (*Column) Descriptor() ([]byte, []int) { + return file_greptime_v1_column_proto_rawDescGZIP(), []int{0} +} + +func (x *Column) GetColumnName() string { + if x != nil { + return x.ColumnName + } + return "" +} + +func (x *Column) GetSemanticType() Column_SemanticType { + if x != nil { + return x.SemanticType + } + return Column_TAG +} + +func (x *Column) GetValues() *Column_Values { + if x != nil { + return x.Values + } + return nil +} + +func (x *Column) GetNullMask() []byte { + if x != nil { + return x.NullMask + } + return nil +} + +func (x *Column) GetDatatype() ColumnDataType { + if x != nil { + return x.Datatype + } + return ColumnDataType_BOOLEAN +} + +type ColumnDef struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Datatype ColumnDataType `protobuf:"varint,2,opt,name=datatype,proto3,enum=greptime.v1.ColumnDataType" json:"datatype,omitempty"` + IsNullable bool `protobuf:"varint,3,opt,name=is_nullable,json=isNullable,proto3" json:"is_nullable,omitempty"` + DefaultConstraint []byte `protobuf:"bytes,4,opt,name=default_constraint,json=defaultConstraint,proto3" json:"default_constraint,omitempty"` +} + +func (x *ColumnDef) Reset() { + *x = ColumnDef{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_column_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ColumnDef) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ColumnDef) ProtoMessage() {} + +func (x *ColumnDef) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_column_proto_msgTypes[1] + 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 ColumnDef.ProtoReflect.Descriptor instead. +func (*ColumnDef) Descriptor() ([]byte, []int) { + return file_greptime_v1_column_proto_rawDescGZIP(), []int{1} +} + +func (x *ColumnDef) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ColumnDef) GetDatatype() ColumnDataType { + if x != nil { + return x.Datatype + } + return ColumnDataType_BOOLEAN +} + +func (x *ColumnDef) GetIsNullable() bool { + if x != nil { + return x.IsNullable + } + return false +} + +func (x *ColumnDef) GetDefaultConstraint() []byte { + if x != nil { + return x.DefaultConstraint + } + return nil +} + +type Column_Values struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + I8Values []int32 `protobuf:"varint,1,rep,packed,name=i8_values,json=i8Values,proto3" json:"i8_values,omitempty"` + I16Values []int32 `protobuf:"varint,2,rep,packed,name=i16_values,json=i16Values,proto3" json:"i16_values,omitempty"` + I32Values []int32 `protobuf:"varint,3,rep,packed,name=i32_values,json=i32Values,proto3" json:"i32_values,omitempty"` + I64Values []int64 `protobuf:"varint,4,rep,packed,name=i64_values,json=i64Values,proto3" json:"i64_values,omitempty"` + U8Values []uint32 `protobuf:"varint,5,rep,packed,name=u8_values,json=u8Values,proto3" json:"u8_values,omitempty"` + U16Values []uint32 `protobuf:"varint,6,rep,packed,name=u16_values,json=u16Values,proto3" json:"u16_values,omitempty"` + U32Values []uint32 `protobuf:"varint,7,rep,packed,name=u32_values,json=u32Values,proto3" json:"u32_values,omitempty"` + U64Values []uint64 `protobuf:"varint,8,rep,packed,name=u64_values,json=u64Values,proto3" json:"u64_values,omitempty"` + F32Values []float32 `protobuf:"fixed32,9,rep,packed,name=f32_values,json=f32Values,proto3" json:"f32_values,omitempty"` + F64Values []float64 `protobuf:"fixed64,10,rep,packed,name=f64_values,json=f64Values,proto3" json:"f64_values,omitempty"` + BoolValues []bool `protobuf:"varint,11,rep,packed,name=bool_values,json=boolValues,proto3" json:"bool_values,omitempty"` + BinaryValues [][]byte `protobuf:"bytes,12,rep,name=binary_values,json=binaryValues,proto3" json:"binary_values,omitempty"` + StringValues []string `protobuf:"bytes,13,rep,name=string_values,json=stringValues,proto3" json:"string_values,omitempty"` + DateValues []int32 `protobuf:"varint,14,rep,packed,name=date_values,json=dateValues,proto3" json:"date_values,omitempty"` + DatetimeValues []int64 `protobuf:"varint,15,rep,packed,name=datetime_values,json=datetimeValues,proto3" json:"datetime_values,omitempty"` + TsSecondValues []int64 `protobuf:"varint,16,rep,packed,name=ts_second_values,json=tsSecondValues,proto3" json:"ts_second_values,omitempty"` + TsMillisecondValues []int64 `protobuf:"varint,17,rep,packed,name=ts_millisecond_values,json=tsMillisecondValues,proto3" json:"ts_millisecond_values,omitempty"` + TsMicrosecondValues []int64 `protobuf:"varint,18,rep,packed,name=ts_microsecond_values,json=tsMicrosecondValues,proto3" json:"ts_microsecond_values,omitempty"` + TsNanosecondValues []int64 `protobuf:"varint,19,rep,packed,name=ts_nanosecond_values,json=tsNanosecondValues,proto3" json:"ts_nanosecond_values,omitempty"` +} + +func (x *Column_Values) Reset() { + *x = Column_Values{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_column_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Column_Values) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Column_Values) ProtoMessage() {} + +func (x *Column_Values) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_column_proto_msgTypes[2] + 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 Column_Values.ProtoReflect.Descriptor instead. +func (*Column_Values) Descriptor() ([]byte, []int) { + return file_greptime_v1_column_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Column_Values) GetI8Values() []int32 { + if x != nil { + return x.I8Values + } + return nil +} + +func (x *Column_Values) GetI16Values() []int32 { + if x != nil { + return x.I16Values + } + return nil +} + +func (x *Column_Values) GetI32Values() []int32 { + if x != nil { + return x.I32Values + } + return nil +} + +func (x *Column_Values) GetI64Values() []int64 { + if x != nil { + return x.I64Values + } + return nil +} + +func (x *Column_Values) GetU8Values() []uint32 { + if x != nil { + return x.U8Values + } + return nil +} + +func (x *Column_Values) GetU16Values() []uint32 { + if x != nil { + return x.U16Values + } + return nil +} + +func (x *Column_Values) GetU32Values() []uint32 { + if x != nil { + return x.U32Values + } + return nil +} + +func (x *Column_Values) GetU64Values() []uint64 { + if x != nil { + return x.U64Values + } + return nil +} + +func (x *Column_Values) GetF32Values() []float32 { + if x != nil { + return x.F32Values + } + return nil +} + +func (x *Column_Values) GetF64Values() []float64 { + if x != nil { + return x.F64Values + } + return nil +} + +func (x *Column_Values) GetBoolValues() []bool { + if x != nil { + return x.BoolValues + } + return nil +} + +func (x *Column_Values) GetBinaryValues() [][]byte { + if x != nil { + return x.BinaryValues + } + return nil +} + +func (x *Column_Values) GetStringValues() []string { + if x != nil { + return x.StringValues + } + return nil +} + +func (x *Column_Values) GetDateValues() []int32 { + if x != nil { + return x.DateValues + } + return nil +} + +func (x *Column_Values) GetDatetimeValues() []int64 { + if x != nil { + return x.DatetimeValues + } + return nil +} + +func (x *Column_Values) GetTsSecondValues() []int64 { + if x != nil { + return x.TsSecondValues + } + return nil +} + +func (x *Column_Values) GetTsMillisecondValues() []int64 { + if x != nil { + return x.TsMillisecondValues + } + return nil +} + +func (x *Column_Values) GetTsMicrosecondValues() []int64 { + if x != nil { + return x.TsMicrosecondValues + } + return nil +} + +func (x *Column_Values) GetTsNanosecondValues() []int64 { + if x != nil { + return x.TsNanosecondValues + } + return nil +} + +var File_greptime_v1_column_proto protoreflect.FileDescriptor + +var file_greptime_v1_column_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x67, 0x72, 0x65, 0x70, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x22, 0xe3, 0x07, 0x0a, 0x06, 0x43, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x45, 0x0a, 0x0d, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x65, + 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2e, + 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x73, 0x65, + 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, + 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2e, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1b, + 0x0a, 0x09, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x37, 0x0a, 0x08, 0x64, + 0x61, 0x74, 0x61, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, + 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, + 0x74, 0x79, 0x70, 0x65, 0x1a, 0xb3, 0x05, 0x0a, 0x06, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, + 0x1b, 0x0a, 0x09, 0x69, 0x38, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x05, 0x52, 0x08, 0x69, 0x38, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x69, 0x31, 0x36, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, + 0x52, 0x09, 0x69, 0x31, 0x36, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x69, + 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, + 0x09, 0x69, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x36, + 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x09, + 0x69, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x38, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, 0x75, 0x38, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x31, 0x36, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x09, 0x75, 0x31, 0x36, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x09, 0x75, 0x33, 0x32, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x04, 0x52, 0x09, 0x75, 0x36, 0x34, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x33, 0x32, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x02, 0x52, 0x09, 0x66, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x0a, 0x20, 0x03, 0x28, 0x01, 0x52, 0x09, 0x66, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x0b, 0x20, 0x03, 0x28, 0x08, 0x52, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x62, 0x69, 0x6e, 0x61, 0x72, + 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, + 0x05, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x27, 0x0a, + 0x0f, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x0f, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0e, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x73, 0x5f, 0x73, 0x65, 0x63, + 0x6f, 0x6e, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x03, + 0x52, 0x0e, 0x74, 0x73, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x12, 0x32, 0x0a, 0x15, 0x74, 0x73, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x03, 0x52, + 0x13, 0x74, 0x73, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x74, 0x73, 0x5f, 0x6d, 0x69, 0x63, 0x72, 0x6f, + 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x12, 0x20, + 0x03, 0x28, 0x03, 0x52, 0x13, 0x74, 0x73, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x74, 0x73, 0x5f, 0x6e, + 0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x13, 0x20, 0x03, 0x28, 0x03, 0x52, 0x12, 0x74, 0x73, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x65, + 0x63, 0x6f, 0x6e, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x31, 0x0a, 0x0c, 0x53, 0x65, + 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x41, + 0x47, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x10, 0x01, 0x12, 0x0d, + 0x0a, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x02, 0x22, 0xa8, 0x01, + 0x0a, 0x09, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x44, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x37, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, + 0x64, 0x61, 0x74, 0x61, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x6e, + 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, + 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, + 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x2a, 0xa7, 0x02, 0x0a, 0x0e, 0x43, 0x6f, 0x6c, + 0x75, 0x6d, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x42, + 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x54, 0x38, + 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x31, 0x36, 0x10, 0x02, 0x12, 0x09, 0x0a, + 0x05, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x36, + 0x34, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x49, 0x4e, 0x54, 0x38, 0x10, 0x05, 0x12, 0x0a, + 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x31, 0x36, 0x10, 0x06, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x49, + 0x4e, 0x54, 0x33, 0x32, 0x10, 0x07, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, + 0x10, 0x08, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x33, 0x32, 0x10, 0x09, 0x12, + 0x0b, 0x0a, 0x07, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x36, 0x34, 0x10, 0x0a, 0x12, 0x0a, 0x0a, 0x06, + 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x0b, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, + 0x4e, 0x47, 0x10, 0x0c, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x41, 0x54, 0x45, 0x10, 0x0d, 0x12, 0x0c, + 0x0a, 0x08, 0x44, 0x41, 0x54, 0x45, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x0e, 0x12, 0x14, 0x0a, 0x10, + 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x5f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, + 0x10, 0x0f, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x5f, + 0x4d, 0x49, 0x4c, 0x4c, 0x49, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x10, 0x12, 0x19, 0x0a, + 0x15, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x5f, 0x4d, 0x49, 0x43, 0x52, 0x4f, + 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x11, 0x12, 0x18, 0x0a, 0x14, 0x54, 0x49, 0x4d, 0x45, + 0x53, 0x54, 0x41, 0x4d, 0x50, 0x5f, 0x4e, 0x41, 0x4e, 0x4f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, + 0x10, 0x12, 0x42, 0x50, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, + 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 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 ( + file_greptime_v1_column_proto_rawDescOnce sync.Once + file_greptime_v1_column_proto_rawDescData = file_greptime_v1_column_proto_rawDesc +) + +func file_greptime_v1_column_proto_rawDescGZIP() []byte { + file_greptime_v1_column_proto_rawDescOnce.Do(func() { + file_greptime_v1_column_proto_rawDescData = protoimpl.X.CompressGZIP(file_greptime_v1_column_proto_rawDescData) + }) + return file_greptime_v1_column_proto_rawDescData +} + +var file_greptime_v1_column_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_greptime_v1_column_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_greptime_v1_column_proto_goTypes = []interface{}{ + (ColumnDataType)(0), // 0: greptime.v1.ColumnDataType + (Column_SemanticType)(0), // 1: greptime.v1.Column.SemanticType + (*Column)(nil), // 2: greptime.v1.Column + (*ColumnDef)(nil), // 3: greptime.v1.ColumnDef + (*Column_Values)(nil), // 4: greptime.v1.Column.Values +} +var file_greptime_v1_column_proto_depIdxs = []int32{ + 1, // 0: greptime.v1.Column.semantic_type:type_name -> greptime.v1.Column.SemanticType + 4, // 1: greptime.v1.Column.values:type_name -> greptime.v1.Column.Values + 0, // 2: greptime.v1.Column.datatype:type_name -> greptime.v1.ColumnDataType + 0, // 3: greptime.v1.ColumnDef.datatype:type_name -> greptime.v1.ColumnDataType + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_greptime_v1_column_proto_init() } +func file_greptime_v1_column_proto_init() { + if File_greptime_v1_column_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_greptime_v1_column_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Column); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_column_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ColumnDef); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_column_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Column_Values); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_greptime_v1_column_proto_rawDesc, + NumEnums: 2, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_greptime_v1_column_proto_goTypes, + DependencyIndexes: file_greptime_v1_column_proto_depIdxs, + EnumInfos: file_greptime_v1_column_proto_enumTypes, + MessageInfos: file_greptime_v1_column_proto_msgTypes, + }.Build() + File_greptime_v1_column_proto = out.File + file_greptime_v1_column_proto_rawDesc = nil + file_greptime_v1_column_proto_goTypes = nil + file_greptime_v1_column_proto_depIdxs = nil +} diff --git a/go/greptime/v1/database.pb.go b/go/greptime/v1/database.pb.go new file mode 100644 index 00000000..d6aa0c7b --- /dev/null +++ b/go/greptime/v1/database.pb.go @@ -0,0 +1,635 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.7 +// source: greptime/v1/database.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RequestHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The `catalog` that is selected to be used in this request. + Catalog string `protobuf:"bytes,1,opt,name=catalog,proto3" json:"catalog,omitempty"` + // The `schema` that is selected to be used in this request. + Schema string `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` +} + +func (x *RequestHeader) Reset() { + *x = RequestHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_database_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RequestHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestHeader) ProtoMessage() {} + +func (x *RequestHeader) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_database_proto_msgTypes[0] + 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 RequestHeader.ProtoReflect.Descriptor instead. +func (*RequestHeader) Descriptor() ([]byte, []int) { + return file_greptime_v1_database_proto_rawDescGZIP(), []int{0} +} + +func (x *RequestHeader) GetCatalog() string { + if x != nil { + return x.Catalog + } + return "" +} + +func (x *RequestHeader) GetSchema() string { + if x != nil { + return x.Schema + } + return "" +} + +type GreptimeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // Types that are assignable to Request: + // *GreptimeRequest_Insert + // *GreptimeRequest_Query + // *GreptimeRequest_Ddl + Request isGreptimeRequest_Request `protobuf_oneof:"request"` +} + +func (x *GreptimeRequest) Reset() { + *x = GreptimeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_database_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GreptimeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GreptimeRequest) ProtoMessage() {} + +func (x *GreptimeRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_database_proto_msgTypes[1] + 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 GreptimeRequest.ProtoReflect.Descriptor instead. +func (*GreptimeRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_database_proto_rawDescGZIP(), []int{1} +} + +func (x *GreptimeRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (m *GreptimeRequest) GetRequest() isGreptimeRequest_Request { + if m != nil { + return m.Request + } + return nil +} + +func (x *GreptimeRequest) GetInsert() *InsertRequest { + if x, ok := x.GetRequest().(*GreptimeRequest_Insert); ok { + return x.Insert + } + return nil +} + +func (x *GreptimeRequest) GetQuery() *QueryRequest { + if x, ok := x.GetRequest().(*GreptimeRequest_Query); ok { + return x.Query + } + return nil +} + +func (x *GreptimeRequest) GetDdl() *DdlRequest { + if x, ok := x.GetRequest().(*GreptimeRequest_Ddl); ok { + return x.Ddl + } + return nil +} + +type isGreptimeRequest_Request interface { + isGreptimeRequest_Request() +} + +type GreptimeRequest_Insert struct { + Insert *InsertRequest `protobuf:"bytes,2,opt,name=insert,proto3,oneof"` +} + +type GreptimeRequest_Query struct { + Query *QueryRequest `protobuf:"bytes,3,opt,name=query,proto3,oneof"` +} + +type GreptimeRequest_Ddl struct { + Ddl *DdlRequest `protobuf:"bytes,4,opt,name=ddl,proto3,oneof"` +} + +func (*GreptimeRequest_Insert) isGreptimeRequest_Request() {} + +func (*GreptimeRequest_Query) isGreptimeRequest_Request() {} + +func (*GreptimeRequest_Ddl) isGreptimeRequest_Request() {} + +type QueryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Query: + // *QueryRequest_Sql + // *QueryRequest_LogicalPlan + Query isQueryRequest_Query `protobuf_oneof:"query"` +} + +func (x *QueryRequest) Reset() { + *x = QueryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_database_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRequest) ProtoMessage() {} + +func (x *QueryRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_database_proto_msgTypes[2] + 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 QueryRequest.ProtoReflect.Descriptor instead. +func (*QueryRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_database_proto_rawDescGZIP(), []int{2} +} + +func (m *QueryRequest) GetQuery() isQueryRequest_Query { + if m != nil { + return m.Query + } + return nil +} + +func (x *QueryRequest) GetSql() string { + if x, ok := x.GetQuery().(*QueryRequest_Sql); ok { + return x.Sql + } + return "" +} + +func (x *QueryRequest) GetLogicalPlan() []byte { + if x, ok := x.GetQuery().(*QueryRequest_LogicalPlan); ok { + return x.LogicalPlan + } + return nil +} + +type isQueryRequest_Query interface { + isQueryRequest_Query() +} + +type QueryRequest_Sql struct { + Sql string `protobuf:"bytes,1,opt,name=sql,proto3,oneof"` +} + +type QueryRequest_LogicalPlan struct { + LogicalPlan []byte `protobuf:"bytes,2,opt,name=logical_plan,json=logicalPlan,proto3,oneof"` +} + +func (*QueryRequest_Sql) isQueryRequest_Query() {} + +func (*QueryRequest_LogicalPlan) isQueryRequest_Query() {} + +type InsertRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` + // Data is represented here. + Columns []*Column `protobuf:"bytes,3,rep,name=columns,proto3" json:"columns,omitempty"` + // The row_count of all columns, which include null and non-null values. + // + // Note: the row_count of all columns in a InsertRequest must be same. + RowCount uint32 `protobuf:"varint,4,opt,name=row_count,json=rowCount,proto3" json:"row_count,omitempty"` + // The region number of current insert request. + RegionNumber uint32 `protobuf:"varint,5,opt,name=region_number,json=regionNumber,proto3" json:"region_number,omitempty"` +} + +func (x *InsertRequest) Reset() { + *x = InsertRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_database_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InsertRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InsertRequest) ProtoMessage() {} + +func (x *InsertRequest) 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 InsertRequest.ProtoReflect.Descriptor instead. +func (*InsertRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_database_proto_rawDescGZIP(), []int{3} +} + +func (x *InsertRequest) GetTableName() string { + if x != nil { + return x.TableName + } + return "" +} + +func (x *InsertRequest) GetColumns() []*Column { + if x != nil { + return x.Columns + } + return nil +} + +func (x *InsertRequest) GetRowCount() uint32 { + if x != nil { + return x.RowCount + } + return 0 +} + +func (x *InsertRequest) GetRegionNumber() uint32 { + if x != nil { + return x.RegionNumber + } + return 0 +} + +type AffectedRows struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *AffectedRows) Reset() { + *x = AffectedRows{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_database_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AffectedRows) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AffectedRows) ProtoMessage() {} + +func (x *AffectedRows) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_database_proto_msgTypes[4] + 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 AffectedRows.ProtoReflect.Descriptor instead. +func (*AffectedRows) Descriptor() ([]byte, []int) { + return file_greptime_v1_database_proto_rawDescGZIP(), []int{4} +} + +func (x *AffectedRows) GetValue() uint32 { + if x != nil { + return x.Value + } + return 0 +} + +type FlightMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AffectedRows *AffectedRows `protobuf:"bytes,1,opt,name=affected_rows,json=affectedRows,proto3" json:"affected_rows,omitempty"` +} + +func (x *FlightMetadata) Reset() { + *x = FlightMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_database_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FlightMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlightMetadata) ProtoMessage() {} + +func (x *FlightMetadata) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_database_proto_msgTypes[5] + 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 FlightMetadata.ProtoReflect.Descriptor instead. +func (*FlightMetadata) Descriptor() ([]byte, []int) { + return file_greptime_v1_database_proto_rawDescGZIP(), []int{5} +} + +func (x *FlightMetadata) GetAffectedRows() *AffectedRows { + if x != nil { + return x.AffectedRows + } + return nil +} + +var File_greptime_v1_database_proto protoreflect.FileDescriptor + +var file_greptime_v1_database_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61, + 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x67, 0x72, + 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x15, 0x67, 0x72, 0x65, 0x70, 0x74, + 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x64, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x18, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x41, 0x0a, 0x0d, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, + 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, + 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0xe6, 0x01, + 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, 0x42, 0x09, 0x0a, 0x07, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 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, 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, 0x24, 0x0a, 0x0c, 0x41, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0x50, 0x0a, 0x0e, 0x46, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x3e, 0x0a, 0x0d, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, + 0x6f, 0x77, 0x73, 0x18, 0x01, 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, 0x52, 0x0c, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, + 0x77, 0x73, 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 ( + file_greptime_v1_database_proto_rawDescOnce sync.Once + file_greptime_v1_database_proto_rawDescData = file_greptime_v1_database_proto_rawDesc +) + +func file_greptime_v1_database_proto_rawDescGZIP() []byte { + file_greptime_v1_database_proto_rawDescOnce.Do(func() { + file_greptime_v1_database_proto_rawDescData = protoimpl.X.CompressGZIP(file_greptime_v1_database_proto_rawDescData) + }) + return file_greptime_v1_database_proto_rawDescData +} + +var file_greptime_v1_database_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_greptime_v1_database_proto_goTypes = []interface{}{ + (*RequestHeader)(nil), // 0: greptime.v1.RequestHeader + (*GreptimeRequest)(nil), // 1: greptime.v1.GreptimeRequest + (*QueryRequest)(nil), // 2: greptime.v1.QueryRequest + (*InsertRequest)(nil), // 3: greptime.v1.InsertRequest + (*AffectedRows)(nil), // 4: greptime.v1.AffectedRows + (*FlightMetadata)(nil), // 5: greptime.v1.FlightMetadata + (*DdlRequest)(nil), // 6: greptime.v1.DdlRequest + (*Column)(nil), // 7: greptime.v1.Column +} +var file_greptime_v1_database_proto_depIdxs = []int32{ + 0, // 0: greptime.v1.GreptimeRequest.header:type_name -> greptime.v1.RequestHeader + 3, // 1: greptime.v1.GreptimeRequest.insert:type_name -> greptime.v1.InsertRequest + 2, // 2: greptime.v1.GreptimeRequest.query:type_name -> greptime.v1.QueryRequest + 6, // 3: greptime.v1.GreptimeRequest.ddl:type_name -> greptime.v1.DdlRequest + 7, // 4: greptime.v1.InsertRequest.columns:type_name -> greptime.v1.Column + 4, // 5: greptime.v1.FlightMetadata.affected_rows:type_name -> greptime.v1.AffectedRows + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_greptime_v1_database_proto_init() } +func file_greptime_v1_database_proto_init() { + if File_greptime_v1_database_proto != nil { + return + } + file_greptime_v1_ddl_proto_init() + file_greptime_v1_column_proto_init() + if !protoimpl.UnsafeEnabled { + file_greptime_v1_database_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RequestHeader); 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[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GreptimeRequest); 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[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequest); 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[3].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[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AffectedRows); 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.(*FlightMetadata); 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[1].OneofWrappers = []interface{}{ + (*GreptimeRequest_Insert)(nil), + (*GreptimeRequest_Query)(nil), + (*GreptimeRequest_Ddl)(nil), + } + file_greptime_v1_database_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*QueryRequest_Sql)(nil), + (*QueryRequest_LogicalPlan)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_greptime_v1_database_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_greptime_v1_database_proto_goTypes, + DependencyIndexes: file_greptime_v1_database_proto_depIdxs, + MessageInfos: file_greptime_v1_database_proto_msgTypes, + }.Build() + File_greptime_v1_database_proto = out.File + file_greptime_v1_database_proto_rawDesc = nil + file_greptime_v1_database_proto_goTypes = nil + file_greptime_v1_database_proto_depIdxs = nil +} diff --git a/go/greptime/v1/ddl.pb.go b/go/greptime/v1/ddl.pb.go new file mode 100644 index 00000000..b1445c5a --- /dev/null +++ b/go/greptime/v1/ddl.pb.go @@ -0,0 +1,1127 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.7 +// source: greptime/v1/ddl.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// "Data Definition Language" requests, that create, modify or delete the database structures but not the data. +// `DdlRequest` could carry more information than plain SQL, for example, the "table_id" in `CreateTableExpr`. +// So create a new DDL expr if you need it. +type DdlRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Expr: + // *DdlRequest_CreateDatabase + // *DdlRequest_CreateTable + // *DdlRequest_Alter + // *DdlRequest_DropTable + Expr isDdlRequest_Expr `protobuf_oneof:"expr"` +} + +func (x *DdlRequest) Reset() { + *x = DdlRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_ddl_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DdlRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DdlRequest) ProtoMessage() {} + +func (x *DdlRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_ddl_proto_msgTypes[0] + 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 DdlRequest.ProtoReflect.Descriptor instead. +func (*DdlRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_ddl_proto_rawDescGZIP(), []int{0} +} + +func (m *DdlRequest) GetExpr() isDdlRequest_Expr { + if m != nil { + return m.Expr + } + return nil +} + +func (x *DdlRequest) GetCreateDatabase() *CreateDatabaseExpr { + if x, ok := x.GetExpr().(*DdlRequest_CreateDatabase); ok { + return x.CreateDatabase + } + return nil +} + +func (x *DdlRequest) GetCreateTable() *CreateTableExpr { + if x, ok := x.GetExpr().(*DdlRequest_CreateTable); ok { + return x.CreateTable + } + return nil +} + +func (x *DdlRequest) GetAlter() *AlterExpr { + if x, ok := x.GetExpr().(*DdlRequest_Alter); ok { + return x.Alter + } + return nil +} + +func (x *DdlRequest) GetDropTable() *DropTableExpr { + if x, ok := x.GetExpr().(*DdlRequest_DropTable); ok { + return x.DropTable + } + return nil +} + +type isDdlRequest_Expr interface { + isDdlRequest_Expr() +} + +type DdlRequest_CreateDatabase struct { + CreateDatabase *CreateDatabaseExpr `protobuf:"bytes,1,opt,name=create_database,json=createDatabase,proto3,oneof"` +} + +type DdlRequest_CreateTable struct { + CreateTable *CreateTableExpr `protobuf:"bytes,2,opt,name=create_table,json=createTable,proto3,oneof"` +} + +type DdlRequest_Alter struct { + Alter *AlterExpr `protobuf:"bytes,3,opt,name=alter,proto3,oneof"` +} + +type DdlRequest_DropTable struct { + DropTable *DropTableExpr `protobuf:"bytes,4,opt,name=drop_table,json=dropTable,proto3,oneof"` +} + +func (*DdlRequest_CreateDatabase) isDdlRequest_Expr() {} + +func (*DdlRequest_CreateTable) isDdlRequest_Expr() {} + +func (*DdlRequest_Alter) isDdlRequest_Expr() {} + +func (*DdlRequest_DropTable) isDdlRequest_Expr() {} + +type CreateTableExpr struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CatalogName string `protobuf:"bytes,1,opt,name=catalog_name,json=catalogName,proto3" json:"catalog_name,omitempty"` + SchemaName string `protobuf:"bytes,2,opt,name=schema_name,json=schemaName,proto3" json:"schema_name,omitempty"` + TableName string `protobuf:"bytes,3,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` + Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` + ColumnDefs []*ColumnDef `protobuf:"bytes,5,rep,name=column_defs,json=columnDefs,proto3" json:"column_defs,omitempty"` + TimeIndex string `protobuf:"bytes,6,opt,name=time_index,json=timeIndex,proto3" json:"time_index,omitempty"` + PrimaryKeys []string `protobuf:"bytes,7,rep,name=primary_keys,json=primaryKeys,proto3" json:"primary_keys,omitempty"` + CreateIfNotExists bool `protobuf:"varint,8,opt,name=create_if_not_exists,json=createIfNotExists,proto3" json:"create_if_not_exists,omitempty"` + TableOptions map[string]string `protobuf:"bytes,9,rep,name=table_options,json=tableOptions,proto3" json:"table_options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + TableId *TableId `protobuf:"bytes,10,opt,name=table_id,json=tableId,proto3" json:"table_id,omitempty"` + RegionIds []uint32 `protobuf:"varint,11,rep,packed,name=region_ids,json=regionIds,proto3" json:"region_ids,omitempty"` +} + +func (x *CreateTableExpr) Reset() { + *x = CreateTableExpr{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_ddl_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateTableExpr) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateTableExpr) ProtoMessage() {} + +func (x *CreateTableExpr) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_ddl_proto_msgTypes[1] + 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 CreateTableExpr.ProtoReflect.Descriptor instead. +func (*CreateTableExpr) Descriptor() ([]byte, []int) { + return file_greptime_v1_ddl_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateTableExpr) GetCatalogName() string { + if x != nil { + return x.CatalogName + } + return "" +} + +func (x *CreateTableExpr) GetSchemaName() string { + if x != nil { + return x.SchemaName + } + return "" +} + +func (x *CreateTableExpr) GetTableName() string { + if x != nil { + return x.TableName + } + return "" +} + +func (x *CreateTableExpr) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *CreateTableExpr) GetColumnDefs() []*ColumnDef { + if x != nil { + return x.ColumnDefs + } + return nil +} + +func (x *CreateTableExpr) GetTimeIndex() string { + if x != nil { + return x.TimeIndex + } + return "" +} + +func (x *CreateTableExpr) GetPrimaryKeys() []string { + if x != nil { + return x.PrimaryKeys + } + return nil +} + +func (x *CreateTableExpr) GetCreateIfNotExists() bool { + if x != nil { + return x.CreateIfNotExists + } + return false +} + +func (x *CreateTableExpr) GetTableOptions() map[string]string { + if x != nil { + return x.TableOptions + } + return nil +} + +func (x *CreateTableExpr) GetTableId() *TableId { + if x != nil { + return x.TableId + } + return nil +} + +func (x *CreateTableExpr) GetRegionIds() []uint32 { + if x != nil { + return x.RegionIds + } + return nil +} + +type AlterExpr struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CatalogName string `protobuf:"bytes,1,opt,name=catalog_name,json=catalogName,proto3" json:"catalog_name,omitempty"` + SchemaName string `protobuf:"bytes,2,opt,name=schema_name,json=schemaName,proto3" json:"schema_name,omitempty"` + TableName string `protobuf:"bytes,3,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` + // Types that are assignable to Kind: + // *AlterExpr_AddColumns + // *AlterExpr_DropColumns + // *AlterExpr_RenameTable + Kind isAlterExpr_Kind `protobuf_oneof:"kind"` +} + +func (x *AlterExpr) Reset() { + *x = AlterExpr{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_ddl_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AlterExpr) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AlterExpr) ProtoMessage() {} + +func (x *AlterExpr) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_ddl_proto_msgTypes[2] + 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 AlterExpr.ProtoReflect.Descriptor instead. +func (*AlterExpr) Descriptor() ([]byte, []int) { + return file_greptime_v1_ddl_proto_rawDescGZIP(), []int{2} +} + +func (x *AlterExpr) GetCatalogName() string { + if x != nil { + return x.CatalogName + } + return "" +} + +func (x *AlterExpr) GetSchemaName() string { + if x != nil { + return x.SchemaName + } + return "" +} + +func (x *AlterExpr) GetTableName() string { + if x != nil { + return x.TableName + } + return "" +} + +func (m *AlterExpr) GetKind() isAlterExpr_Kind { + if m != nil { + return m.Kind + } + return nil +} + +func (x *AlterExpr) GetAddColumns() *AddColumns { + if x, ok := x.GetKind().(*AlterExpr_AddColumns); ok { + return x.AddColumns + } + return nil +} + +func (x *AlterExpr) GetDropColumns() *DropColumns { + if x, ok := x.GetKind().(*AlterExpr_DropColumns); ok { + return x.DropColumns + } + return nil +} + +func (x *AlterExpr) GetRenameTable() *RenameTable { + if x, ok := x.GetKind().(*AlterExpr_RenameTable); ok { + return x.RenameTable + } + return nil +} + +type isAlterExpr_Kind interface { + isAlterExpr_Kind() +} + +type AlterExpr_AddColumns struct { + AddColumns *AddColumns `protobuf:"bytes,4,opt,name=add_columns,json=addColumns,proto3,oneof"` +} + +type AlterExpr_DropColumns struct { + DropColumns *DropColumns `protobuf:"bytes,5,opt,name=drop_columns,json=dropColumns,proto3,oneof"` +} + +type AlterExpr_RenameTable struct { + RenameTable *RenameTable `protobuf:"bytes,6,opt,name=rename_table,json=renameTable,proto3,oneof"` +} + +func (*AlterExpr_AddColumns) isAlterExpr_Kind() {} + +func (*AlterExpr_DropColumns) isAlterExpr_Kind() {} + +func (*AlterExpr_RenameTable) isAlterExpr_Kind() {} + +type DropTableExpr struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CatalogName string `protobuf:"bytes,1,opt,name=catalog_name,json=catalogName,proto3" json:"catalog_name,omitempty"` + SchemaName string `protobuf:"bytes,2,opt,name=schema_name,json=schemaName,proto3" json:"schema_name,omitempty"` + TableName string `protobuf:"bytes,3,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` +} + +func (x *DropTableExpr) Reset() { + *x = DropTableExpr{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_ddl_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DropTableExpr) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DropTableExpr) ProtoMessage() {} + +func (x *DropTableExpr) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_ddl_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 DropTableExpr.ProtoReflect.Descriptor instead. +func (*DropTableExpr) Descriptor() ([]byte, []int) { + return file_greptime_v1_ddl_proto_rawDescGZIP(), []int{3} +} + +func (x *DropTableExpr) GetCatalogName() string { + if x != nil { + return x.CatalogName + } + return "" +} + +func (x *DropTableExpr) GetSchemaName() string { + if x != nil { + return x.SchemaName + } + return "" +} + +func (x *DropTableExpr) GetTableName() string { + if x != nil { + return x.TableName + } + return "" +} + +type CreateDatabaseExpr struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + //TODO(hl): maybe rename to schema_name? + DatabaseName string `protobuf:"bytes,1,opt,name=database_name,json=databaseName,proto3" json:"database_name,omitempty"` + CreateIfNotExists bool `protobuf:"varint,2,opt,name=create_if_not_exists,json=createIfNotExists,proto3" json:"create_if_not_exists,omitempty"` +} + +func (x *CreateDatabaseExpr) Reset() { + *x = CreateDatabaseExpr{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_ddl_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateDatabaseExpr) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateDatabaseExpr) ProtoMessage() {} + +func (x *CreateDatabaseExpr) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_ddl_proto_msgTypes[4] + 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 CreateDatabaseExpr.ProtoReflect.Descriptor instead. +func (*CreateDatabaseExpr) Descriptor() ([]byte, []int) { + return file_greptime_v1_ddl_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateDatabaseExpr) GetDatabaseName() string { + if x != nil { + return x.DatabaseName + } + return "" +} + +func (x *CreateDatabaseExpr) GetCreateIfNotExists() bool { + if x != nil { + return x.CreateIfNotExists + } + return false +} + +type AddColumns struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AddColumns []*AddColumn `protobuf:"bytes,1,rep,name=add_columns,json=addColumns,proto3" json:"add_columns,omitempty"` +} + +func (x *AddColumns) Reset() { + *x = AddColumns{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_ddl_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddColumns) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddColumns) ProtoMessage() {} + +func (x *AddColumns) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_ddl_proto_msgTypes[5] + 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 AddColumns.ProtoReflect.Descriptor instead. +func (*AddColumns) Descriptor() ([]byte, []int) { + return file_greptime_v1_ddl_proto_rawDescGZIP(), []int{5} +} + +func (x *AddColumns) GetAddColumns() []*AddColumn { + if x != nil { + return x.AddColumns + } + return nil +} + +type DropColumns struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DropColumns []*DropColumn `protobuf:"bytes,1,rep,name=drop_columns,json=dropColumns,proto3" json:"drop_columns,omitempty"` +} + +func (x *DropColumns) Reset() { + *x = DropColumns{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_ddl_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DropColumns) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DropColumns) ProtoMessage() {} + +func (x *DropColumns) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_ddl_proto_msgTypes[6] + 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 DropColumns.ProtoReflect.Descriptor instead. +func (*DropColumns) Descriptor() ([]byte, []int) { + return file_greptime_v1_ddl_proto_rawDescGZIP(), []int{6} +} + +func (x *DropColumns) GetDropColumns() []*DropColumn { + if x != nil { + return x.DropColumns + } + return nil +} + +type RenameTable struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NewTableName string `protobuf:"bytes,1,opt,name=new_table_name,json=newTableName,proto3" json:"new_table_name,omitempty"` +} + +func (x *RenameTable) Reset() { + *x = RenameTable{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_ddl_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RenameTable) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RenameTable) ProtoMessage() {} + +func (x *RenameTable) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_ddl_proto_msgTypes[7] + 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 RenameTable.ProtoReflect.Descriptor instead. +func (*RenameTable) Descriptor() ([]byte, []int) { + return file_greptime_v1_ddl_proto_rawDescGZIP(), []int{7} +} + +func (x *RenameTable) GetNewTableName() string { + if x != nil { + return x.NewTableName + } + return "" +} + +type AddColumn struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ColumnDef *ColumnDef `protobuf:"bytes,1,opt,name=column_def,json=columnDef,proto3" json:"column_def,omitempty"` + IsKey bool `protobuf:"varint,2,opt,name=is_key,json=isKey,proto3" json:"is_key,omitempty"` +} + +func (x *AddColumn) Reset() { + *x = AddColumn{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_ddl_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddColumn) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddColumn) ProtoMessage() {} + +func (x *AddColumn) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_ddl_proto_msgTypes[8] + 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 AddColumn.ProtoReflect.Descriptor instead. +func (*AddColumn) Descriptor() ([]byte, []int) { + return file_greptime_v1_ddl_proto_rawDescGZIP(), []int{8} +} + +func (x *AddColumn) GetColumnDef() *ColumnDef { + if x != nil { + return x.ColumnDef + } + return nil +} + +func (x *AddColumn) GetIsKey() bool { + if x != nil { + return x.IsKey + } + return false +} + +type DropColumn struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *DropColumn) Reset() { + *x = DropColumn{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_ddl_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DropColumn) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DropColumn) ProtoMessage() {} + +func (x *DropColumn) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_ddl_proto_msgTypes[9] + 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 DropColumn.ProtoReflect.Descriptor instead. +func (*DropColumn) Descriptor() ([]byte, []int) { + return file_greptime_v1_ddl_proto_rawDescGZIP(), []int{9} +} + +func (x *DropColumn) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type TableId struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *TableId) Reset() { + *x = TableId{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_ddl_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TableId) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TableId) ProtoMessage() {} + +func (x *TableId) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_ddl_proto_msgTypes[10] + 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 TableId.ProtoReflect.Descriptor instead. +func (*TableId) Descriptor() ([]byte, []int) { + return file_greptime_v1_ddl_proto_rawDescGZIP(), []int{10} +} + +func (x *TableId) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +var File_greptime_v1_ddl_proto protoreflect.FileDescriptor + +var file_greptime_v1_ddl_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x64, + 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, + 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x18, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x90, + 0x02, 0x0a, 0x0a, 0x44, 0x64, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4a, 0x0a, + 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x45, 0x78, 0x70, 0x72, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x78, 0x70, 0x72, 0x48, 0x00, 0x52, + 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x2e, 0x0a, 0x05, + 0x61, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, + 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x45, + 0x78, 0x70, 0x72, 0x48, 0x00, 0x52, 0x05, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x0a, + 0x64, 0x72, 0x6f, 0x70, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x72, 0x6f, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x78, 0x70, 0x72, 0x48, 0x00, 0x52, 0x09, + 0x64, 0x72, 0x6f, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x65, 0x78, 0x70, + 0x72, 0x22, 0x9a, 0x04, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x45, 0x78, 0x70, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x61, 0x74, + 0x61, 0x6c, 0x6f, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x37, 0x0a, 0x0b, + 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x44, 0x65, 0x66, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x44, 0x65, 0x66, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, + 0x6b, 0x65, 0x79, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x6d, + 0x61, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x2f, 0x0a, 0x14, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x5f, 0x69, 0x66, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x66, 0x4e, + 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x0d, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2e, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x78, 0x70, 0x72, 0x2e, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2f, 0x0a, + 0x08, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x49, 0x64, 0x52, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x03, + 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x1a, 0x3f, 0x0a, + 0x11, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb0, + 0x02, 0x0a, 0x09, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x78, 0x70, 0x72, 0x12, 0x21, 0x0a, 0x0c, + 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x3a, 0x0a, 0x0b, 0x61, 0x64, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x48, 0x00, 0x52, + 0x0a, 0x61, 0x64, 0x64, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x3d, 0x0a, 0x0c, 0x64, + 0x72, 0x6f, 0x70, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x64, + 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x3d, 0x0a, 0x0c, 0x72, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, + 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x72, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 0x22, 0x72, 0x0a, 0x0d, 0x44, 0x72, 0x6f, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x78, + 0x70, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, + 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x6a, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, + 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x45, 0x78, 0x70, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x64, + 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x2f, 0x0a, 0x14, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x66, 0x5f, 0x6e, 0x6f, + 0x74, 0x5f, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x66, 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, + 0x73, 0x22, 0x45, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, + 0x37, 0x0a, 0x0b, 0x61, 0x64, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x0a, 0x61, 0x64, + 0x64, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x22, 0x49, 0x0a, 0x0b, 0x44, 0x72, 0x6f, 0x70, + 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x0c, 0x64, 0x72, 0x6f, 0x70, 0x5f, + 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x72, 0x6f, 0x70, + 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x0b, 0x64, 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x73, 0x22, 0x33, 0x0a, 0x0b, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6e, 0x65, 0x77, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x65, 0x77, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x59, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x43, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x35, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, + 0x64, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x65, 0x70, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x44, 0x65, + 0x66, 0x52, 0x09, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x44, 0x65, 0x66, 0x12, 0x15, 0x0a, 0x06, + 0x69, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, + 0x4b, 0x65, 0x79, 0x22, 0x20, 0x0a, 0x0a, 0x44, 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x19, 0x0a, 0x07, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, + 0x42, 0x4c, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, + 0x76, 0x31, 0x42, 0x03, 0x44, 0x64, 0x6c, 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 ( + file_greptime_v1_ddl_proto_rawDescOnce sync.Once + file_greptime_v1_ddl_proto_rawDescData = file_greptime_v1_ddl_proto_rawDesc +) + +func file_greptime_v1_ddl_proto_rawDescGZIP() []byte { + file_greptime_v1_ddl_proto_rawDescOnce.Do(func() { + file_greptime_v1_ddl_proto_rawDescData = protoimpl.X.CompressGZIP(file_greptime_v1_ddl_proto_rawDescData) + }) + return file_greptime_v1_ddl_proto_rawDescData +} + +var file_greptime_v1_ddl_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_greptime_v1_ddl_proto_goTypes = []interface{}{ + (*DdlRequest)(nil), // 0: greptime.v1.DdlRequest + (*CreateTableExpr)(nil), // 1: greptime.v1.CreateTableExpr + (*AlterExpr)(nil), // 2: greptime.v1.AlterExpr + (*DropTableExpr)(nil), // 3: greptime.v1.DropTableExpr + (*CreateDatabaseExpr)(nil), // 4: greptime.v1.CreateDatabaseExpr + (*AddColumns)(nil), // 5: greptime.v1.AddColumns + (*DropColumns)(nil), // 6: greptime.v1.DropColumns + (*RenameTable)(nil), // 7: greptime.v1.RenameTable + (*AddColumn)(nil), // 8: greptime.v1.AddColumn + (*DropColumn)(nil), // 9: greptime.v1.DropColumn + (*TableId)(nil), // 10: greptime.v1.TableId + nil, // 11: greptime.v1.CreateTableExpr.TableOptionsEntry + (*ColumnDef)(nil), // 12: greptime.v1.ColumnDef +} +var file_greptime_v1_ddl_proto_depIdxs = []int32{ + 4, // 0: greptime.v1.DdlRequest.create_database:type_name -> greptime.v1.CreateDatabaseExpr + 1, // 1: greptime.v1.DdlRequest.create_table:type_name -> greptime.v1.CreateTableExpr + 2, // 2: greptime.v1.DdlRequest.alter:type_name -> greptime.v1.AlterExpr + 3, // 3: greptime.v1.DdlRequest.drop_table:type_name -> greptime.v1.DropTableExpr + 12, // 4: greptime.v1.CreateTableExpr.column_defs:type_name -> greptime.v1.ColumnDef + 11, // 5: greptime.v1.CreateTableExpr.table_options:type_name -> greptime.v1.CreateTableExpr.TableOptionsEntry + 10, // 6: greptime.v1.CreateTableExpr.table_id:type_name -> greptime.v1.TableId + 5, // 7: greptime.v1.AlterExpr.add_columns:type_name -> greptime.v1.AddColumns + 6, // 8: greptime.v1.AlterExpr.drop_columns:type_name -> greptime.v1.DropColumns + 7, // 9: greptime.v1.AlterExpr.rename_table:type_name -> greptime.v1.RenameTable + 8, // 10: greptime.v1.AddColumns.add_columns:type_name -> greptime.v1.AddColumn + 9, // 11: greptime.v1.DropColumns.drop_columns:type_name -> greptime.v1.DropColumn + 12, // 12: greptime.v1.AddColumn.column_def:type_name -> greptime.v1.ColumnDef + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name +} + +func init() { file_greptime_v1_ddl_proto_init() } +func file_greptime_v1_ddl_proto_init() { + if File_greptime_v1_ddl_proto != nil { + return + } + file_greptime_v1_column_proto_init() + if !protoimpl.UnsafeEnabled { + file_greptime_v1_ddl_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DdlRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_ddl_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateTableExpr); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_ddl_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AlterExpr); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_ddl_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DropTableExpr); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_ddl_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateDatabaseExpr); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_ddl_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddColumns); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_ddl_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DropColumns); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_ddl_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RenameTable); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_ddl_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddColumn); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_ddl_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DropColumn); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_ddl_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TableId); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_greptime_v1_ddl_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*DdlRequest_CreateDatabase)(nil), + (*DdlRequest_CreateTable)(nil), + (*DdlRequest_Alter)(nil), + (*DdlRequest_DropTable)(nil), + } + file_greptime_v1_ddl_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*AlterExpr_AddColumns)(nil), + (*AlterExpr_DropColumns)(nil), + (*AlterExpr_RenameTable)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_greptime_v1_ddl_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_greptime_v1_ddl_proto_goTypes, + DependencyIndexes: file_greptime_v1_ddl_proto_depIdxs, + MessageInfos: file_greptime_v1_ddl_proto_msgTypes, + }.Build() + File_greptime_v1_ddl_proto = out.File + file_greptime_v1_ddl_proto_rawDesc = nil + file_greptime_v1_ddl_proto_goTypes = nil + file_greptime_v1_ddl_proto_depIdxs = nil +} diff --git a/go/greptime/v1/meta/cluster.pb.go b/go/greptime/v1/meta/cluster.pb.go new file mode 100644 index 00000000..46b5d174 --- /dev/null +++ b/go/greptime/v1/meta/cluster.pb.go @@ -0,0 +1,262 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.7 +// source: greptime/v1/meta/cluster.proto + +package meta + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type BatchGetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Keys [][]byte `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` +} + +func (x *BatchGetRequest) Reset() { + *x = BatchGetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_cluster_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchGetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchGetRequest) ProtoMessage() {} + +func (x *BatchGetRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_cluster_proto_msgTypes[0] + 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 BatchGetRequest.ProtoReflect.Descriptor instead. +func (*BatchGetRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_cluster_proto_rawDescGZIP(), []int{0} +} + +func (x *BatchGetRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *BatchGetRequest) GetKeys() [][]byte { + if x != nil { + return x.Keys + } + return nil +} + +type BatchGetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Kvs []*KeyValue `protobuf:"bytes,2,rep,name=kvs,proto3" json:"kvs,omitempty"` +} + +func (x *BatchGetResponse) Reset() { + *x = BatchGetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_cluster_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchGetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchGetResponse) ProtoMessage() {} + +func (x *BatchGetResponse) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_cluster_proto_msgTypes[1] + 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 BatchGetResponse.ProtoReflect.Descriptor instead. +func (*BatchGetResponse) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_cluster_proto_rawDescGZIP(), []int{1} +} + +func (x *BatchGetResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *BatchGetResponse) GetKvs() []*KeyValue { + if x != nil { + return x.Kvs + } + return nil +} + +var File_greptime_v1_meta_cluster_proto protoreflect.FileDescriptor + +var file_greptime_v1_meta_cluster_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, + 0x74, 0x61, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x10, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, + 0x74, 0x61, 0x1a, 0x1d, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x65, 0x74, 0x61, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1c, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, + 0x65, 0x74, 0x61, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x5e, 0x0a, 0x0f, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6b, + 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, + 0x7a, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2c, 0x0a, + 0x03, 0x6b, 0x76, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, + 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4b, 0x65, + 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x6b, 0x76, 0x73, 0x32, 0xa6, 0x01, 0x0a, 0x07, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x08, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x47, 0x65, 0x74, 0x12, 0x21, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, + 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x05, 0x52, 0x61, + 0x6e, 0x67, 0x65, 0x12, 0x1e, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3c, 0x5a, 0x3a, 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, 0x2f, 0x6d, 0x65, + 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_greptime_v1_meta_cluster_proto_rawDescOnce sync.Once + file_greptime_v1_meta_cluster_proto_rawDescData = file_greptime_v1_meta_cluster_proto_rawDesc +) + +func file_greptime_v1_meta_cluster_proto_rawDescGZIP() []byte { + file_greptime_v1_meta_cluster_proto_rawDescOnce.Do(func() { + file_greptime_v1_meta_cluster_proto_rawDescData = protoimpl.X.CompressGZIP(file_greptime_v1_meta_cluster_proto_rawDescData) + }) + return file_greptime_v1_meta_cluster_proto_rawDescData +} + +var file_greptime_v1_meta_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_greptime_v1_meta_cluster_proto_goTypes = []interface{}{ + (*BatchGetRequest)(nil), // 0: greptime.v1.meta.BatchGetRequest + (*BatchGetResponse)(nil), // 1: greptime.v1.meta.BatchGetResponse + (*RequestHeader)(nil), // 2: greptime.v1.meta.RequestHeader + (*ResponseHeader)(nil), // 3: greptime.v1.meta.ResponseHeader + (*KeyValue)(nil), // 4: greptime.v1.meta.KeyValue + (*RangeRequest)(nil), // 5: greptime.v1.meta.RangeRequest + (*RangeResponse)(nil), // 6: greptime.v1.meta.RangeResponse +} +var file_greptime_v1_meta_cluster_proto_depIdxs = []int32{ + 2, // 0: greptime.v1.meta.BatchGetRequest.header:type_name -> greptime.v1.meta.RequestHeader + 3, // 1: greptime.v1.meta.BatchGetResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 4, // 2: greptime.v1.meta.BatchGetResponse.kvs:type_name -> greptime.v1.meta.KeyValue + 0, // 3: greptime.v1.meta.Cluster.BatchGet:input_type -> greptime.v1.meta.BatchGetRequest + 5, // 4: greptime.v1.meta.Cluster.Range:input_type -> greptime.v1.meta.RangeRequest + 1, // 5: greptime.v1.meta.Cluster.BatchGet:output_type -> greptime.v1.meta.BatchGetResponse + 6, // 6: greptime.v1.meta.Cluster.Range:output_type -> greptime.v1.meta.RangeResponse + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_greptime_v1_meta_cluster_proto_init() } +func file_greptime_v1_meta_cluster_proto_init() { + if File_greptime_v1_meta_cluster_proto != nil { + return + } + file_greptime_v1_meta_common_proto_init() + file_greptime_v1_meta_store_proto_init() + if !protoimpl.UnsafeEnabled { + file_greptime_v1_meta_cluster_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchGetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_cluster_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchGetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_greptime_v1_meta_cluster_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_greptime_v1_meta_cluster_proto_goTypes, + DependencyIndexes: file_greptime_v1_meta_cluster_proto_depIdxs, + MessageInfos: file_greptime_v1_meta_cluster_proto_msgTypes, + }.Build() + File_greptime_v1_meta_cluster_proto = out.File + file_greptime_v1_meta_cluster_proto_rawDesc = nil + file_greptime_v1_meta_cluster_proto_goTypes = nil + file_greptime_v1_meta_cluster_proto_depIdxs = nil +} diff --git a/go/greptime/v1/meta/cluster_grpc.pb.go b/go/greptime/v1/meta/cluster_grpc.pb.go new file mode 100644 index 00000000..a78c2aee --- /dev/null +++ b/go/greptime/v1/meta/cluster_grpc.pb.go @@ -0,0 +1,145 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.7 +// source: greptime/v1/meta/cluster.proto + +package meta + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ClusterClient is the client API for Cluster service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ClusterClient interface { + // Batch get kvs by input keys from leader's in_memory kv store. + BatchGet(ctx context.Context, in *BatchGetRequest, opts ...grpc.CallOption) (*BatchGetResponse, error) + // Range get the kvs from leader's in_memory kv store. + Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) +} + +type clusterClient struct { + cc grpc.ClientConnInterface +} + +func NewClusterClient(cc grpc.ClientConnInterface) ClusterClient { + return &clusterClient{cc} +} + +func (c *clusterClient) BatchGet(ctx context.Context, in *BatchGetRequest, opts ...grpc.CallOption) (*BatchGetResponse, error) { + out := new(BatchGetResponse) + err := c.cc.Invoke(ctx, "/greptime.v1.meta.Cluster/BatchGet", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *clusterClient) Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) { + out := new(RangeResponse) + err := c.cc.Invoke(ctx, "/greptime.v1.meta.Cluster/Range", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ClusterServer is the server API for Cluster service. +// All implementations must embed UnimplementedClusterServer +// for forward compatibility +type ClusterServer interface { + // Batch get kvs by input keys from leader's in_memory kv store. + BatchGet(context.Context, *BatchGetRequest) (*BatchGetResponse, error) + // Range get the kvs from leader's in_memory kv store. + Range(context.Context, *RangeRequest) (*RangeResponse, error) + mustEmbedUnimplementedClusterServer() +} + +// UnimplementedClusterServer must be embedded to have forward compatible implementations. +type UnimplementedClusterServer struct { +} + +func (UnimplementedClusterServer) BatchGet(context.Context, *BatchGetRequest) (*BatchGetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BatchGet not implemented") +} +func (UnimplementedClusterServer) Range(context.Context, *RangeRequest) (*RangeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Range not implemented") +} +func (UnimplementedClusterServer) mustEmbedUnimplementedClusterServer() {} + +// UnsafeClusterServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ClusterServer will +// result in compilation errors. +type UnsafeClusterServer interface { + mustEmbedUnimplementedClusterServer() +} + +func RegisterClusterServer(s grpc.ServiceRegistrar, srv ClusterServer) { + s.RegisterService(&Cluster_ServiceDesc, srv) +} + +func _Cluster_BatchGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchGetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterServer).BatchGet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greptime.v1.meta.Cluster/BatchGet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterServer).BatchGet(ctx, req.(*BatchGetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Cluster_Range_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RangeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ClusterServer).Range(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greptime.v1.meta.Cluster/Range", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ClusterServer).Range(ctx, req.(*RangeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Cluster_ServiceDesc is the grpc.ServiceDesc for Cluster service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Cluster_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "greptime.v1.meta.Cluster", + HandlerType: (*ClusterServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "BatchGet", + Handler: _Cluster_BatchGet_Handler, + }, + { + MethodName: "Range", + Handler: _Cluster_Range_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "greptime/v1/meta/cluster.proto", +} diff --git a/go/greptime/v1/meta/common.pb.go b/go/greptime/v1/meta/common.pb.go new file mode 100644 index 00000000..82c63681 --- /dev/null +++ b/go/greptime/v1/meta/common.pb.go @@ -0,0 +1,632 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.7 +// source: greptime/v1/meta/common.proto + +package meta + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RequestHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProtocolVersion uint64 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` + // cluster_id is the ID of the cluster which be sent to. + ClusterId uint64 `protobuf:"varint,2,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` + // member_id is the ID of the sender server. + MemberId uint64 `protobuf:"varint,3,opt,name=member_id,json=memberId,proto3" json:"member_id,omitempty"` +} + +func (x *RequestHeader) Reset() { + *x = RequestHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RequestHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestHeader) ProtoMessage() {} + +func (x *RequestHeader) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_common_proto_msgTypes[0] + 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 RequestHeader.ProtoReflect.Descriptor instead. +func (*RequestHeader) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_common_proto_rawDescGZIP(), []int{0} +} + +func (x *RequestHeader) GetProtocolVersion() uint64 { + if x != nil { + return x.ProtocolVersion + } + return 0 +} + +func (x *RequestHeader) GetClusterId() uint64 { + if x != nil { + return x.ClusterId + } + return 0 +} + +func (x *RequestHeader) GetMemberId() uint64 { + if x != nil { + return x.MemberId + } + return 0 +} + +type ResponseHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProtocolVersion uint64 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` + // cluster_id is the ID of the cluster which sent the response. + ClusterId uint64 `protobuf:"varint,2,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` + Error *Error `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` +} + +func (x *ResponseHeader) Reset() { + *x = ResponseHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_common_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResponseHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResponseHeader) ProtoMessage() {} + +func (x *ResponseHeader) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_common_proto_msgTypes[1] + 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 ResponseHeader.ProtoReflect.Descriptor instead. +func (*ResponseHeader) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_common_proto_rawDescGZIP(), []int{1} +} + +func (x *ResponseHeader) GetProtocolVersion() uint64 { + if x != nil { + return x.ProtocolVersion + } + return 0 +} + +func (x *ResponseHeader) GetClusterId() uint64 { + if x != nil { + return x.ClusterId + } + return 0 +} + +func (x *ResponseHeader) GetError() *Error { + if x != nil { + return x.Error + } + return nil +} + +type Error struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg,proto3" json:"err_msg,omitempty"` +} + +func (x *Error) Reset() { + *x = Error{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_common_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Error) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Error) ProtoMessage() {} + +func (x *Error) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_common_proto_msgTypes[2] + 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 Error.ProtoReflect.Descriptor instead. +func (*Error) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_common_proto_rawDescGZIP(), []int{2} +} + +func (x *Error) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *Error) GetErrMsg() string { + if x != nil { + return x.ErrMsg + } + return "" +} + +type Peer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` +} + +func (x *Peer) Reset() { + *x = Peer{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_common_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Peer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Peer) ProtoMessage() {} + +func (x *Peer) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_common_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 Peer.ProtoReflect.Descriptor instead. +func (*Peer) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_common_proto_rawDescGZIP(), []int{3} +} + +func (x *Peer) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Peer) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +type TableName struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CatalogName string `protobuf:"bytes,1,opt,name=catalog_name,json=catalogName,proto3" json:"catalog_name,omitempty"` + SchemaName string `protobuf:"bytes,2,opt,name=schema_name,json=schemaName,proto3" json:"schema_name,omitempty"` + TableName string `protobuf:"bytes,3,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` +} + +func (x *TableName) Reset() { + *x = TableName{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_common_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TableName) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TableName) ProtoMessage() {} + +func (x *TableName) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_common_proto_msgTypes[4] + 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 TableName.ProtoReflect.Descriptor instead. +func (*TableName) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_common_proto_rawDescGZIP(), []int{4} +} + +func (x *TableName) GetCatalogName() string { + if x != nil { + return x.CatalogName + } + return "" +} + +func (x *TableName) GetSchemaName() string { + if x != nil { + return x.SchemaName + } + return "" +} + +func (x *TableName) GetTableName() string { + if x != nil { + return x.TableName + } + return "" +} + +type TimeInterval struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The unix timestamp in millis of the start of this period. + StartTimestampMillis uint64 `protobuf:"varint,1,opt,name=start_timestamp_millis,json=startTimestampMillis,proto3" json:"start_timestamp_millis,omitempty"` + // The unix timestamp in millis of the end of this period. + EndTimestampMillis uint64 `protobuf:"varint,2,opt,name=end_timestamp_millis,json=endTimestampMillis,proto3" json:"end_timestamp_millis,omitempty"` +} + +func (x *TimeInterval) Reset() { + *x = TimeInterval{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_common_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TimeInterval) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TimeInterval) ProtoMessage() {} + +func (x *TimeInterval) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_common_proto_msgTypes[5] + 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 TimeInterval.ProtoReflect.Descriptor instead. +func (*TimeInterval) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_common_proto_rawDescGZIP(), []int{5} +} + +func (x *TimeInterval) GetStartTimestampMillis() uint64 { + if x != nil { + return x.StartTimestampMillis + } + return 0 +} + +func (x *TimeInterval) GetEndTimestampMillis() uint64 { + if x != nil { + return x.EndTimestampMillis + } + return 0 +} + +type KeyValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // key is the key in bytes. An empty key is not allowed. + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // value is the value held by the key, in bytes. + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *KeyValue) Reset() { + *x = KeyValue{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_common_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyValue) ProtoMessage() {} + +func (x *KeyValue) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_common_proto_msgTypes[6] + 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 KeyValue.ProtoReflect.Descriptor instead. +func (*KeyValue) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_common_proto_rawDescGZIP(), []int{6} +} + +func (x *KeyValue) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *KeyValue) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +var File_greptime_v1_meta_common_proto protoreflect.FileDescriptor + +var file_greptime_v1_meta_common_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, + 0x74, 0x61, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x10, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, + 0x61, 0x22, 0x76, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, + 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, + 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x64, 0x22, 0x89, 0x01, 0x0a, 0x0e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x34, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, + 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x2a, 0x0a, 0x04, 0x50, + 0x65, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x22, 0x6e, 0x0a, 0x09, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x61, 0x74, 0x61, + 0x6c, 0x6f, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x76, 0x0a, 0x0c, 0x54, 0x69, 0x6d, 0x65, 0x49, + 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x34, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x30, 0x0a, + 0x14, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d, + 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x65, 0x6e, 0x64, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, + 0x32, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x42, 0x3c, 0x5a, 0x3a, 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, 0x2f, 0x6d, 0x65, 0x74, + 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_greptime_v1_meta_common_proto_rawDescOnce sync.Once + file_greptime_v1_meta_common_proto_rawDescData = file_greptime_v1_meta_common_proto_rawDesc +) + +func file_greptime_v1_meta_common_proto_rawDescGZIP() []byte { + file_greptime_v1_meta_common_proto_rawDescOnce.Do(func() { + file_greptime_v1_meta_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_greptime_v1_meta_common_proto_rawDescData) + }) + return file_greptime_v1_meta_common_proto_rawDescData +} + +var file_greptime_v1_meta_common_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_greptime_v1_meta_common_proto_goTypes = []interface{}{ + (*RequestHeader)(nil), // 0: greptime.v1.meta.RequestHeader + (*ResponseHeader)(nil), // 1: greptime.v1.meta.ResponseHeader + (*Error)(nil), // 2: greptime.v1.meta.Error + (*Peer)(nil), // 3: greptime.v1.meta.Peer + (*TableName)(nil), // 4: greptime.v1.meta.TableName + (*TimeInterval)(nil), // 5: greptime.v1.meta.TimeInterval + (*KeyValue)(nil), // 6: greptime.v1.meta.KeyValue +} +var file_greptime_v1_meta_common_proto_depIdxs = []int32{ + 2, // 0: greptime.v1.meta.ResponseHeader.error:type_name -> greptime.v1.meta.Error + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_greptime_v1_meta_common_proto_init() } +func file_greptime_v1_meta_common_proto_init() { + if File_greptime_v1_meta_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_greptime_v1_meta_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RequestHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResponseHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Error); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Peer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TableName); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TimeInterval); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_common_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeyValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_greptime_v1_meta_common_proto_rawDesc, + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_greptime_v1_meta_common_proto_goTypes, + DependencyIndexes: file_greptime_v1_meta_common_proto_depIdxs, + MessageInfos: file_greptime_v1_meta_common_proto_msgTypes, + }.Build() + File_greptime_v1_meta_common_proto = out.File + file_greptime_v1_meta_common_proto_rawDesc = nil + file_greptime_v1_meta_common_proto_goTypes = nil + file_greptime_v1_meta_common_proto_depIdxs = nil +} diff --git a/go/greptime/v1/meta/heartbeat.pb.go b/go/greptime/v1/meta/heartbeat.pb.go new file mode 100644 index 00000000..ba3fca3b --- /dev/null +++ b/go/greptime/v1/meta/heartbeat.pb.go @@ -0,0 +1,851 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.7 +// source: greptime/v1/meta/heartbeat.proto + +package meta + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type HeartbeatRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // Self peer + Peer *Peer `protobuf:"bytes,2,opt,name=peer,proto3" json:"peer,omitempty"` + // Leader node + IsLeader bool `protobuf:"varint,3,opt,name=is_leader,json=isLeader,proto3" json:"is_leader,omitempty"` + // Actually reported time interval + ReportInterval *TimeInterval `protobuf:"bytes,4,opt,name=report_interval,json=reportInterval,proto3" json:"report_interval,omitempty"` + // Node stat + NodeStat *NodeStat `protobuf:"bytes,5,opt,name=node_stat,json=nodeStat,proto3" json:"node_stat,omitempty"` + // Region stats on this node + RegionStats []*RegionStat `protobuf:"bytes,6,rep,name=region_stats,json=regionStats,proto3" json:"region_stats,omitempty"` + // Follower nodes and stats, empty on follower nodes + ReplicaStats []*ReplicaStat `protobuf:"bytes,7,rep,name=replica_stats,json=replicaStats,proto3" json:"replica_stats,omitempty"` +} + +func (x *HeartbeatRequest) Reset() { + *x = HeartbeatRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeartbeatRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeartbeatRequest) ProtoMessage() {} + +func (x *HeartbeatRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[0] + 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 HeartbeatRequest.ProtoReflect.Descriptor instead. +func (*HeartbeatRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{0} +} + +func (x *HeartbeatRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *HeartbeatRequest) GetPeer() *Peer { + if x != nil { + return x.Peer + } + return nil +} + +func (x *HeartbeatRequest) GetIsLeader() bool { + if x != nil { + return x.IsLeader + } + return false +} + +func (x *HeartbeatRequest) GetReportInterval() *TimeInterval { + if x != nil { + return x.ReportInterval + } + return nil +} + +func (x *HeartbeatRequest) GetNodeStat() *NodeStat { + if x != nil { + return x.NodeStat + } + return nil +} + +func (x *HeartbeatRequest) GetRegionStats() []*RegionStat { + if x != nil { + return x.RegionStats + } + return nil +} + +func (x *HeartbeatRequest) GetReplicaStats() []*ReplicaStat { + if x != nil { + return x.ReplicaStats + } + return nil +} + +type NodeStat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The read capacity units during this period + Rcus int64 `protobuf:"varint,1,opt,name=rcus,proto3" json:"rcus,omitempty"` + // The write capacity units during this period + Wcus int64 `protobuf:"varint,2,opt,name=wcus,proto3" json:"wcus,omitempty"` + // How many tables on this node + TableNum int64 `protobuf:"varint,3,opt,name=table_num,json=tableNum,proto3" json:"table_num,omitempty"` + // How many regions on this node + RegionNum int64 `protobuf:"varint,4,opt,name=region_num,json=regionNum,proto3" json:"region_num,omitempty"` + CpuUsage float64 `protobuf:"fixed64,5,opt,name=cpu_usage,json=cpuUsage,proto3" json:"cpu_usage,omitempty"` + Load float64 `protobuf:"fixed64,6,opt,name=load,proto3" json:"load,omitempty"` + // Read disk IO on this node + ReadIoRate float64 `protobuf:"fixed64,7,opt,name=read_io_rate,json=readIoRate,proto3" json:"read_io_rate,omitempty"` + // Write disk IO on this node + WriteIoRate float64 `protobuf:"fixed64,8,opt,name=write_io_rate,json=writeIoRate,proto3" json:"write_io_rate,omitempty"` + // Others + Attrs map[string]string `protobuf:"bytes,100,rep,name=attrs,proto3" json:"attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *NodeStat) Reset() { + *x = NodeStat{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeStat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeStat) ProtoMessage() {} + +func (x *NodeStat) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[1] + 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 NodeStat.ProtoReflect.Descriptor instead. +func (*NodeStat) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{1} +} + +func (x *NodeStat) GetRcus() int64 { + if x != nil { + return x.Rcus + } + return 0 +} + +func (x *NodeStat) GetWcus() int64 { + if x != nil { + return x.Wcus + } + return 0 +} + +func (x *NodeStat) GetTableNum() int64 { + if x != nil { + return x.TableNum + } + return 0 +} + +func (x *NodeStat) GetRegionNum() int64 { + if x != nil { + return x.RegionNum + } + return 0 +} + +func (x *NodeStat) GetCpuUsage() float64 { + if x != nil { + return x.CpuUsage + } + return 0 +} + +func (x *NodeStat) GetLoad() float64 { + if x != nil { + return x.Load + } + return 0 +} + +func (x *NodeStat) GetReadIoRate() float64 { + if x != nil { + return x.ReadIoRate + } + return 0 +} + +func (x *NodeStat) GetWriteIoRate() float64 { + if x != nil { + return x.WriteIoRate + } + return 0 +} + +func (x *NodeStat) GetAttrs() map[string]string { + if x != nil { + return x.Attrs + } + return nil +} + +type RegionStat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RegionId uint64 `protobuf:"varint,1,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` + TableName *TableName `protobuf:"bytes,2,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` + // The read capacity units during this period + Rcus int64 `protobuf:"varint,3,opt,name=rcus,proto3" json:"rcus,omitempty"` + // The write capacity units during this period + Wcus int64 `protobuf:"varint,4,opt,name=wcus,proto3" json:"wcus,omitempty"` + // Approximate bytes of this region + ApproximateBytes int64 `protobuf:"varint,5,opt,name=approximate_bytes,json=approximateBytes,proto3" json:"approximate_bytes,omitempty"` + // Approximate number of rows in this region + ApproximateRows int64 `protobuf:"varint,6,opt,name=approximate_rows,json=approximateRows,proto3" json:"approximate_rows,omitempty"` + // Others + Attrs map[string]string `protobuf:"bytes,100,rep,name=attrs,proto3" json:"attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *RegionStat) Reset() { + *x = RegionStat{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegionStat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegionStat) ProtoMessage() {} + +func (x *RegionStat) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[2] + 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 RegionStat.ProtoReflect.Descriptor instead. +func (*RegionStat) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{2} +} + +func (x *RegionStat) GetRegionId() uint64 { + if x != nil { + return x.RegionId + } + return 0 +} + +func (x *RegionStat) GetTableName() *TableName { + if x != nil { + return x.TableName + } + return nil +} + +func (x *RegionStat) GetRcus() int64 { + if x != nil { + return x.Rcus + } + return 0 +} + +func (x *RegionStat) GetWcus() int64 { + if x != nil { + return x.Wcus + } + return 0 +} + +func (x *RegionStat) GetApproximateBytes() int64 { + if x != nil { + return x.ApproximateBytes + } + return 0 +} + +func (x *RegionStat) GetApproximateRows() int64 { + if x != nil { + return x.ApproximateRows + } + return 0 +} + +func (x *RegionStat) GetAttrs() map[string]string { + if x != nil { + return x.Attrs + } + return nil +} + +type ReplicaStat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Peer *Peer `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"` + InSync bool `protobuf:"varint,2,opt,name=in_sync,json=inSync,proto3" json:"in_sync,omitempty"` + IsLearner bool `protobuf:"varint,3,opt,name=is_learner,json=isLearner,proto3" json:"is_learner,omitempty"` +} + +func (x *ReplicaStat) Reset() { + *x = ReplicaStat{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReplicaStat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReplicaStat) ProtoMessage() {} + +func (x *ReplicaStat) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_heartbeat_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 ReplicaStat.ProtoReflect.Descriptor instead. +func (*ReplicaStat) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{3} +} + +func (x *ReplicaStat) GetPeer() *Peer { + if x != nil { + return x.Peer + } + return nil +} + +func (x *ReplicaStat) GetInSync() bool { + if x != nil { + return x.InSync + } + return false +} + +func (x *ReplicaStat) GetIsLearner() bool { + if x != nil { + return x.IsLearner + } + return false +} + +type HeartbeatResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Payload [][]byte `protobuf:"bytes,2,rep,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *HeartbeatResponse) Reset() { + *x = HeartbeatResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeartbeatResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeartbeatResponse) ProtoMessage() {} + +func (x *HeartbeatResponse) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[4] + 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 HeartbeatResponse.ProtoReflect.Descriptor instead. +func (*HeartbeatResponse) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{4} +} + +func (x *HeartbeatResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *HeartbeatResponse) GetPayload() [][]byte { + if x != nil { + return x.Payload + } + return nil +} + +type AskLeaderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` +} + +func (x *AskLeaderRequest) Reset() { + *x = AskLeaderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AskLeaderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AskLeaderRequest) ProtoMessage() {} + +func (x *AskLeaderRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[5] + 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 AskLeaderRequest.ProtoReflect.Descriptor instead. +func (*AskLeaderRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{5} +} + +func (x *AskLeaderRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +type AskLeaderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Leader *Peer `protobuf:"bytes,2,opt,name=leader,proto3" json:"leader,omitempty"` +} + +func (x *AskLeaderResponse) Reset() { + *x = AskLeaderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AskLeaderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AskLeaderResponse) ProtoMessage() {} + +func (x *AskLeaderResponse) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[6] + 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 AskLeaderResponse.ProtoReflect.Descriptor instead. +func (*AskLeaderResponse) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{6} +} + +func (x *AskLeaderResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *AskLeaderResponse) GetLeader() *Peer { + if x != nil { + return x.Leader + } + return nil +} + +var File_greptime_v1_meta_heartbeat_proto protoreflect.FileDescriptor + +var file_greptime_v1_meta_heartbeat_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, + 0x74, 0x61, 0x2f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x10, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x6d, 0x65, 0x74, 0x61, 0x1a, 0x1d, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, + 0x31, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x9b, 0x03, 0x0a, 0x10, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, + 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x2a, 0x0a, 0x04, 0x70, 0x65, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, + 0x74, 0x61, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x04, 0x70, 0x65, 0x65, 0x72, 0x12, 0x1b, 0x0a, + 0x09, 0x69, 0x73, 0x5f, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x69, 0x73, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x47, 0x0a, 0x0f, 0x72, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, + 0x76, 0x61, 0x6c, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, + 0x76, 0x61, 0x6c, 0x12, 0x37, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x12, 0x3f, 0x0a, 0x0c, + 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, + 0x52, 0x0b, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x42, 0x0a, + 0x0d, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x07, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x53, + 0x74, 0x61, 0x74, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x22, 0xdc, 0x02, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x72, 0x63, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x72, 0x63, + 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x77, 0x63, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x04, 0x77, 0x63, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4e, + 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x70, 0x75, 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x63, 0x70, 0x75, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x6c, + 0x6f, 0x61, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x69, 0x6f, 0x5f, 0x72, + 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x49, + 0x6f, 0x52, 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x69, + 0x6f, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x77, 0x72, + 0x69, 0x74, 0x65, 0x49, 0x6f, 0x52, 0x61, 0x74, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x61, 0x74, 0x74, + 0x72, 0x73, 0x18, 0x64, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, + 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4e, 0x6f, 0x64, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x05, 0x61, 0x74, 0x74, 0x72, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0xde, 0x02, 0x0a, 0x0a, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x12, + 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x3a, 0x0a, 0x0a, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, + 0x65, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x09, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x63, 0x75, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x72, 0x63, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x77, 0x63, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x77, 0x63, 0x75, 0x73, + 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x5f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x61, 0x70, 0x70, + 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x29, 0x0a, + 0x10, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x77, + 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x78, 0x69, + 0x6d, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x3d, 0x0a, 0x05, 0x61, 0x74, 0x74, 0x72, + 0x73, 0x18, 0x64, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, + 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f, + 0x6e, 0x53, 0x74, 0x61, 0x74, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x05, 0x61, 0x74, 0x74, 0x72, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0x71, 0x0a, 0x0b, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x53, 0x74, 0x61, 0x74, + 0x12, 0x2a, 0x0a, 0x04, 0x70, 0x65, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, + 0x61, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x04, 0x70, 0x65, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, + 0x69, 0x6e, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, + 0x6e, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x6c, 0x65, 0x61, 0x72, + 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x4c, 0x65, 0x61, + 0x72, 0x6e, 0x65, 0x72, 0x22, 0x67, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x65, 0x70, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x4b, 0x0a, + 0x10, 0x41, 0x73, 0x6b, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x7d, 0x0a, 0x11, 0x41, 0x73, + 0x6b, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x38, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, + 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x06, 0x6c, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x65, 0x70, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x65, 0x65, + 0x72, 0x52, 0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x32, 0xbf, 0x01, 0x0a, 0x09, 0x48, 0x65, + 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x5a, 0x0a, 0x09, 0x48, 0x65, 0x61, 0x72, 0x74, + 0x62, 0x65, 0x61, 0x74, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, + 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x72, + 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, + 0x01, 0x30, 0x01, 0x12, 0x56, 0x0a, 0x09, 0x41, 0x73, 0x6b, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x22, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, + 0x65, 0x74, 0x61, 0x2e, 0x41, 0x73, 0x6b, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x41, 0x73, 0x6b, 0x4c, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3c, 0x5a, 0x3a, 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, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_greptime_v1_meta_heartbeat_proto_rawDescOnce sync.Once + file_greptime_v1_meta_heartbeat_proto_rawDescData = file_greptime_v1_meta_heartbeat_proto_rawDesc +) + +func file_greptime_v1_meta_heartbeat_proto_rawDescGZIP() []byte { + file_greptime_v1_meta_heartbeat_proto_rawDescOnce.Do(func() { + file_greptime_v1_meta_heartbeat_proto_rawDescData = protoimpl.X.CompressGZIP(file_greptime_v1_meta_heartbeat_proto_rawDescData) + }) + return file_greptime_v1_meta_heartbeat_proto_rawDescData +} + +var file_greptime_v1_meta_heartbeat_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_greptime_v1_meta_heartbeat_proto_goTypes = []interface{}{ + (*HeartbeatRequest)(nil), // 0: greptime.v1.meta.HeartbeatRequest + (*NodeStat)(nil), // 1: greptime.v1.meta.NodeStat + (*RegionStat)(nil), // 2: greptime.v1.meta.RegionStat + (*ReplicaStat)(nil), // 3: greptime.v1.meta.ReplicaStat + (*HeartbeatResponse)(nil), // 4: greptime.v1.meta.HeartbeatResponse + (*AskLeaderRequest)(nil), // 5: greptime.v1.meta.AskLeaderRequest + (*AskLeaderResponse)(nil), // 6: greptime.v1.meta.AskLeaderResponse + nil, // 7: greptime.v1.meta.NodeStat.AttrsEntry + nil, // 8: greptime.v1.meta.RegionStat.AttrsEntry + (*RequestHeader)(nil), // 9: greptime.v1.meta.RequestHeader + (*Peer)(nil), // 10: greptime.v1.meta.Peer + (*TimeInterval)(nil), // 11: greptime.v1.meta.TimeInterval + (*TableName)(nil), // 12: greptime.v1.meta.TableName + (*ResponseHeader)(nil), // 13: greptime.v1.meta.ResponseHeader +} +var file_greptime_v1_meta_heartbeat_proto_depIdxs = []int32{ + 9, // 0: greptime.v1.meta.HeartbeatRequest.header:type_name -> greptime.v1.meta.RequestHeader + 10, // 1: greptime.v1.meta.HeartbeatRequest.peer:type_name -> greptime.v1.meta.Peer + 11, // 2: greptime.v1.meta.HeartbeatRequest.report_interval:type_name -> greptime.v1.meta.TimeInterval + 1, // 3: greptime.v1.meta.HeartbeatRequest.node_stat:type_name -> greptime.v1.meta.NodeStat + 2, // 4: greptime.v1.meta.HeartbeatRequest.region_stats:type_name -> greptime.v1.meta.RegionStat + 3, // 5: greptime.v1.meta.HeartbeatRequest.replica_stats:type_name -> greptime.v1.meta.ReplicaStat + 7, // 6: greptime.v1.meta.NodeStat.attrs:type_name -> greptime.v1.meta.NodeStat.AttrsEntry + 12, // 7: greptime.v1.meta.RegionStat.table_name:type_name -> greptime.v1.meta.TableName + 8, // 8: greptime.v1.meta.RegionStat.attrs:type_name -> greptime.v1.meta.RegionStat.AttrsEntry + 10, // 9: greptime.v1.meta.ReplicaStat.peer:type_name -> greptime.v1.meta.Peer + 13, // 10: greptime.v1.meta.HeartbeatResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 9, // 11: greptime.v1.meta.AskLeaderRequest.header:type_name -> greptime.v1.meta.RequestHeader + 13, // 12: greptime.v1.meta.AskLeaderResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 10, // 13: greptime.v1.meta.AskLeaderResponse.leader:type_name -> greptime.v1.meta.Peer + 0, // 14: greptime.v1.meta.Heartbeat.Heartbeat:input_type -> greptime.v1.meta.HeartbeatRequest + 5, // 15: greptime.v1.meta.Heartbeat.AskLeader:input_type -> greptime.v1.meta.AskLeaderRequest + 4, // 16: greptime.v1.meta.Heartbeat.Heartbeat:output_type -> greptime.v1.meta.HeartbeatResponse + 6, // 17: greptime.v1.meta.Heartbeat.AskLeader:output_type -> greptime.v1.meta.AskLeaderResponse + 16, // [16:18] is the sub-list for method output_type + 14, // [14:16] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_greptime_v1_meta_heartbeat_proto_init() } +func file_greptime_v1_meta_heartbeat_proto_init() { + if File_greptime_v1_meta_heartbeat_proto != nil { + return + } + file_greptime_v1_meta_common_proto_init() + if !protoimpl.UnsafeEnabled { + file_greptime_v1_meta_heartbeat_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeartbeatRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_heartbeat_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeStat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_heartbeat_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegionStat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_heartbeat_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReplicaStat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_heartbeat_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeartbeatResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_heartbeat_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AskLeaderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_heartbeat_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AskLeaderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_greptime_v1_meta_heartbeat_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_greptime_v1_meta_heartbeat_proto_goTypes, + DependencyIndexes: file_greptime_v1_meta_heartbeat_proto_depIdxs, + MessageInfos: file_greptime_v1_meta_heartbeat_proto_msgTypes, + }.Build() + File_greptime_v1_meta_heartbeat_proto = out.File + file_greptime_v1_meta_heartbeat_proto_rawDesc = nil + file_greptime_v1_meta_heartbeat_proto_goTypes = nil + file_greptime_v1_meta_heartbeat_proto_depIdxs = nil +} diff --git a/go/greptime/v1/meta/heartbeat_grpc.pb.go b/go/greptime/v1/meta/heartbeat_grpc.pb.go new file mode 100644 index 00000000..ad2c918f --- /dev/null +++ b/go/greptime/v1/meta/heartbeat_grpc.pb.go @@ -0,0 +1,184 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.7 +// source: greptime/v1/meta/heartbeat.proto + +package meta + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// HeartbeatClient is the client API for Heartbeat service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type HeartbeatClient interface { + // Heartbeat, there may be many contents of the heartbeat, such as: + // 1. Metadata to be registered to meta server and discoverable by other nodes. + // 2. Some performance metrics, such as Load, CPU usage, etc. + // 3. The number of computing tasks being executed. + Heartbeat(ctx context.Context, opts ...grpc.CallOption) (Heartbeat_HeartbeatClient, error) + // Ask leader's endpoint. + AskLeader(ctx context.Context, in *AskLeaderRequest, opts ...grpc.CallOption) (*AskLeaderResponse, error) +} + +type heartbeatClient struct { + cc grpc.ClientConnInterface +} + +func NewHeartbeatClient(cc grpc.ClientConnInterface) HeartbeatClient { + return &heartbeatClient{cc} +} + +func (c *heartbeatClient) Heartbeat(ctx context.Context, opts ...grpc.CallOption) (Heartbeat_HeartbeatClient, error) { + stream, err := c.cc.NewStream(ctx, &Heartbeat_ServiceDesc.Streams[0], "/greptime.v1.meta.Heartbeat/Heartbeat", opts...) + if err != nil { + return nil, err + } + x := &heartbeatHeartbeatClient{stream} + return x, nil +} + +type Heartbeat_HeartbeatClient interface { + Send(*HeartbeatRequest) error + Recv() (*HeartbeatResponse, error) + grpc.ClientStream +} + +type heartbeatHeartbeatClient struct { + grpc.ClientStream +} + +func (x *heartbeatHeartbeatClient) Send(m *HeartbeatRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *heartbeatHeartbeatClient) Recv() (*HeartbeatResponse, error) { + m := new(HeartbeatResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *heartbeatClient) AskLeader(ctx context.Context, in *AskLeaderRequest, opts ...grpc.CallOption) (*AskLeaderResponse, error) { + out := new(AskLeaderResponse) + err := c.cc.Invoke(ctx, "/greptime.v1.meta.Heartbeat/AskLeader", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// HeartbeatServer is the server API for Heartbeat service. +// All implementations must embed UnimplementedHeartbeatServer +// for forward compatibility +type HeartbeatServer interface { + // Heartbeat, there may be many contents of the heartbeat, such as: + // 1. Metadata to be registered to meta server and discoverable by other nodes. + // 2. Some performance metrics, such as Load, CPU usage, etc. + // 3. The number of computing tasks being executed. + Heartbeat(Heartbeat_HeartbeatServer) error + // Ask leader's endpoint. + AskLeader(context.Context, *AskLeaderRequest) (*AskLeaderResponse, error) + mustEmbedUnimplementedHeartbeatServer() +} + +// UnimplementedHeartbeatServer must be embedded to have forward compatible implementations. +type UnimplementedHeartbeatServer struct { +} + +func (UnimplementedHeartbeatServer) Heartbeat(Heartbeat_HeartbeatServer) error { + return status.Errorf(codes.Unimplemented, "method Heartbeat not implemented") +} +func (UnimplementedHeartbeatServer) AskLeader(context.Context, *AskLeaderRequest) (*AskLeaderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AskLeader not implemented") +} +func (UnimplementedHeartbeatServer) mustEmbedUnimplementedHeartbeatServer() {} + +// UnsafeHeartbeatServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to HeartbeatServer will +// result in compilation errors. +type UnsafeHeartbeatServer interface { + mustEmbedUnimplementedHeartbeatServer() +} + +func RegisterHeartbeatServer(s grpc.ServiceRegistrar, srv HeartbeatServer) { + s.RegisterService(&Heartbeat_ServiceDesc, srv) +} + +func _Heartbeat_Heartbeat_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(HeartbeatServer).Heartbeat(&heartbeatHeartbeatServer{stream}) +} + +type Heartbeat_HeartbeatServer interface { + Send(*HeartbeatResponse) error + Recv() (*HeartbeatRequest, error) + grpc.ServerStream +} + +type heartbeatHeartbeatServer struct { + grpc.ServerStream +} + +func (x *heartbeatHeartbeatServer) Send(m *HeartbeatResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *heartbeatHeartbeatServer) Recv() (*HeartbeatRequest, error) { + m := new(HeartbeatRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Heartbeat_AskLeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AskLeaderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HeartbeatServer).AskLeader(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greptime.v1.meta.Heartbeat/AskLeader", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HeartbeatServer).AskLeader(ctx, req.(*AskLeaderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Heartbeat_ServiceDesc is the grpc.ServiceDesc for Heartbeat service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Heartbeat_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "greptime.v1.meta.Heartbeat", + HandlerType: (*HeartbeatServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AskLeader", + Handler: _Heartbeat_AskLeader_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Heartbeat", + Handler: _Heartbeat_Heartbeat_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "greptime/v1/meta/heartbeat.proto", +} diff --git a/go/greptime/v1/meta/lock.pb.go b/go/greptime/v1/meta/lock.pb.go new file mode 100644 index 00000000..5b0c1a42 --- /dev/null +++ b/go/greptime/v1/meta/lock.pb.go @@ -0,0 +1,408 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.7 +// source: greptime/v1/meta/lock.proto + +package meta + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type LockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // Name is the identifier for the distributed shared lock to be acquired. + Name []byte `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // If the expiration time is exceeded and currently holds the lock, the lock is + // automatically released. + ExpireSecs int64 `protobuf:"varint,3,opt,name=expire_secs,json=expireSecs,proto3" json:"expire_secs,omitempty"` +} + +func (x *LockRequest) Reset() { + *x = LockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_lock_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockRequest) ProtoMessage() {} + +func (x *LockRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_lock_proto_msgTypes[0] + 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 LockRequest.ProtoReflect.Descriptor instead. +func (*LockRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_lock_proto_rawDescGZIP(), []int{0} +} + +func (x *LockRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *LockRequest) GetName() []byte { + if x != nil { + return x.Name + } + return nil +} + +func (x *LockRequest) GetExpireSecs() int64 { + if x != nil { + return x.ExpireSecs + } + return 0 +} + +type LockResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // Key will exist as long as lock is held by the caller. + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *LockResponse) Reset() { + *x = LockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_lock_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockResponse) ProtoMessage() {} + +func (x *LockResponse) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_lock_proto_msgTypes[1] + 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 LockResponse.ProtoReflect.Descriptor instead. +func (*LockResponse) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_lock_proto_rawDescGZIP(), []int{1} +} + +func (x *LockResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *LockResponse) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +type UnlockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // key is the lock ownership key granted by Lock. + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *UnlockRequest) Reset() { + *x = UnlockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_lock_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnlockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnlockRequest) ProtoMessage() {} + +func (x *UnlockRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_lock_proto_msgTypes[2] + 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 UnlockRequest.ProtoReflect.Descriptor instead. +func (*UnlockRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_lock_proto_rawDescGZIP(), []int{2} +} + +func (x *UnlockRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *UnlockRequest) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +type UnlockResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` +} + +func (x *UnlockResponse) Reset() { + *x = UnlockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_lock_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnlockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnlockResponse) ProtoMessage() {} + +func (x *UnlockResponse) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_lock_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 UnlockResponse.ProtoReflect.Descriptor instead. +func (*UnlockResponse) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_lock_proto_rawDescGZIP(), []int{3} +} + +func (x *UnlockResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +var File_greptime_v1_meta_lock_proto protoreflect.FileDescriptor + +var file_greptime_v1_meta_lock_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, + 0x74, 0x61, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x67, + 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x1a, + 0x1d, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x74, + 0x61, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7b, + 0x0a, 0x0b, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, + 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, + 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x53, 0x65, 0x63, 0x73, 0x22, 0x5a, 0x0a, 0x0c, 0x4c, + 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, + 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x5a, 0x0a, 0x0d, 0x55, 0x6e, 0x6c, 0x6f, 0x63, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, + 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x22, 0x4a, 0x0a, 0x0e, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x32, + 0x9a, 0x01, 0x0a, 0x04, 0x4c, 0x6f, 0x63, 0x6b, 0x12, 0x45, 0x0a, 0x04, 0x4c, 0x6f, 0x63, 0x6b, + 0x12, 0x1d, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, + 0x65, 0x74, 0x61, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1e, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, + 0x74, 0x61, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x4b, 0x0a, 0x06, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x55, 0x6e, 0x6c, + 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x72, 0x65, + 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x55, 0x6e, + 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3c, 0x5a, 0x3a, + 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, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_greptime_v1_meta_lock_proto_rawDescOnce sync.Once + file_greptime_v1_meta_lock_proto_rawDescData = file_greptime_v1_meta_lock_proto_rawDesc +) + +func file_greptime_v1_meta_lock_proto_rawDescGZIP() []byte { + file_greptime_v1_meta_lock_proto_rawDescOnce.Do(func() { + file_greptime_v1_meta_lock_proto_rawDescData = protoimpl.X.CompressGZIP(file_greptime_v1_meta_lock_proto_rawDescData) + }) + return file_greptime_v1_meta_lock_proto_rawDescData +} + +var file_greptime_v1_meta_lock_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_greptime_v1_meta_lock_proto_goTypes = []interface{}{ + (*LockRequest)(nil), // 0: greptime.v1.meta.LockRequest + (*LockResponse)(nil), // 1: greptime.v1.meta.LockResponse + (*UnlockRequest)(nil), // 2: greptime.v1.meta.UnlockRequest + (*UnlockResponse)(nil), // 3: greptime.v1.meta.UnlockResponse + (*RequestHeader)(nil), // 4: greptime.v1.meta.RequestHeader + (*ResponseHeader)(nil), // 5: greptime.v1.meta.ResponseHeader +} +var file_greptime_v1_meta_lock_proto_depIdxs = []int32{ + 4, // 0: greptime.v1.meta.LockRequest.header:type_name -> greptime.v1.meta.RequestHeader + 5, // 1: greptime.v1.meta.LockResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 4, // 2: greptime.v1.meta.UnlockRequest.header:type_name -> greptime.v1.meta.RequestHeader + 5, // 3: greptime.v1.meta.UnlockResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 0, // 4: greptime.v1.meta.Lock.Lock:input_type -> greptime.v1.meta.LockRequest + 2, // 5: greptime.v1.meta.Lock.Unlock:input_type -> greptime.v1.meta.UnlockRequest + 1, // 6: greptime.v1.meta.Lock.Lock:output_type -> greptime.v1.meta.LockResponse + 3, // 7: greptime.v1.meta.Lock.Unlock:output_type -> greptime.v1.meta.UnlockResponse + 6, // [6:8] is the sub-list for method output_type + 4, // [4:6] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_greptime_v1_meta_lock_proto_init() } +func file_greptime_v1_meta_lock_proto_init() { + if File_greptime_v1_meta_lock_proto != nil { + return + } + file_greptime_v1_meta_common_proto_init() + if !protoimpl.UnsafeEnabled { + file_greptime_v1_meta_lock_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_lock_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_lock_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnlockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_lock_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnlockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_greptime_v1_meta_lock_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_greptime_v1_meta_lock_proto_goTypes, + DependencyIndexes: file_greptime_v1_meta_lock_proto_depIdxs, + MessageInfos: file_greptime_v1_meta_lock_proto_msgTypes, + }.Build() + File_greptime_v1_meta_lock_proto = out.File + file_greptime_v1_meta_lock_proto_rawDesc = nil + file_greptime_v1_meta_lock_proto_goTypes = nil + file_greptime_v1_meta_lock_proto_depIdxs = nil +} diff --git a/go/greptime/v1/meta/lock_grpc.pb.go b/go/greptime/v1/meta/lock_grpc.pb.go new file mode 100644 index 00000000..0497310b --- /dev/null +++ b/go/greptime/v1/meta/lock_grpc.pb.go @@ -0,0 +1,147 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.7 +// source: greptime/v1/meta/lock.proto + +package meta + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// LockClient is the client API for Lock service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type LockClient interface { + // Lock acquires a distributed shared lock on a given named lock. On success, it + // will return a unique key that exists so long as the lock is held by the caller. + Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error) + // Unlock takes a key returned by Lock and releases the hold on lock. + Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error) +} + +type lockClient struct { + cc grpc.ClientConnInterface +} + +func NewLockClient(cc grpc.ClientConnInterface) LockClient { + return &lockClient{cc} +} + +func (c *lockClient) Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error) { + out := new(LockResponse) + err := c.cc.Invoke(ctx, "/greptime.v1.meta.Lock/Lock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lockClient) Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error) { + out := new(UnlockResponse) + err := c.cc.Invoke(ctx, "/greptime.v1.meta.Lock/Unlock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// LockServer is the server API for Lock service. +// All implementations must embed UnimplementedLockServer +// for forward compatibility +type LockServer interface { + // Lock acquires a distributed shared lock on a given named lock. On success, it + // will return a unique key that exists so long as the lock is held by the caller. + Lock(context.Context, *LockRequest) (*LockResponse, error) + // Unlock takes a key returned by Lock and releases the hold on lock. + Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error) + mustEmbedUnimplementedLockServer() +} + +// UnimplementedLockServer must be embedded to have forward compatible implementations. +type UnimplementedLockServer struct { +} + +func (UnimplementedLockServer) Lock(context.Context, *LockRequest) (*LockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Lock not implemented") +} +func (UnimplementedLockServer) Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Unlock not implemented") +} +func (UnimplementedLockServer) mustEmbedUnimplementedLockServer() {} + +// UnsafeLockServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LockServer will +// result in compilation errors. +type UnsafeLockServer interface { + mustEmbedUnimplementedLockServer() +} + +func RegisterLockServer(s grpc.ServiceRegistrar, srv LockServer) { + s.RegisterService(&Lock_ServiceDesc, srv) +} + +func _Lock_Lock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LockServer).Lock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greptime.v1.meta.Lock/Lock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LockServer).Lock(ctx, req.(*LockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Lock_Unlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LockServer).Unlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greptime.v1.meta.Lock/Unlock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LockServer).Unlock(ctx, req.(*UnlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Lock_ServiceDesc is the grpc.ServiceDesc for Lock service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Lock_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "greptime.v1.meta.Lock", + HandlerType: (*LockServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Lock", + Handler: _Lock_Lock_Handler, + }, + { + MethodName: "Unlock", + Handler: _Lock_Unlock_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "greptime/v1/meta/lock.proto", +} diff --git a/go/greptime/v1/meta/route.pb.go b/go/greptime/v1/meta/route.pb.go new file mode 100644 index 00000000..ee9cba79 --- /dev/null +++ b/go/greptime/v1/meta/route.pb.go @@ -0,0 +1,967 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.7 +// source: greptime/v1/meta/route.proto + +package meta + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CreateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + TableName *TableName `protobuf:"bytes,2,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` + Partitions []*Partition `protobuf:"bytes,3,rep,name=partitions,proto3" json:"partitions,omitempty"` + TableInfo []byte `protobuf:"bytes,4,opt,name=table_info,json=tableInfo,proto3" json:"table_info,omitempty"` +} + +func (x *CreateRequest) Reset() { + *x = CreateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_route_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRequest) ProtoMessage() {} + +func (x *CreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_route_proto_msgTypes[0] + 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 CreateRequest.ProtoReflect.Descriptor instead. +func (*CreateRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_route_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *CreateRequest) GetTableName() *TableName { + if x != nil { + return x.TableName + } + return nil +} + +func (x *CreateRequest) GetPartitions() []*Partition { + if x != nil { + return x.Partitions + } + return nil +} + +func (x *CreateRequest) GetTableInfo() []byte { + if x != nil { + return x.TableInfo + } + return nil +} + +type RouteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + TableNames []*TableName `protobuf:"bytes,2,rep,name=table_names,json=tableNames,proto3" json:"table_names,omitempty"` +} + +func (x *RouteRequest) Reset() { + *x = RouteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_route_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RouteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RouteRequest) ProtoMessage() {} + +func (x *RouteRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_route_proto_msgTypes[1] + 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 RouteRequest.ProtoReflect.Descriptor instead. +func (*RouteRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_route_proto_rawDescGZIP(), []int{1} +} + +func (x *RouteRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *RouteRequest) GetTableNames() []*TableName { + if x != nil { + return x.TableNames + } + return nil +} + +type DeleteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + TableName *TableName `protobuf:"bytes,2,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` +} + +func (x *DeleteRequest) Reset() { + *x = DeleteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_route_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRequest) ProtoMessage() {} + +func (x *DeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_route_proto_msgTypes[2] + 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 DeleteRequest.ProtoReflect.Descriptor instead. +func (*DeleteRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_route_proto_rawDescGZIP(), []int{2} +} + +func (x *DeleteRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *DeleteRequest) GetTableName() *TableName { + if x != nil { + return x.TableName + } + return nil +} + +type RouteResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Peers []*Peer `protobuf:"bytes,2,rep,name=peers,proto3" json:"peers,omitempty"` + TableRoutes []*TableRoute `protobuf:"bytes,3,rep,name=table_routes,json=tableRoutes,proto3" json:"table_routes,omitempty"` +} + +func (x *RouteResponse) Reset() { + *x = RouteResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_route_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RouteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RouteResponse) ProtoMessage() {} + +func (x *RouteResponse) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_route_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 RouteResponse.ProtoReflect.Descriptor instead. +func (*RouteResponse) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_route_proto_rawDescGZIP(), []int{3} +} + +func (x *RouteResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *RouteResponse) GetPeers() []*Peer { + if x != nil { + return x.Peers + } + return nil +} + +func (x *RouteResponse) GetTableRoutes() []*TableRoute { + if x != nil { + return x.TableRoutes + } + return nil +} + +type TableRoute struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Table *Table `protobuf:"bytes,1,opt,name=table,proto3" json:"table,omitempty"` + RegionRoutes []*RegionRoute `protobuf:"bytes,2,rep,name=region_routes,json=regionRoutes,proto3" json:"region_routes,omitempty"` +} + +func (x *TableRoute) Reset() { + *x = TableRoute{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_route_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TableRoute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TableRoute) ProtoMessage() {} + +func (x *TableRoute) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_route_proto_msgTypes[4] + 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 TableRoute.ProtoReflect.Descriptor instead. +func (*TableRoute) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_route_proto_rawDescGZIP(), []int{4} +} + +func (x *TableRoute) GetTable() *Table { + if x != nil { + return x.Table + } + return nil +} + +func (x *TableRoute) GetRegionRoutes() []*RegionRoute { + if x != nil { + return x.RegionRoutes + } + return nil +} + +type RegionRoute struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Region *Region `protobuf:"bytes,1,opt,name=region,proto3" json:"region,omitempty"` + // single leader node for write task + LeaderPeerIndex uint64 `protobuf:"varint,2,opt,name=leader_peer_index,json=leaderPeerIndex,proto3" json:"leader_peer_index,omitempty"` + // multiple follower nodes for read task + FollowerPeerIndexes []uint64 `protobuf:"varint,3,rep,packed,name=follower_peer_indexes,json=followerPeerIndexes,proto3" json:"follower_peer_indexes,omitempty"` +} + +func (x *RegionRoute) Reset() { + *x = RegionRoute{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_route_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegionRoute) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegionRoute) ProtoMessage() {} + +func (x *RegionRoute) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_route_proto_msgTypes[5] + 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 RegionRoute.ProtoReflect.Descriptor instead. +func (*RegionRoute) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_route_proto_rawDescGZIP(), []int{5} +} + +func (x *RegionRoute) GetRegion() *Region { + if x != nil { + return x.Region + } + return nil +} + +func (x *RegionRoute) GetLeaderPeerIndex() uint64 { + if x != nil { + return x.LeaderPeerIndex + } + return 0 +} + +func (x *RegionRoute) GetFollowerPeerIndexes() []uint64 { + if x != nil { + return x.FollowerPeerIndexes + } + return nil +} + +type Table struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + TableName *TableName `protobuf:"bytes,2,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` + TableSchema []byte `protobuf:"bytes,3,opt,name=table_schema,json=tableSchema,proto3" json:"table_schema,omitempty"` +} + +func (x *Table) Reset() { + *x = Table{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_route_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Table) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Table) ProtoMessage() {} + +func (x *Table) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_route_proto_msgTypes[6] + 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 Table.ProtoReflect.Descriptor instead. +func (*Table) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_route_proto_rawDescGZIP(), []int{6} +} + +func (x *Table) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Table) GetTableName() *TableName { + if x != nil { + return x.TableName + } + return nil +} + +func (x *Table) GetTableSchema() []byte { + if x != nil { + return x.TableSchema + } + return nil +} + +type Region struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // TODO(LFC): Maybe use message RegionNumber? + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Partition *Partition `protobuf:"bytes,3,opt,name=partition,proto3" json:"partition,omitempty"` + Attrs map[string]string `protobuf:"bytes,100,rep,name=attrs,proto3" json:"attrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Region) Reset() { + *x = Region{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_route_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Region) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Region) ProtoMessage() {} + +func (x *Region) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_route_proto_msgTypes[7] + 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 Region.ProtoReflect.Descriptor instead. +func (*Region) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_route_proto_rawDescGZIP(), []int{7} +} + +func (x *Region) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Region) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Region) GetPartition() *Partition { + if x != nil { + return x.Partition + } + return nil +} + +func (x *Region) GetAttrs() map[string]string { + if x != nil { + return x.Attrs + } + return nil +} + +// PARTITION `region_name` VALUES LESS THAN (value_list) +type Partition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ColumnList [][]byte `protobuf:"bytes,1,rep,name=column_list,json=columnList,proto3" json:"column_list,omitempty"` + ValueList [][]byte `protobuf:"bytes,2,rep,name=value_list,json=valueList,proto3" json:"value_list,omitempty"` +} + +func (x *Partition) Reset() { + *x = Partition{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_route_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Partition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Partition) ProtoMessage() {} + +func (x *Partition) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_route_proto_msgTypes[8] + 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 Partition.ProtoReflect.Descriptor instead. +func (*Partition) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_route_proto_rawDescGZIP(), []int{8} +} + +func (x *Partition) GetColumnList() [][]byte { + if x != nil { + return x.ColumnList + } + return nil +} + +func (x *Partition) GetValueList() [][]byte { + if x != nil { + return x.ValueList + } + return nil +} + +// This message is only for saving into store. +type TableRouteValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Peers []*Peer `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` + TableRoute *TableRoute `protobuf:"bytes,2,opt,name=table_route,json=tableRoute,proto3" json:"table_route,omitempty"` +} + +func (x *TableRouteValue) Reset() { + *x = TableRouteValue{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_route_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TableRouteValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TableRouteValue) ProtoMessage() {} + +func (x *TableRouteValue) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_route_proto_msgTypes[9] + 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 TableRouteValue.ProtoReflect.Descriptor instead. +func (*TableRouteValue) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_route_proto_rawDescGZIP(), []int{9} +} + +func (x *TableRouteValue) GetPeers() []*Peer { + if x != nil { + return x.Peers + } + return nil +} + +func (x *TableRouteValue) GetTableRoute() *TableRoute { + if x != nil { + return x.TableRoute + } + return nil +} + +var File_greptime_v1_meta_route_proto protoreflect.FileDescriptor + +var file_greptime_v1_meta_route_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, + 0x74, 0x61, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, + 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, + 0x1a, 0x1d, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, + 0x74, 0x61, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0xe0, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0a, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, + 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x09, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x65, + 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x61, + 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x66, + 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x22, 0x85, 0x01, 0x0a, 0x0c, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x0b, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x0a, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x0d, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x06, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, + 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x65, 0x70, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0xb8, 0x01, 0x0a, 0x0d, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2c, 0x0a, + 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, + 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, + 0x50, 0x65, 0x65, 0x72, 0x52, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, + 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x22, 0x7f, 0x0a, 0x0a, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x65, 0x70, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x42, 0x0a, 0x0d, 0x72, 0x65, 0x67, + 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1d, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, + 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, + 0x0c, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x22, 0x9f, 0x01, + 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x30, 0x0a, + 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, + 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, + 0x2a, 0x0a, 0x11, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x6c, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, 0x15, 0x66, + 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x04, 0x52, 0x13, 0x66, 0x6f, 0x6c, 0x6c, + 0x6f, 0x77, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x22, + 0x76, 0x0a, 0x05, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3a, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, + 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0xdc, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x67, 0x69, + 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x65, 0x70, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x61, 0x72, + 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x39, 0x0a, 0x05, 0x61, 0x74, 0x74, 0x72, 0x73, 0x18, 0x64, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x23, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, + 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x61, 0x74, 0x74, 0x72, 0x73, 0x1a, 0x38, 0x0a, 0x0a, + 0x41, 0x74, 0x74, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4b, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6c, 0x69, + 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x6c, 0x69, + 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4c, + 0x69, 0x73, 0x74, 0x22, 0x7e, 0x0a, 0x0f, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x6f, 0x75, 0x74, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x05, 0x70, + 0x65, 0x65, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x72, 0x6f, + 0x75, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x65, 0x70, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x6f, + 0x75, 0x74, 0x65, 0x32, 0xf0, 0x01, 0x0a, 0x06, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x12, 0x4c, + 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, + 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x75, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x05, + 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3c, 0x5a, 0x3a, 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, 0x2f, + 0x6d, 0x65, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_greptime_v1_meta_route_proto_rawDescOnce sync.Once + file_greptime_v1_meta_route_proto_rawDescData = file_greptime_v1_meta_route_proto_rawDesc +) + +func file_greptime_v1_meta_route_proto_rawDescGZIP() []byte { + file_greptime_v1_meta_route_proto_rawDescOnce.Do(func() { + file_greptime_v1_meta_route_proto_rawDescData = protoimpl.X.CompressGZIP(file_greptime_v1_meta_route_proto_rawDescData) + }) + return file_greptime_v1_meta_route_proto_rawDescData +} + +var file_greptime_v1_meta_route_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_greptime_v1_meta_route_proto_goTypes = []interface{}{ + (*CreateRequest)(nil), // 0: greptime.v1.meta.CreateRequest + (*RouteRequest)(nil), // 1: greptime.v1.meta.RouteRequest + (*DeleteRequest)(nil), // 2: greptime.v1.meta.DeleteRequest + (*RouteResponse)(nil), // 3: greptime.v1.meta.RouteResponse + (*TableRoute)(nil), // 4: greptime.v1.meta.TableRoute + (*RegionRoute)(nil), // 5: greptime.v1.meta.RegionRoute + (*Table)(nil), // 6: greptime.v1.meta.Table + (*Region)(nil), // 7: greptime.v1.meta.Region + (*Partition)(nil), // 8: greptime.v1.meta.Partition + (*TableRouteValue)(nil), // 9: greptime.v1.meta.TableRouteValue + nil, // 10: greptime.v1.meta.Region.AttrsEntry + (*RequestHeader)(nil), // 11: greptime.v1.meta.RequestHeader + (*TableName)(nil), // 12: greptime.v1.meta.TableName + (*ResponseHeader)(nil), // 13: greptime.v1.meta.ResponseHeader + (*Peer)(nil), // 14: greptime.v1.meta.Peer +} +var file_greptime_v1_meta_route_proto_depIdxs = []int32{ + 11, // 0: greptime.v1.meta.CreateRequest.header:type_name -> greptime.v1.meta.RequestHeader + 12, // 1: greptime.v1.meta.CreateRequest.table_name:type_name -> greptime.v1.meta.TableName + 8, // 2: greptime.v1.meta.CreateRequest.partitions:type_name -> greptime.v1.meta.Partition + 11, // 3: greptime.v1.meta.RouteRequest.header:type_name -> greptime.v1.meta.RequestHeader + 12, // 4: greptime.v1.meta.RouteRequest.table_names:type_name -> greptime.v1.meta.TableName + 11, // 5: greptime.v1.meta.DeleteRequest.header:type_name -> greptime.v1.meta.RequestHeader + 12, // 6: greptime.v1.meta.DeleteRequest.table_name:type_name -> greptime.v1.meta.TableName + 13, // 7: greptime.v1.meta.RouteResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 14, // 8: greptime.v1.meta.RouteResponse.peers:type_name -> greptime.v1.meta.Peer + 4, // 9: greptime.v1.meta.RouteResponse.table_routes:type_name -> greptime.v1.meta.TableRoute + 6, // 10: greptime.v1.meta.TableRoute.table:type_name -> greptime.v1.meta.Table + 5, // 11: greptime.v1.meta.TableRoute.region_routes:type_name -> greptime.v1.meta.RegionRoute + 7, // 12: greptime.v1.meta.RegionRoute.region:type_name -> greptime.v1.meta.Region + 12, // 13: greptime.v1.meta.Table.table_name:type_name -> greptime.v1.meta.TableName + 8, // 14: greptime.v1.meta.Region.partition:type_name -> greptime.v1.meta.Partition + 10, // 15: greptime.v1.meta.Region.attrs:type_name -> greptime.v1.meta.Region.AttrsEntry + 14, // 16: greptime.v1.meta.TableRouteValue.peers:type_name -> greptime.v1.meta.Peer + 4, // 17: greptime.v1.meta.TableRouteValue.table_route:type_name -> greptime.v1.meta.TableRoute + 0, // 18: greptime.v1.meta.Router.Create:input_type -> greptime.v1.meta.CreateRequest + 1, // 19: greptime.v1.meta.Router.Route:input_type -> greptime.v1.meta.RouteRequest + 2, // 20: greptime.v1.meta.Router.Delete:input_type -> greptime.v1.meta.DeleteRequest + 3, // 21: greptime.v1.meta.Router.Create:output_type -> greptime.v1.meta.RouteResponse + 3, // 22: greptime.v1.meta.Router.Route:output_type -> greptime.v1.meta.RouteResponse + 3, // 23: greptime.v1.meta.Router.Delete:output_type -> greptime.v1.meta.RouteResponse + 21, // [21:24] is the sub-list for method output_type + 18, // [18:21] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name +} + +func init() { file_greptime_v1_meta_route_proto_init() } +func file_greptime_v1_meta_route_proto_init() { + if File_greptime_v1_meta_route_proto != nil { + return + } + file_greptime_v1_meta_common_proto_init() + if !protoimpl.UnsafeEnabled { + file_greptime_v1_meta_route_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_route_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RouteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_route_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_route_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RouteResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_route_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TableRoute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_route_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegionRoute); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_route_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Table); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_route_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Region); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_route_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Partition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_route_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TableRouteValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_greptime_v1_meta_route_proto_rawDesc, + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_greptime_v1_meta_route_proto_goTypes, + DependencyIndexes: file_greptime_v1_meta_route_proto_depIdxs, + MessageInfos: file_greptime_v1_meta_route_proto_msgTypes, + }.Build() + File_greptime_v1_meta_route_proto = out.File + file_greptime_v1_meta_route_proto_rawDesc = nil + file_greptime_v1_meta_route_proto_goTypes = nil + file_greptime_v1_meta_route_proto_depIdxs = nil +} diff --git a/go/greptime/v1/meta/route_grpc.pb.go b/go/greptime/v1/meta/route_grpc.pb.go new file mode 100644 index 00000000..b838c420 --- /dev/null +++ b/go/greptime/v1/meta/route_grpc.pb.go @@ -0,0 +1,215 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.7 +// source: greptime/v1/meta/route.proto + +package meta + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// RouterClient is the client API for Router service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type RouterClient interface { + Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*RouteResponse, error) + // Fetch routing information for tables. The smallest unit is the complete + // routing information(all regions) of a table. + // + // ```text + // table_1 + // table_name + // table_schema + // regions + // region_1 + // leader_peer + // follower_peer_1, follower_peer_2 + // region_2 + // leader_peer + // follower_peer_1, follower_peer_2, follower_peer_3 + // region_xxx + // table_2 + // ... + // ``` + // + Route(ctx context.Context, in *RouteRequest, opts ...grpc.CallOption) (*RouteResponse, error) + Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*RouteResponse, error) +} + +type routerClient struct { + cc grpc.ClientConnInterface +} + +func NewRouterClient(cc grpc.ClientConnInterface) RouterClient { + return &routerClient{cc} +} + +func (c *routerClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*RouteResponse, error) { + out := new(RouteResponse) + err := c.cc.Invoke(ctx, "/greptime.v1.meta.Router/Create", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *routerClient) Route(ctx context.Context, in *RouteRequest, opts ...grpc.CallOption) (*RouteResponse, error) { + out := new(RouteResponse) + err := c.cc.Invoke(ctx, "/greptime.v1.meta.Router/Route", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *routerClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*RouteResponse, error) { + out := new(RouteResponse) + err := c.cc.Invoke(ctx, "/greptime.v1.meta.Router/Delete", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RouterServer is the server API for Router service. +// All implementations must embed UnimplementedRouterServer +// for forward compatibility +type RouterServer interface { + Create(context.Context, *CreateRequest) (*RouteResponse, error) + // Fetch routing information for tables. The smallest unit is the complete + // routing information(all regions) of a table. + // + // ```text + // table_1 + // table_name + // table_schema + // regions + // region_1 + // leader_peer + // follower_peer_1, follower_peer_2 + // region_2 + // leader_peer + // follower_peer_1, follower_peer_2, follower_peer_3 + // region_xxx + // table_2 + // ... + // ``` + // + Route(context.Context, *RouteRequest) (*RouteResponse, error) + Delete(context.Context, *DeleteRequest) (*RouteResponse, error) + mustEmbedUnimplementedRouterServer() +} + +// UnimplementedRouterServer must be embedded to have forward compatible implementations. +type UnimplementedRouterServer struct { +} + +func (UnimplementedRouterServer) Create(context.Context, *CreateRequest) (*RouteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") +} +func (UnimplementedRouterServer) Route(context.Context, *RouteRequest) (*RouteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Route not implemented") +} +func (UnimplementedRouterServer) Delete(context.Context, *DeleteRequest) (*RouteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedRouterServer) mustEmbedUnimplementedRouterServer() {} + +// UnsafeRouterServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RouterServer will +// result in compilation errors. +type UnsafeRouterServer interface { + mustEmbedUnimplementedRouterServer() +} + +func RegisterRouterServer(s grpc.ServiceRegistrar, srv RouterServer) { + s.RegisterService(&Router_ServiceDesc, srv) +} + +func _Router_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServer).Create(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greptime.v1.meta.Router/Create", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServer).Create(ctx, req.(*CreateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Router_Route_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RouteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServer).Route(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greptime.v1.meta.Router/Route", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServer).Route(ctx, req.(*RouteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Router_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RouterServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greptime.v1.meta.Router/Delete", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RouterServer).Delete(ctx, req.(*DeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Router_ServiceDesc is the grpc.ServiceDesc for Router service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Router_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "greptime.v1.meta.Router", + HandlerType: (*RouterServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Create", + Handler: _Router_Create_Handler, + }, + { + MethodName: "Route", + Handler: _Router_Route_Handler, + }, + { + MethodName: "Delete", + Handler: _Router_Delete_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "greptime/v1/meta/route.proto", +} diff --git a/go/greptime/v1/meta/store.pb.go b/go/greptime/v1/meta/store.pb.go new file mode 100644 index 00000000..7e35489f --- /dev/null +++ b/go/greptime/v1/meta/store.pb.go @@ -0,0 +1,1236 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.7 +// source: greptime/v1/meta/store.proto + +package meta + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RangeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // key is the first key for the range, If range_end is not given, the + // request only looks up key. + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + // range_end is the upper bound on the requested range [key, range_end). + // If range_end is '\0', the range is all keys >= key. + // If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"), + // then the range request gets all keys prefixed with key. + // If both key and range_end are '\0', then the range request returns all + // keys. + RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` + // limit is a limit on the number of keys returned for the request. When + // limit is set to 0, it is treated as no limit. + Limit int64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` + // keys_only when set returns only the keys and not the values. + KeysOnly bool `protobuf:"varint,5,opt,name=keys_only,json=keysOnly,proto3" json:"keys_only,omitempty"` +} + +func (x *RangeRequest) Reset() { + *x = RangeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_store_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RangeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RangeRequest) ProtoMessage() {} + +func (x *RangeRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_store_proto_msgTypes[0] + 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 RangeRequest.ProtoReflect.Descriptor instead. +func (*RangeRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_store_proto_rawDescGZIP(), []int{0} +} + +func (x *RangeRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *RangeRequest) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *RangeRequest) GetRangeEnd() []byte { + if x != nil { + return x.RangeEnd + } + return nil +} + +func (x *RangeRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *RangeRequest) GetKeysOnly() bool { + if x != nil { + return x.KeysOnly + } + return false +} + +type RangeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // kvs is the list of key-value pairs matched by the range request. + Kvs []*KeyValue `protobuf:"bytes,2,rep,name=kvs,proto3" json:"kvs,omitempty"` + // more indicates if there are more keys to return in the requested range. + More bool `protobuf:"varint,3,opt,name=more,proto3" json:"more,omitempty"` +} + +func (x *RangeResponse) Reset() { + *x = RangeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_store_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RangeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RangeResponse) ProtoMessage() {} + +func (x *RangeResponse) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_store_proto_msgTypes[1] + 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 RangeResponse.ProtoReflect.Descriptor instead. +func (*RangeResponse) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_store_proto_rawDescGZIP(), []int{1} +} + +func (x *RangeResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *RangeResponse) GetKvs() []*KeyValue { + if x != nil { + return x.Kvs + } + return nil +} + +func (x *RangeResponse) GetMore() bool { + if x != nil { + return x.More + } + return false +} + +type PutRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // key is the key, in bytes, to put into the key-value store. + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + // value is the value, in bytes, to associate with the key in the + // key-value store. + Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + // If prev_kv is set, gets the previous key-value pair before changing it. + // The previous key-value pair will be returned in the put response. + PrevKv bool `protobuf:"varint,4,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` +} + +func (x *PutRequest) Reset() { + *x = PutRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_store_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutRequest) ProtoMessage() {} + +func (x *PutRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_store_proto_msgTypes[2] + 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 PutRequest.ProtoReflect.Descriptor instead. +func (*PutRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_store_proto_rawDescGZIP(), []int{2} +} + +func (x *PutRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *PutRequest) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *PutRequest) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *PutRequest) GetPrevKv() bool { + if x != nil { + return x.PrevKv + } + return false +} + +type PutResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // If prev_kv is set in the request, the previous key-value pair will be + // returned. + PrevKv *KeyValue `protobuf:"bytes,2,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` +} + +func (x *PutResponse) Reset() { + *x = PutResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_store_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutResponse) ProtoMessage() {} + +func (x *PutResponse) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_store_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 PutResponse.ProtoReflect.Descriptor instead. +func (*PutResponse) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_store_proto_rawDescGZIP(), []int{3} +} + +func (x *PutResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *PutResponse) GetPrevKv() *KeyValue { + if x != nil { + return x.PrevKv + } + return nil +} + +type BatchPutRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Kvs []*KeyValue `protobuf:"bytes,2,rep,name=kvs,proto3" json:"kvs,omitempty"` + // If prev_kv is set, gets the previous key-value pairs before changing it. + // The previous key-value pairs will be returned in the batch put response. + PrevKv bool `protobuf:"varint,3,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` +} + +func (x *BatchPutRequest) Reset() { + *x = BatchPutRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_store_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchPutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchPutRequest) ProtoMessage() {} + +func (x *BatchPutRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_store_proto_msgTypes[4] + 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 BatchPutRequest.ProtoReflect.Descriptor instead. +func (*BatchPutRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_store_proto_rawDescGZIP(), []int{4} +} + +func (x *BatchPutRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *BatchPutRequest) GetKvs() []*KeyValue { + if x != nil { + return x.Kvs + } + return nil +} + +func (x *BatchPutRequest) GetPrevKv() bool { + if x != nil { + return x.PrevKv + } + return false +} + +type BatchPutResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // If prev_kv is set in the request, the previous key-value pairs will be + // returned. + PrevKvs []*KeyValue `protobuf:"bytes,2,rep,name=prev_kvs,json=prevKvs,proto3" json:"prev_kvs,omitempty"` +} + +func (x *BatchPutResponse) Reset() { + *x = BatchPutResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_store_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchPutResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchPutResponse) ProtoMessage() {} + +func (x *BatchPutResponse) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_store_proto_msgTypes[5] + 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 BatchPutResponse.ProtoReflect.Descriptor instead. +func (*BatchPutResponse) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_store_proto_rawDescGZIP(), []int{5} +} + +func (x *BatchPutResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *BatchPutResponse) GetPrevKvs() []*KeyValue { + if x != nil { + return x.PrevKvs + } + return nil +} + +type CompareAndPutRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // key is the key, in bytes, to put into the key-value store. + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + // expect is the previous value, in bytes + Expect []byte `protobuf:"bytes,3,opt,name=expect,proto3" json:"expect,omitempty"` + // value is the value, in bytes, to associate with the key in the + // key-value store. + Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *CompareAndPutRequest) Reset() { + *x = CompareAndPutRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_store_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompareAndPutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompareAndPutRequest) ProtoMessage() {} + +func (x *CompareAndPutRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_store_proto_msgTypes[6] + 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 CompareAndPutRequest.ProtoReflect.Descriptor instead. +func (*CompareAndPutRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_store_proto_rawDescGZIP(), []int{6} +} + +func (x *CompareAndPutRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *CompareAndPutRequest) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *CompareAndPutRequest) GetExpect() []byte { + if x != nil { + return x.Expect + } + return nil +} + +func (x *CompareAndPutRequest) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +type CompareAndPutResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Success bool `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"` + PrevKv *KeyValue `protobuf:"bytes,3,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` +} + +func (x *CompareAndPutResponse) Reset() { + *x = CompareAndPutResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_store_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompareAndPutResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompareAndPutResponse) ProtoMessage() {} + +func (x *CompareAndPutResponse) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_store_proto_msgTypes[7] + 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 CompareAndPutResponse.ProtoReflect.Descriptor instead. +func (*CompareAndPutResponse) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_store_proto_rawDescGZIP(), []int{7} +} + +func (x *CompareAndPutResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *CompareAndPutResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *CompareAndPutResponse) GetPrevKv() *KeyValue { + if x != nil { + return x.PrevKv + } + return nil +} + +type DeleteRangeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // key is the first key to delete in the range. + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + // range_end is the key following the last key to delete for the range + // [key, range_end). + // If range_end is not given, the range is defined to contain only the key + // argument. + // If range_end is one bit larger than the given key, then the range is all + // the keys with the prefix (the given key). + // If range_end is '\0', the range is all keys greater than or equal to the + // key argument. + RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` + // If prev_kv is set, gets the previous key-value pairs before deleting it. + // The previous key-value pairs will be returned in the delete response. + PrevKv bool `protobuf:"varint,4,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` +} + +func (x *DeleteRangeRequest) Reset() { + *x = DeleteRangeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_store_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRangeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRangeRequest) ProtoMessage() {} + +func (x *DeleteRangeRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_store_proto_msgTypes[8] + 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 DeleteRangeRequest.ProtoReflect.Descriptor instead. +func (*DeleteRangeRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_store_proto_rawDescGZIP(), []int{8} +} + +func (x *DeleteRangeRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *DeleteRangeRequest) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *DeleteRangeRequest) GetRangeEnd() []byte { + if x != nil { + return x.RangeEnd + } + return nil +} + +func (x *DeleteRangeRequest) GetPrevKv() bool { + if x != nil { + return x.PrevKv + } + return false +} + +type DeleteRangeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // deleted is the number of keys deleted by the delete range request. + Deleted int64 `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"` + // If prev_kv is set in the request, the previous key-value pairs will be + // returned. + PrevKvs []*KeyValue `protobuf:"bytes,3,rep,name=prev_kvs,json=prevKvs,proto3" json:"prev_kvs,omitempty"` +} + +func (x *DeleteRangeResponse) Reset() { + *x = DeleteRangeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_store_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRangeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRangeResponse) ProtoMessage() {} + +func (x *DeleteRangeResponse) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_store_proto_msgTypes[9] + 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 DeleteRangeResponse.ProtoReflect.Descriptor instead. +func (*DeleteRangeResponse) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_store_proto_rawDescGZIP(), []int{9} +} + +func (x *DeleteRangeResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *DeleteRangeResponse) GetDeleted() int64 { + if x != nil { + return x.Deleted + } + return 0 +} + +func (x *DeleteRangeResponse) GetPrevKvs() []*KeyValue { + if x != nil { + return x.PrevKvs + } + return nil +} + +type MoveValueRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // If from_key dose not exist, return the value of to_key (if it exists). + // If from_key exists, move the value of from_key to to_key (i.e. rename), + // and return the value. + FromKey []byte `protobuf:"bytes,2,opt,name=from_key,json=fromKey,proto3" json:"from_key,omitempty"` + ToKey []byte `protobuf:"bytes,3,opt,name=to_key,json=toKey,proto3" json:"to_key,omitempty"` +} + +func (x *MoveValueRequest) Reset() { + *x = MoveValueRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_store_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MoveValueRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MoveValueRequest) ProtoMessage() {} + +func (x *MoveValueRequest) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_store_proto_msgTypes[10] + 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 MoveValueRequest.ProtoReflect.Descriptor instead. +func (*MoveValueRequest) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_store_proto_rawDescGZIP(), []int{10} +} + +func (x *MoveValueRequest) GetHeader() *RequestHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *MoveValueRequest) GetFromKey() []byte { + if x != nil { + return x.FromKey + } + return nil +} + +func (x *MoveValueRequest) GetToKey() []byte { + if x != nil { + return x.ToKey + } + return nil +} + +type MoveValueResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // If from_key dose not exist, return the value of to_key (if it exists). + // If from_key exists, return the value of from_key. + Kv *KeyValue `protobuf:"bytes,2,opt,name=kv,proto3" json:"kv,omitempty"` +} + +func (x *MoveValueResponse) Reset() { + *x = MoveValueResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_store_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MoveValueResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MoveValueResponse) ProtoMessage() {} + +func (x *MoveValueResponse) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_store_proto_msgTypes[11] + 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 MoveValueResponse.ProtoReflect.Descriptor instead. +func (*MoveValueResponse) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_store_proto_rawDescGZIP(), []int{11} +} + +func (x *MoveValueResponse) GetHeader() *ResponseHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *MoveValueResponse) GetKv() *KeyValue { + if x != nil { + return x.Kv + } + return nil +} + +var File_greptime_v1_meta_store_proto protoreflect.FileDescriptor + +var file_greptime_v1_meta_store_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, + 0x74, 0x61, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, + 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, + 0x1a, 0x1d, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, + 0x74, 0x61, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0xa9, 0x01, 0x0a, 0x0c, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, + 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x72, + 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1b, + 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x73, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x73, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x8b, 0x01, 0x0a, 0x0d, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, + 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, + 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x03, 0x6b, 0x76, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x03, 0x6b, 0x76, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x04, 0x6d, 0x6f, 0x72, 0x65, 0x22, 0x86, 0x01, 0x0a, 0x0a, 0x50, 0x75, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, + 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x72, 0x65, + 0x76, 0x5f, 0x6b, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x72, 0x65, 0x76, + 0x4b, 0x76, 0x22, 0x7c, 0x0a, 0x0b, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x38, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x70, + 0x72, 0x65, 0x76, 0x5f, 0x6b, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, + 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x70, 0x72, 0x65, 0x76, 0x4b, 0x76, + 0x22, 0x91, 0x01, 0x0a, 0x0f, 0x42, 0x61, 0x74, 0x63, 0x68, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2c, 0x0a, + 0x03, 0x6b, 0x76, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, + 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4b, 0x65, + 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x6b, 0x76, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x70, + 0x72, 0x65, 0x76, 0x5f, 0x6b, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x72, + 0x65, 0x76, 0x4b, 0x76, 0x22, 0x83, 0x01, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x63, 0x68, 0x50, 0x75, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x65, 0x70, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x6b, 0x76, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x07, 0x70, 0x72, 0x65, 0x76, 0x4b, 0x76, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x14, 0x43, + 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, + 0x0a, 0x06, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, + 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa0, 0x01, 0x0a, + 0x15, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x33, 0x0a, 0x07, 0x70, 0x72, + 0x65, 0x76, 0x5f, 0x6b, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, + 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4b, + 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x70, 0x72, 0x65, 0x76, 0x4b, 0x76, 0x22, + 0x95, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6e, 0x64, 0x12, 0x17, + 0x0a, 0x07, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x6b, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x70, 0x72, 0x65, 0x76, 0x4b, 0x76, 0x22, 0xa0, 0x01, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x38, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, + 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x6b, 0x76, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x07, 0x70, 0x72, 0x65, 0x76, 0x4b, 0x76, 0x73, 0x22, 0x7d, 0x0a, 0x10, 0x4d, 0x6f, + 0x76, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, + 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, + 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x72, 0x6f, 0x6d, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x66, 0x72, 0x6f, 0x6d, 0x4b, + 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x22, 0x79, 0x0a, 0x11, 0x4d, 0x6f, 0x76, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, + 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, + 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, + 0x61, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x02, 0x6b, 0x76, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x52, 0x02, 0x6b, 0x76, 0x32, 0xfc, 0x03, 0x0a, 0x05, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x48, + 0x0a, 0x05, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1e, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, + 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, + 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x03, 0x50, 0x75, 0x74, 0x12, + 0x1c, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, + 0x74, 0x61, 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, + 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, + 0x2e, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x08, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x50, 0x75, 0x74, 0x12, 0x21, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, + 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x50, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x72, + 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x60, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, 0x74, + 0x12, 0x26, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, + 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, + 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x70, + 0x61, 0x72, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x5a, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x12, 0x24, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, + 0x65, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, + 0x09, 0x4d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x65, + 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4d, 0x6f, + 0x76, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, + 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, + 0x61, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x3c, 0x5a, 0x3a, 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, 0x2f, 0x6d, 0x65, 0x74, + 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_greptime_v1_meta_store_proto_rawDescOnce sync.Once + file_greptime_v1_meta_store_proto_rawDescData = file_greptime_v1_meta_store_proto_rawDesc +) + +func file_greptime_v1_meta_store_proto_rawDescGZIP() []byte { + file_greptime_v1_meta_store_proto_rawDescOnce.Do(func() { + file_greptime_v1_meta_store_proto_rawDescData = protoimpl.X.CompressGZIP(file_greptime_v1_meta_store_proto_rawDescData) + }) + return file_greptime_v1_meta_store_proto_rawDescData +} + +var file_greptime_v1_meta_store_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_greptime_v1_meta_store_proto_goTypes = []interface{}{ + (*RangeRequest)(nil), // 0: greptime.v1.meta.RangeRequest + (*RangeResponse)(nil), // 1: greptime.v1.meta.RangeResponse + (*PutRequest)(nil), // 2: greptime.v1.meta.PutRequest + (*PutResponse)(nil), // 3: greptime.v1.meta.PutResponse + (*BatchPutRequest)(nil), // 4: greptime.v1.meta.BatchPutRequest + (*BatchPutResponse)(nil), // 5: greptime.v1.meta.BatchPutResponse + (*CompareAndPutRequest)(nil), // 6: greptime.v1.meta.CompareAndPutRequest + (*CompareAndPutResponse)(nil), // 7: greptime.v1.meta.CompareAndPutResponse + (*DeleteRangeRequest)(nil), // 8: greptime.v1.meta.DeleteRangeRequest + (*DeleteRangeResponse)(nil), // 9: greptime.v1.meta.DeleteRangeResponse + (*MoveValueRequest)(nil), // 10: greptime.v1.meta.MoveValueRequest + (*MoveValueResponse)(nil), // 11: greptime.v1.meta.MoveValueResponse + (*RequestHeader)(nil), // 12: greptime.v1.meta.RequestHeader + (*ResponseHeader)(nil), // 13: greptime.v1.meta.ResponseHeader + (*KeyValue)(nil), // 14: greptime.v1.meta.KeyValue +} +var file_greptime_v1_meta_store_proto_depIdxs = []int32{ + 12, // 0: greptime.v1.meta.RangeRequest.header:type_name -> greptime.v1.meta.RequestHeader + 13, // 1: greptime.v1.meta.RangeResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 14, // 2: greptime.v1.meta.RangeResponse.kvs:type_name -> greptime.v1.meta.KeyValue + 12, // 3: greptime.v1.meta.PutRequest.header:type_name -> greptime.v1.meta.RequestHeader + 13, // 4: greptime.v1.meta.PutResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 14, // 5: greptime.v1.meta.PutResponse.prev_kv:type_name -> greptime.v1.meta.KeyValue + 12, // 6: greptime.v1.meta.BatchPutRequest.header:type_name -> greptime.v1.meta.RequestHeader + 14, // 7: greptime.v1.meta.BatchPutRequest.kvs:type_name -> greptime.v1.meta.KeyValue + 13, // 8: greptime.v1.meta.BatchPutResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 14, // 9: greptime.v1.meta.BatchPutResponse.prev_kvs:type_name -> greptime.v1.meta.KeyValue + 12, // 10: greptime.v1.meta.CompareAndPutRequest.header:type_name -> greptime.v1.meta.RequestHeader + 13, // 11: greptime.v1.meta.CompareAndPutResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 14, // 12: greptime.v1.meta.CompareAndPutResponse.prev_kv:type_name -> greptime.v1.meta.KeyValue + 12, // 13: greptime.v1.meta.DeleteRangeRequest.header:type_name -> greptime.v1.meta.RequestHeader + 13, // 14: greptime.v1.meta.DeleteRangeResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 14, // 15: greptime.v1.meta.DeleteRangeResponse.prev_kvs:type_name -> greptime.v1.meta.KeyValue + 12, // 16: greptime.v1.meta.MoveValueRequest.header:type_name -> greptime.v1.meta.RequestHeader + 13, // 17: greptime.v1.meta.MoveValueResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 14, // 18: greptime.v1.meta.MoveValueResponse.kv:type_name -> greptime.v1.meta.KeyValue + 0, // 19: greptime.v1.meta.Store.Range:input_type -> greptime.v1.meta.RangeRequest + 2, // 20: greptime.v1.meta.Store.Put:input_type -> greptime.v1.meta.PutRequest + 4, // 21: greptime.v1.meta.Store.BatchPut:input_type -> greptime.v1.meta.BatchPutRequest + 6, // 22: greptime.v1.meta.Store.CompareAndPut:input_type -> greptime.v1.meta.CompareAndPutRequest + 8, // 23: greptime.v1.meta.Store.DeleteRange:input_type -> greptime.v1.meta.DeleteRangeRequest + 10, // 24: greptime.v1.meta.Store.MoveValue:input_type -> greptime.v1.meta.MoveValueRequest + 1, // 25: greptime.v1.meta.Store.Range:output_type -> greptime.v1.meta.RangeResponse + 3, // 26: greptime.v1.meta.Store.Put:output_type -> greptime.v1.meta.PutResponse + 5, // 27: greptime.v1.meta.Store.BatchPut:output_type -> greptime.v1.meta.BatchPutResponse + 7, // 28: greptime.v1.meta.Store.CompareAndPut:output_type -> greptime.v1.meta.CompareAndPutResponse + 9, // 29: greptime.v1.meta.Store.DeleteRange:output_type -> greptime.v1.meta.DeleteRangeResponse + 11, // 30: greptime.v1.meta.Store.MoveValue:output_type -> greptime.v1.meta.MoveValueResponse + 25, // [25:31] is the sub-list for method output_type + 19, // [19:25] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name +} + +func init() { file_greptime_v1_meta_store_proto_init() } +func file_greptime_v1_meta_store_proto_init() { + if File_greptime_v1_meta_store_proto != nil { + return + } + file_greptime_v1_meta_common_proto_init() + if !protoimpl.UnsafeEnabled { + file_greptime_v1_meta_store_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RangeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_store_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RangeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_store_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_store_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_store_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchPutRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_store_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchPutResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_store_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CompareAndPutRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_store_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CompareAndPutResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_store_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRangeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_store_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRangeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_store_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MoveValueRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greptime_v1_meta_store_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MoveValueResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_greptime_v1_meta_store_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_greptime_v1_meta_store_proto_goTypes, + DependencyIndexes: file_greptime_v1_meta_store_proto_depIdxs, + MessageInfos: file_greptime_v1_meta_store_proto_msgTypes, + }.Build() + File_greptime_v1_meta_store_proto = out.File + file_greptime_v1_meta_store_proto_rawDesc = nil + file_greptime_v1_meta_store_proto_goTypes = nil + file_greptime_v1_meta_store_proto_depIdxs = nil +} diff --git a/go/greptime/v1/meta/store_grpc.pb.go b/go/greptime/v1/meta/store_grpc.pb.go new file mode 100644 index 00000000..f490cc0b --- /dev/null +++ b/go/greptime/v1/meta/store_grpc.pb.go @@ -0,0 +1,299 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.7 +// source: greptime/v1/meta/store.proto + +package meta + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// StoreClient is the client API for Store service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type StoreClient interface { + // Range gets the keys in the range from the key-value store. + Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) + // Put puts the given key into the key-value store. + Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) + // BatchPut atomically puts the given keys into the key-value store. + BatchPut(ctx context.Context, in *BatchPutRequest, opts ...grpc.CallOption) (*BatchPutResponse, error) + // CompareAndPut atomically puts the value to the given updated + // value if the current value == the expected value. + CompareAndPut(ctx context.Context, in *CompareAndPutRequest, opts ...grpc.CallOption) (*CompareAndPutResponse, error) + // DeleteRange deletes the given range from the key-value store. + DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) + // MoveValue atomically renames the key to the given updated key. + MoveValue(ctx context.Context, in *MoveValueRequest, opts ...grpc.CallOption) (*MoveValueResponse, error) +} + +type storeClient struct { + cc grpc.ClientConnInterface +} + +func NewStoreClient(cc grpc.ClientConnInterface) StoreClient { + return &storeClient{cc} +} + +func (c *storeClient) Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) { + out := new(RangeResponse) + err := c.cc.Invoke(ctx, "/greptime.v1.meta.Store/Range", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storeClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) { + out := new(PutResponse) + err := c.cc.Invoke(ctx, "/greptime.v1.meta.Store/Put", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storeClient) BatchPut(ctx context.Context, in *BatchPutRequest, opts ...grpc.CallOption) (*BatchPutResponse, error) { + out := new(BatchPutResponse) + err := c.cc.Invoke(ctx, "/greptime.v1.meta.Store/BatchPut", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storeClient) CompareAndPut(ctx context.Context, in *CompareAndPutRequest, opts ...grpc.CallOption) (*CompareAndPutResponse, error) { + out := new(CompareAndPutResponse) + err := c.cc.Invoke(ctx, "/greptime.v1.meta.Store/CompareAndPut", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storeClient) DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) { + out := new(DeleteRangeResponse) + err := c.cc.Invoke(ctx, "/greptime.v1.meta.Store/DeleteRange", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *storeClient) MoveValue(ctx context.Context, in *MoveValueRequest, opts ...grpc.CallOption) (*MoveValueResponse, error) { + out := new(MoveValueResponse) + err := c.cc.Invoke(ctx, "/greptime.v1.meta.Store/MoveValue", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// StoreServer is the server API for Store service. +// All implementations must embed UnimplementedStoreServer +// for forward compatibility +type StoreServer interface { + // Range gets the keys in the range from the key-value store. + Range(context.Context, *RangeRequest) (*RangeResponse, error) + // Put puts the given key into the key-value store. + Put(context.Context, *PutRequest) (*PutResponse, error) + // BatchPut atomically puts the given keys into the key-value store. + BatchPut(context.Context, *BatchPutRequest) (*BatchPutResponse, error) + // CompareAndPut atomically puts the value to the given updated + // value if the current value == the expected value. + CompareAndPut(context.Context, *CompareAndPutRequest) (*CompareAndPutResponse, error) + // DeleteRange deletes the given range from the key-value store. + DeleteRange(context.Context, *DeleteRangeRequest) (*DeleteRangeResponse, error) + // MoveValue atomically renames the key to the given updated key. + MoveValue(context.Context, *MoveValueRequest) (*MoveValueResponse, error) + mustEmbedUnimplementedStoreServer() +} + +// UnimplementedStoreServer must be embedded to have forward compatible implementations. +type UnimplementedStoreServer struct { +} + +func (UnimplementedStoreServer) Range(context.Context, *RangeRequest) (*RangeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Range not implemented") +} +func (UnimplementedStoreServer) Put(context.Context, *PutRequest) (*PutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Put not implemented") +} +func (UnimplementedStoreServer) BatchPut(context.Context, *BatchPutRequest) (*BatchPutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BatchPut not implemented") +} +func (UnimplementedStoreServer) CompareAndPut(context.Context, *CompareAndPutRequest) (*CompareAndPutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CompareAndPut not implemented") +} +func (UnimplementedStoreServer) DeleteRange(context.Context, *DeleteRangeRequest) (*DeleteRangeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteRange not implemented") +} +func (UnimplementedStoreServer) MoveValue(context.Context, *MoveValueRequest) (*MoveValueResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MoveValue not implemented") +} +func (UnimplementedStoreServer) mustEmbedUnimplementedStoreServer() {} + +// UnsafeStoreServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StoreServer will +// result in compilation errors. +type UnsafeStoreServer interface { + mustEmbedUnimplementedStoreServer() +} + +func RegisterStoreServer(s grpc.ServiceRegistrar, srv StoreServer) { + s.RegisterService(&Store_ServiceDesc, srv) +} + +func _Store_Range_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RangeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StoreServer).Range(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greptime.v1.meta.Store/Range", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreServer).Range(ctx, req.(*RangeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Store_Put_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StoreServer).Put(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greptime.v1.meta.Store/Put", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreServer).Put(ctx, req.(*PutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Store_BatchPut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchPutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StoreServer).BatchPut(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greptime.v1.meta.Store/BatchPut", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreServer).BatchPut(ctx, req.(*BatchPutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Store_CompareAndPut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CompareAndPutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StoreServer).CompareAndPut(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greptime.v1.meta.Store/CompareAndPut", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreServer).CompareAndPut(ctx, req.(*CompareAndPutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Store_DeleteRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRangeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StoreServer).DeleteRange(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greptime.v1.meta.Store/DeleteRange", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreServer).DeleteRange(ctx, req.(*DeleteRangeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Store_MoveValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MoveValueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StoreServer).MoveValue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/greptime.v1.meta.Store/MoveValue", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StoreServer).MoveValue(ctx, req.(*MoveValueRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Store_ServiceDesc is the grpc.ServiceDesc for Store service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Store_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "greptime.v1.meta.Store", + HandlerType: (*StoreServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Range", + Handler: _Store_Range_Handler, + }, + { + MethodName: "Put", + Handler: _Store_Put_Handler, + }, + { + MethodName: "BatchPut", + Handler: _Store_BatchPut_Handler, + }, + { + MethodName: "CompareAndPut", + Handler: _Store_CompareAndPut_Handler, + }, + { + MethodName: "DeleteRange", + Handler: _Store_DeleteRange_Handler, + }, + { + MethodName: "MoveValue", + Handler: _Store_MoveValue_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "greptime/v1/meta/store.proto", +} diff --git a/go/prometheus/remote/remote.pb.go b/go/prometheus/remote/remote.pb.go new file mode 100644 index 00000000..b797ea50 --- /dev/null +++ b/go/prometheus/remote/remote.pb.go @@ -0,0 +1,647 @@ +// Copyright 2016 Prometheus Team +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.7 +// source: prometheus/remote/remote.proto + +package remote + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ReadRequest_ResponseType int32 + +const ( + // Server will return a single ReadResponse message with matched series that includes list of raw samples. + // It's recommended to use streamed response types instead. + // + // Response headers: + // Content-Type: "application/x-protobuf" + // Content-Encoding: "snappy" + ReadRequest_SAMPLES ReadRequest_ResponseType = 0 + // Server will stream a delimited ChunkedReadResponse message that contains XOR encoded chunks for a single series. + // Each message is following varint size and fixed size bigendian uint32 for CRC32 Castagnoli checksum. + // + // Response headers: + // Content-Type: "application/x-streamed-protobuf; proto=prometheus.ChunkedReadResponse" + // Content-Encoding: "" + ReadRequest_STREAMED_XOR_CHUNKS ReadRequest_ResponseType = 1 +) + +// Enum value maps for ReadRequest_ResponseType. +var ( + ReadRequest_ResponseType_name = map[int32]string{ + 0: "SAMPLES", + 1: "STREAMED_XOR_CHUNKS", + } + ReadRequest_ResponseType_value = map[string]int32{ + "SAMPLES": 0, + "STREAMED_XOR_CHUNKS": 1, + } +) + +func (x ReadRequest_ResponseType) Enum() *ReadRequest_ResponseType { + p := new(ReadRequest_ResponseType) + *p = x + return p +} + +func (x ReadRequest_ResponseType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ReadRequest_ResponseType) Descriptor() protoreflect.EnumDescriptor { + return file_prometheus_remote_remote_proto_enumTypes[0].Descriptor() +} + +func (ReadRequest_ResponseType) Type() protoreflect.EnumType { + return &file_prometheus_remote_remote_proto_enumTypes[0] +} + +func (x ReadRequest_ResponseType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ReadRequest_ResponseType.Descriptor instead. +func (ReadRequest_ResponseType) EnumDescriptor() ([]byte, []int) { + return file_prometheus_remote_remote_proto_rawDescGZIP(), []int{1, 0} +} + +type WriteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timeseries []*TimeSeries `protobuf:"bytes,1,rep,name=timeseries,proto3" json:"timeseries,omitempty"` + Metadata []*MetricMetadata `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *WriteRequest) Reset() { + *x = WriteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_remote_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WriteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteRequest) ProtoMessage() {} + +func (x *WriteRequest) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_remote_proto_msgTypes[0] + 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 WriteRequest.ProtoReflect.Descriptor instead. +func (*WriteRequest) Descriptor() ([]byte, []int) { + return file_prometheus_remote_remote_proto_rawDescGZIP(), []int{0} +} + +func (x *WriteRequest) GetTimeseries() []*TimeSeries { + if x != nil { + return x.Timeseries + } + return nil +} + +func (x *WriteRequest) GetMetadata() []*MetricMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +// ReadRequest represents a remote read request. +type ReadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Queries []*Query `protobuf:"bytes,1,rep,name=queries,proto3" json:"queries,omitempty"` + // accepted_response_types allows negotiating the content type of the response. + // + // Response types are taken from the list in the FIFO order. If no response type in `accepted_response_types` is + // implemented by server, error is returned. + // For request that do not contain `accepted_response_types` field the SAMPLES response type will be used. + AcceptedResponseTypes []ReadRequest_ResponseType `protobuf:"varint,2,rep,packed,name=accepted_response_types,json=acceptedResponseTypes,proto3,enum=prometheus.ReadRequest_ResponseType" json:"accepted_response_types,omitempty"` +} + +func (x *ReadRequest) Reset() { + *x = ReadRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_remote_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadRequest) ProtoMessage() {} + +func (x *ReadRequest) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_remote_proto_msgTypes[1] + 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 ReadRequest.ProtoReflect.Descriptor instead. +func (*ReadRequest) Descriptor() ([]byte, []int) { + return file_prometheus_remote_remote_proto_rawDescGZIP(), []int{1} +} + +func (x *ReadRequest) GetQueries() []*Query { + if x != nil { + return x.Queries + } + return nil +} + +func (x *ReadRequest) GetAcceptedResponseTypes() []ReadRequest_ResponseType { + if x != nil { + return x.AcceptedResponseTypes + } + return nil +} + +// ReadResponse is a response when response_type equals SAMPLES. +type ReadResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // In same order as the request's queries. + Results []*QueryResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +} + +func (x *ReadResponse) Reset() { + *x = ReadResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_remote_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadResponse) ProtoMessage() {} + +func (x *ReadResponse) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_remote_proto_msgTypes[2] + 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 ReadResponse.ProtoReflect.Descriptor instead. +func (*ReadResponse) Descriptor() ([]byte, []int) { + return file_prometheus_remote_remote_proto_rawDescGZIP(), []int{2} +} + +func (x *ReadResponse) GetResults() []*QueryResult { + if x != nil { + return x.Results + } + return nil +} + +type Query struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartTimestampMs int64 `protobuf:"varint,1,opt,name=start_timestamp_ms,json=startTimestampMs,proto3" json:"start_timestamp_ms,omitempty"` + EndTimestampMs int64 `protobuf:"varint,2,opt,name=end_timestamp_ms,json=endTimestampMs,proto3" json:"end_timestamp_ms,omitempty"` + Matchers []*LabelMatcher `protobuf:"bytes,3,rep,name=matchers,proto3" json:"matchers,omitempty"` + Hints *ReadHints `protobuf:"bytes,4,opt,name=hints,proto3" json:"hints,omitempty"` +} + +func (x *Query) Reset() { + *x = Query{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_remote_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Query) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Query) ProtoMessage() {} + +func (x *Query) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_remote_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 Query.ProtoReflect.Descriptor instead. +func (*Query) Descriptor() ([]byte, []int) { + return file_prometheus_remote_remote_proto_rawDescGZIP(), []int{3} +} + +func (x *Query) GetStartTimestampMs() int64 { + if x != nil { + return x.StartTimestampMs + } + return 0 +} + +func (x *Query) GetEndTimestampMs() int64 { + if x != nil { + return x.EndTimestampMs + } + return 0 +} + +func (x *Query) GetMatchers() []*LabelMatcher { + if x != nil { + return x.Matchers + } + return nil +} + +func (x *Query) GetHints() *ReadHints { + if x != nil { + return x.Hints + } + return nil +} + +type QueryResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Samples within a time series must be ordered by time. + Timeseries []*TimeSeries `protobuf:"bytes,1,rep,name=timeseries,proto3" json:"timeseries,omitempty"` +} + +func (x *QueryResult) Reset() { + *x = QueryResult{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_remote_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryResult) ProtoMessage() {} + +func (x *QueryResult) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_remote_proto_msgTypes[4] + 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 QueryResult.ProtoReflect.Descriptor instead. +func (*QueryResult) Descriptor() ([]byte, []int) { + return file_prometheus_remote_remote_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryResult) GetTimeseries() []*TimeSeries { + if x != nil { + return x.Timeseries + } + return nil +} + +// ChunkedReadResponse is a response when response_type equals STREAMED_XOR_CHUNKS. +// We strictly stream full series after series, optionally split by time. This means that a single frame can contain +// partition of the single series, but once a new series is started to be streamed it means that no more chunks will +// be sent for previous one. Series are returned sorted in the same way TSDB block are internally. +type ChunkedReadResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChunkedSeries []*ChunkedSeries `protobuf:"bytes,1,rep,name=chunked_series,json=chunkedSeries,proto3" json:"chunked_series,omitempty"` + // query_index represents an index of the query from ReadRequest.queries these chunks relates to. + QueryIndex int64 `protobuf:"varint,2,opt,name=query_index,json=queryIndex,proto3" json:"query_index,omitempty"` +} + +func (x *ChunkedReadResponse) Reset() { + *x = ChunkedReadResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_remote_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChunkedReadResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChunkedReadResponse) ProtoMessage() {} + +func (x *ChunkedReadResponse) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_remote_proto_msgTypes[5] + 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 ChunkedReadResponse.ProtoReflect.Descriptor instead. +func (*ChunkedReadResponse) Descriptor() ([]byte, []int) { + return file_prometheus_remote_remote_proto_rawDescGZIP(), []int{5} +} + +func (x *ChunkedReadResponse) GetChunkedSeries() []*ChunkedSeries { + if x != nil { + return x.ChunkedSeries + } + return nil +} + +func (x *ChunkedReadResponse) GetQueryIndex() int64 { + if x != nil { + return x.QueryIndex + } + return 0 +} + +var File_prometheus_remote_remote_proto protoreflect.FileDescriptor + +var file_prometheus_remote_remote_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2f, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0a, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x1a, 0x1d, 0x70, 0x72, + 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x84, 0x01, 0x0a, 0x0c, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x0a, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x65, + 0x72, 0x69, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, + 0x65, 0x75, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4a, 0x04, 0x08, 0x02, + 0x10, 0x03, 0x22, 0xce, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, + 0x5c, 0x0a, 0x17, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, + 0x32, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x52, 0x65, + 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x15, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x34, 0x0a, + 0x0c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, + 0x07, 0x53, 0x41, 0x4d, 0x50, 0x4c, 0x45, 0x53, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x54, + 0x52, 0x45, 0x41, 0x4d, 0x45, 0x44, 0x5f, 0x58, 0x4f, 0x52, 0x5f, 0x43, 0x48, 0x55, 0x4e, 0x4b, + 0x53, 0x10, 0x01, 0x22, 0x41, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, + 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xc2, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x2c, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x73, 0x12, 0x28, + 0x0a, 0x10, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, + 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x73, 0x12, 0x34, 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, + 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x12, 0x2b, + 0x0a, 0x05, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x48, + 0x69, 0x6e, 0x74, 0x73, 0x52, 0x05, 0x68, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x45, 0x0a, 0x0b, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x36, 0x0a, 0x0a, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x69, + 0x65, 0x73, 0x22, 0x78, 0x0a, 0x13, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x61, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x63, 0x68, 0x75, + 0x6e, 0x6b, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x43, + 0x68, 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x0d, 0x63, 0x68, + 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x3d, 0x5a, 0x3b, + 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, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, + 0x68, 0x65, 0x75, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_prometheus_remote_remote_proto_rawDescOnce sync.Once + file_prometheus_remote_remote_proto_rawDescData = file_prometheus_remote_remote_proto_rawDesc +) + +func file_prometheus_remote_remote_proto_rawDescGZIP() []byte { + file_prometheus_remote_remote_proto_rawDescOnce.Do(func() { + file_prometheus_remote_remote_proto_rawDescData = protoimpl.X.CompressGZIP(file_prometheus_remote_remote_proto_rawDescData) + }) + return file_prometheus_remote_remote_proto_rawDescData +} + +var file_prometheus_remote_remote_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_prometheus_remote_remote_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_prometheus_remote_remote_proto_goTypes = []interface{}{ + (ReadRequest_ResponseType)(0), // 0: prometheus.ReadRequest.ResponseType + (*WriteRequest)(nil), // 1: prometheus.WriteRequest + (*ReadRequest)(nil), // 2: prometheus.ReadRequest + (*ReadResponse)(nil), // 3: prometheus.ReadResponse + (*Query)(nil), // 4: prometheus.Query + (*QueryResult)(nil), // 5: prometheus.QueryResult + (*ChunkedReadResponse)(nil), // 6: prometheus.ChunkedReadResponse + (*TimeSeries)(nil), // 7: prometheus.TimeSeries + (*MetricMetadata)(nil), // 8: prometheus.MetricMetadata + (*LabelMatcher)(nil), // 9: prometheus.LabelMatcher + (*ReadHints)(nil), // 10: prometheus.ReadHints + (*ChunkedSeries)(nil), // 11: prometheus.ChunkedSeries +} +var file_prometheus_remote_remote_proto_depIdxs = []int32{ + 7, // 0: prometheus.WriteRequest.timeseries:type_name -> prometheus.TimeSeries + 8, // 1: prometheus.WriteRequest.metadata:type_name -> prometheus.MetricMetadata + 4, // 2: prometheus.ReadRequest.queries:type_name -> prometheus.Query + 0, // 3: prometheus.ReadRequest.accepted_response_types:type_name -> prometheus.ReadRequest.ResponseType + 5, // 4: prometheus.ReadResponse.results:type_name -> prometheus.QueryResult + 9, // 5: prometheus.Query.matchers:type_name -> prometheus.LabelMatcher + 10, // 6: prometheus.Query.hints:type_name -> prometheus.ReadHints + 7, // 7: prometheus.QueryResult.timeseries:type_name -> prometheus.TimeSeries + 11, // 8: prometheus.ChunkedReadResponse.chunked_series:type_name -> prometheus.ChunkedSeries + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_prometheus_remote_remote_proto_init() } +func file_prometheus_remote_remote_proto_init() { + if File_prometheus_remote_remote_proto != nil { + return + } + file_prometheus_remote_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_prometheus_remote_remote_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WriteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_remote_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_remote_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_remote_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Query); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_remote_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_remote_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChunkedReadResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_prometheus_remote_remote_proto_rawDesc, + NumEnums: 1, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_prometheus_remote_remote_proto_goTypes, + DependencyIndexes: file_prometheus_remote_remote_proto_depIdxs, + EnumInfos: file_prometheus_remote_remote_proto_enumTypes, + MessageInfos: file_prometheus_remote_remote_proto_msgTypes, + }.Build() + File_prometheus_remote_remote_proto = out.File + file_prometheus_remote_remote_proto_rawDesc = nil + file_prometheus_remote_remote_proto_goTypes = nil + file_prometheus_remote_remote_proto_depIdxs = nil +} diff --git a/go/prometheus/remote/types.pb.go b/go/prometheus/remote/types.pb.go new file mode 100644 index 00000000..96a1f5f7 --- /dev/null +++ b/go/prometheus/remote/types.pb.go @@ -0,0 +1,1142 @@ +// Copyright 2017 Prometheus Team +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.7 +// source: prometheus/remote/types.proto + +package remote + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MetricMetadata_MetricType int32 + +const ( + MetricMetadata_UNKNOWN MetricMetadata_MetricType = 0 + MetricMetadata_COUNTER MetricMetadata_MetricType = 1 + MetricMetadata_GAUGE MetricMetadata_MetricType = 2 + MetricMetadata_HISTOGRAM MetricMetadata_MetricType = 3 + MetricMetadata_GAUGEHISTOGRAM MetricMetadata_MetricType = 4 + MetricMetadata_SUMMARY MetricMetadata_MetricType = 5 + MetricMetadata_INFO MetricMetadata_MetricType = 6 + MetricMetadata_STATESET MetricMetadata_MetricType = 7 +) + +// Enum value maps for MetricMetadata_MetricType. +var ( + MetricMetadata_MetricType_name = map[int32]string{ + 0: "UNKNOWN", + 1: "COUNTER", + 2: "GAUGE", + 3: "HISTOGRAM", + 4: "GAUGEHISTOGRAM", + 5: "SUMMARY", + 6: "INFO", + 7: "STATESET", + } + MetricMetadata_MetricType_value = map[string]int32{ + "UNKNOWN": 0, + "COUNTER": 1, + "GAUGE": 2, + "HISTOGRAM": 3, + "GAUGEHISTOGRAM": 4, + "SUMMARY": 5, + "INFO": 6, + "STATESET": 7, + } +) + +func (x MetricMetadata_MetricType) Enum() *MetricMetadata_MetricType { + p := new(MetricMetadata_MetricType) + *p = x + return p +} + +func (x MetricMetadata_MetricType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MetricMetadata_MetricType) Descriptor() protoreflect.EnumDescriptor { + return file_prometheus_remote_types_proto_enumTypes[0].Descriptor() +} + +func (MetricMetadata_MetricType) Type() protoreflect.EnumType { + return &file_prometheus_remote_types_proto_enumTypes[0] +} + +func (x MetricMetadata_MetricType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MetricMetadata_MetricType.Descriptor instead. +func (MetricMetadata_MetricType) EnumDescriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{0, 0} +} + +type LabelMatcher_Type int32 + +const ( + LabelMatcher_EQ LabelMatcher_Type = 0 + LabelMatcher_NEQ LabelMatcher_Type = 1 + LabelMatcher_RE LabelMatcher_Type = 2 + LabelMatcher_NRE LabelMatcher_Type = 3 +) + +// Enum value maps for LabelMatcher_Type. +var ( + LabelMatcher_Type_name = map[int32]string{ + 0: "EQ", + 1: "NEQ", + 2: "RE", + 3: "NRE", + } + LabelMatcher_Type_value = map[string]int32{ + "EQ": 0, + "NEQ": 1, + "RE": 2, + "NRE": 3, + } +) + +func (x LabelMatcher_Type) Enum() *LabelMatcher_Type { + p := new(LabelMatcher_Type) + *p = x + return p +} + +func (x LabelMatcher_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (LabelMatcher_Type) Descriptor() protoreflect.EnumDescriptor { + return file_prometheus_remote_types_proto_enumTypes[1].Descriptor() +} + +func (LabelMatcher_Type) Type() protoreflect.EnumType { + return &file_prometheus_remote_types_proto_enumTypes[1] +} + +func (x LabelMatcher_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use LabelMatcher_Type.Descriptor instead. +func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{6, 0} +} + +// We require this to match chunkenc.Encoding. +type Chunk_Encoding int32 + +const ( + Chunk_UNKNOWN Chunk_Encoding = 0 + Chunk_XOR Chunk_Encoding = 1 +) + +// Enum value maps for Chunk_Encoding. +var ( + Chunk_Encoding_name = map[int32]string{ + 0: "UNKNOWN", + 1: "XOR", + } + Chunk_Encoding_value = map[string]int32{ + "UNKNOWN": 0, + "XOR": 1, + } +) + +func (x Chunk_Encoding) Enum() *Chunk_Encoding { + p := new(Chunk_Encoding) + *p = x + return p +} + +func (x Chunk_Encoding) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Chunk_Encoding) Descriptor() protoreflect.EnumDescriptor { + return file_prometheus_remote_types_proto_enumTypes[2].Descriptor() +} + +func (Chunk_Encoding) Type() protoreflect.EnumType { + return &file_prometheus_remote_types_proto_enumTypes[2] +} + +func (x Chunk_Encoding) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Chunk_Encoding.Descriptor instead. +func (Chunk_Encoding) EnumDescriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{8, 0} +} + +type MetricMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Represents the metric type, these match the set from Prometheus. + // Refer to model/textparse/interface.go for details. + Type MetricMetadata_MetricType `protobuf:"varint,1,opt,name=type,proto3,enum=prometheus.MetricMetadata_MetricType" json:"type,omitempty"` + MetricFamilyName string `protobuf:"bytes,2,opt,name=metric_family_name,json=metricFamilyName,proto3" json:"metric_family_name,omitempty"` + Help string `protobuf:"bytes,4,opt,name=help,proto3" json:"help,omitempty"` + Unit string `protobuf:"bytes,5,opt,name=unit,proto3" json:"unit,omitempty"` +} + +func (x *MetricMetadata) Reset() { + *x = MetricMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MetricMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetricMetadata) ProtoMessage() {} + +func (x *MetricMetadata) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_types_proto_msgTypes[0] + 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 MetricMetadata.ProtoReflect.Descriptor instead. +func (*MetricMetadata) Descriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{0} +} + +func (x *MetricMetadata) GetType() MetricMetadata_MetricType { + if x != nil { + return x.Type + } + return MetricMetadata_UNKNOWN +} + +func (x *MetricMetadata) GetMetricFamilyName() string { + if x != nil { + return x.MetricFamilyName + } + return "" +} + +func (x *MetricMetadata) GetHelp() string { + if x != nil { + return x.Help + } + return "" +} + +func (x *MetricMetadata) GetUnit() string { + if x != nil { + return x.Unit + } + return "" +} + +type Sample struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` + // timestamp is in ms format, see model/timestamp/timestamp.go for + // conversion from time.Time to Prometheus timestamp. + Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *Sample) Reset() { + *x = Sample{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Sample) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Sample) ProtoMessage() {} + +func (x *Sample) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_types_proto_msgTypes[1] + 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 Sample.ProtoReflect.Descriptor instead. +func (*Sample) Descriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{1} +} + +func (x *Sample) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *Sample) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +type Exemplar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional, can be empty. + Labels []*Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` + // timestamp is in ms format, see model/timestamp/timestamp.go for + // conversion from time.Time to Prometheus timestamp. + Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *Exemplar) Reset() { + *x = Exemplar{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Exemplar) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Exemplar) ProtoMessage() {} + +func (x *Exemplar) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_types_proto_msgTypes[2] + 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 Exemplar.ProtoReflect.Descriptor instead. +func (*Exemplar) Descriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{2} +} + +func (x *Exemplar) GetLabels() []*Label { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Exemplar) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *Exemplar) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +// TimeSeries represents samples and labels for a single time series. +type TimeSeries struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // For a timeseries to be valid, and for the samples and exemplars + // to be ingested by the remote system properly, the labels field is required. + Labels []*Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + Samples []*Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples,omitempty"` + Exemplars []*Exemplar `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars,omitempty"` +} + +func (x *TimeSeries) Reset() { + *x = TimeSeries{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TimeSeries) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TimeSeries) ProtoMessage() {} + +func (x *TimeSeries) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_types_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 TimeSeries.ProtoReflect.Descriptor instead. +func (*TimeSeries) Descriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{3} +} + +func (x *TimeSeries) GetLabels() []*Label { + if x != nil { + return x.Labels + } + return nil +} + +func (x *TimeSeries) GetSamples() []*Sample { + if x != nil { + return x.Samples + } + return nil +} + +func (x *TimeSeries) GetExemplars() []*Exemplar { + if x != nil { + return x.Exemplars + } + return nil +} + +type Label struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Label) Reset() { + *x = Label{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Label) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Label) ProtoMessage() {} + +func (x *Label) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_types_proto_msgTypes[4] + 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 Label.ProtoReflect.Descriptor instead. +func (*Label) Descriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{4} +} + +func (x *Label) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Label) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type Labels struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Labels []*Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` +} + +func (x *Labels) Reset() { + *x = Labels{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_types_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Labels) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Labels) ProtoMessage() {} + +func (x *Labels) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_types_proto_msgTypes[5] + 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 Labels.ProtoReflect.Descriptor instead. +func (*Labels) Descriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{5} +} + +func (x *Labels) GetLabels() []*Label { + if x != nil { + return x.Labels + } + return nil +} + +// Matcher specifies a rule, which can match or set of labels or not. +type LabelMatcher struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type LabelMatcher_Type `protobuf:"varint,1,opt,name=type,proto3,enum=prometheus.LabelMatcher_Type" json:"type,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *LabelMatcher) Reset() { + *x = LabelMatcher{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_types_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LabelMatcher) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LabelMatcher) ProtoMessage() {} + +func (x *LabelMatcher) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_types_proto_msgTypes[6] + 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 LabelMatcher.ProtoReflect.Descriptor instead. +func (*LabelMatcher) Descriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{6} +} + +func (x *LabelMatcher) GetType() LabelMatcher_Type { + if x != nil { + return x.Type + } + return LabelMatcher_EQ +} + +func (x *LabelMatcher) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LabelMatcher) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type ReadHints struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StepMs int64 `protobuf:"varint,1,opt,name=step_ms,json=stepMs,proto3" json:"step_ms,omitempty"` // Query step size in milliseconds. + Func string `protobuf:"bytes,2,opt,name=func,proto3" json:"func,omitempty"` // String representation of surrounding function or aggregation. + StartMs int64 `protobuf:"varint,3,opt,name=start_ms,json=startMs,proto3" json:"start_ms,omitempty"` // Start time in milliseconds. + EndMs int64 `protobuf:"varint,4,opt,name=end_ms,json=endMs,proto3" json:"end_ms,omitempty"` // End time in milliseconds. + Grouping []string `protobuf:"bytes,5,rep,name=grouping,proto3" json:"grouping,omitempty"` // List of label names used in aggregation. + By bool `protobuf:"varint,6,opt,name=by,proto3" json:"by,omitempty"` // Indicate whether it is without or by. + RangeMs int64 `protobuf:"varint,7,opt,name=range_ms,json=rangeMs,proto3" json:"range_ms,omitempty"` // Range vector selector range in milliseconds. +} + +func (x *ReadHints) Reset() { + *x = ReadHints{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_types_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadHints) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadHints) ProtoMessage() {} + +func (x *ReadHints) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_types_proto_msgTypes[7] + 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 ReadHints.ProtoReflect.Descriptor instead. +func (*ReadHints) Descriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{7} +} + +func (x *ReadHints) GetStepMs() int64 { + if x != nil { + return x.StepMs + } + return 0 +} + +func (x *ReadHints) GetFunc() string { + if x != nil { + return x.Func + } + return "" +} + +func (x *ReadHints) GetStartMs() int64 { + if x != nil { + return x.StartMs + } + return 0 +} + +func (x *ReadHints) GetEndMs() int64 { + if x != nil { + return x.EndMs + } + return 0 +} + +func (x *ReadHints) GetGrouping() []string { + if x != nil { + return x.Grouping + } + return nil +} + +func (x *ReadHints) GetBy() bool { + if x != nil { + return x.By + } + return false +} + +func (x *ReadHints) GetRangeMs() int64 { + if x != nil { + return x.RangeMs + } + return 0 +} + +// Chunk represents a TSDB chunk. +// Time range [min, max] is inclusive. +type Chunk struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MinTimeMs int64 `protobuf:"varint,1,opt,name=min_time_ms,json=minTimeMs,proto3" json:"min_time_ms,omitempty"` + MaxTimeMs int64 `protobuf:"varint,2,opt,name=max_time_ms,json=maxTimeMs,proto3" json:"max_time_ms,omitempty"` + Type Chunk_Encoding `protobuf:"varint,3,opt,name=type,proto3,enum=prometheus.Chunk_Encoding" json:"type,omitempty"` + Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *Chunk) Reset() { + *x = Chunk{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_types_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Chunk) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Chunk) ProtoMessage() {} + +func (x *Chunk) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_types_proto_msgTypes[8] + 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 Chunk.ProtoReflect.Descriptor instead. +func (*Chunk) Descriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{8} +} + +func (x *Chunk) GetMinTimeMs() int64 { + if x != nil { + return x.MinTimeMs + } + return 0 +} + +func (x *Chunk) GetMaxTimeMs() int64 { + if x != nil { + return x.MaxTimeMs + } + return 0 +} + +func (x *Chunk) GetType() Chunk_Encoding { + if x != nil { + return x.Type + } + return Chunk_UNKNOWN +} + +func (x *Chunk) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// ChunkedSeries represents single, encoded time series. +type ChunkedSeries struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Labels should be sorted. + Labels []*Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + // Chunks will be in start time order and may overlap. + Chunks []*Chunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks,omitempty"` +} + +func (x *ChunkedSeries) Reset() { + *x = ChunkedSeries{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_types_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChunkedSeries) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChunkedSeries) ProtoMessage() {} + +func (x *ChunkedSeries) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_types_proto_msgTypes[9] + 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 ChunkedSeries.ProtoReflect.Descriptor instead. +func (*ChunkedSeries) Descriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{9} +} + +func (x *ChunkedSeries) GetLabels() []*Label { + if x != nil { + return x.Labels + } + return nil +} + +func (x *ChunkedSeries) GetChunks() []*Chunk { + if x != nil { + return x.Chunks + } + return nil +} + +var File_prometheus_remote_types_proto protoreflect.FileDescriptor + +var file_prometheus_remote_types_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2f, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x0a, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x22, 0x9c, 0x02, 0x0a, 0x0e, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x39, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x70, + 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x5f, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x46, 0x61, 0x6d, + 0x69, 0x6c, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x75, + 0x6e, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x22, + 0x79, 0x0a, 0x0a, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, + 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, + 0x55, 0x4e, 0x54, 0x45, 0x52, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x41, 0x55, 0x47, 0x45, + 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, + 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x47, 0x41, 0x55, 0x47, 0x45, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, + 0x52, 0x41, 0x4d, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x4d, 0x4d, 0x41, 0x52, 0x59, + 0x10, 0x05, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x06, 0x12, 0x0c, 0x0a, 0x08, + 0x53, 0x54, 0x41, 0x54, 0x45, 0x53, 0x45, 0x54, 0x10, 0x07, 0x22, 0x3c, 0x0a, 0x06, 0x53, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x69, 0x0a, 0x08, 0x45, 0x78, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x72, 0x12, 0x29, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, + 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x22, 0x99, 0x01, 0x0a, 0x0a, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, + 0x65, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x2c, 0x0a, + 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x53, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x52, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x09, 0x65, + 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x45, 0x78, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x72, 0x52, 0x09, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x22, + 0x31, 0x0a, 0x05, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x33, 0x0a, 0x06, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x29, 0x0a, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, + 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, + 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x95, 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, + 0x65, 0x75, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, + 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x28, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, + 0x02, 0x45, 0x51, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x45, 0x51, 0x10, 0x01, 0x12, 0x06, + 0x0a, 0x02, 0x52, 0x45, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x52, 0x45, 0x10, 0x03, 0x22, + 0xb1, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x61, 0x64, 0x48, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x0a, + 0x07, 0x73, 0x74, 0x65, 0x70, 0x5f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x73, 0x74, 0x65, 0x70, 0x4d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x5f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x4d, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x64, 0x5f, 0x6d, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x12, 0x1a, 0x0a, 0x08, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x62, 0x79, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x62, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x61, 0x6e, 0x67, + 0x65, 0x5f, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x72, 0x61, 0x6e, 0x67, + 0x65, 0x4d, 0x73, 0x22, 0xad, 0x01, 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x1e, 0x0a, + 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x4d, 0x73, 0x12, 0x1e, 0x0a, + 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x4d, 0x73, 0x12, 0x2e, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x70, 0x72, + 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x2e, 0x45, + 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x22, 0x20, 0x0a, 0x08, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x0b, 0x0a, + 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x58, 0x4f, + 0x52, 0x10, 0x01, 0x22, 0x65, 0x0a, 0x0d, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x53, 0x65, + 0x72, 0x69, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, + 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, + 0x29, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x43, 0x68, 0x75, + 0x6e, 0x6b, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x42, 0x3d, 0x5a, 0x3b, 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, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, + 0x75, 0x73, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_prometheus_remote_types_proto_rawDescOnce sync.Once + file_prometheus_remote_types_proto_rawDescData = file_prometheus_remote_types_proto_rawDesc +) + +func file_prometheus_remote_types_proto_rawDescGZIP() []byte { + file_prometheus_remote_types_proto_rawDescOnce.Do(func() { + file_prometheus_remote_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_prometheus_remote_types_proto_rawDescData) + }) + return file_prometheus_remote_types_proto_rawDescData +} + +var file_prometheus_remote_types_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_prometheus_remote_types_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_prometheus_remote_types_proto_goTypes = []interface{}{ + (MetricMetadata_MetricType)(0), // 0: prometheus.MetricMetadata.MetricType + (LabelMatcher_Type)(0), // 1: prometheus.LabelMatcher.Type + (Chunk_Encoding)(0), // 2: prometheus.Chunk.Encoding + (*MetricMetadata)(nil), // 3: prometheus.MetricMetadata + (*Sample)(nil), // 4: prometheus.Sample + (*Exemplar)(nil), // 5: prometheus.Exemplar + (*TimeSeries)(nil), // 6: prometheus.TimeSeries + (*Label)(nil), // 7: prometheus.Label + (*Labels)(nil), // 8: prometheus.Labels + (*LabelMatcher)(nil), // 9: prometheus.LabelMatcher + (*ReadHints)(nil), // 10: prometheus.ReadHints + (*Chunk)(nil), // 11: prometheus.Chunk + (*ChunkedSeries)(nil), // 12: prometheus.ChunkedSeries +} +var file_prometheus_remote_types_proto_depIdxs = []int32{ + 0, // 0: prometheus.MetricMetadata.type:type_name -> prometheus.MetricMetadata.MetricType + 7, // 1: prometheus.Exemplar.labels:type_name -> prometheus.Label + 7, // 2: prometheus.TimeSeries.labels:type_name -> prometheus.Label + 4, // 3: prometheus.TimeSeries.samples:type_name -> prometheus.Sample + 5, // 4: prometheus.TimeSeries.exemplars:type_name -> prometheus.Exemplar + 7, // 5: prometheus.Labels.labels:type_name -> prometheus.Label + 1, // 6: prometheus.LabelMatcher.type:type_name -> prometheus.LabelMatcher.Type + 2, // 7: prometheus.Chunk.type:type_name -> prometheus.Chunk.Encoding + 7, // 8: prometheus.ChunkedSeries.labels:type_name -> prometheus.Label + 11, // 9: prometheus.ChunkedSeries.chunks:type_name -> prometheus.Chunk + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] 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 +} + +func init() { file_prometheus_remote_types_proto_init() } +func file_prometheus_remote_types_proto_init() { + if File_prometheus_remote_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_prometheus_remote_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MetricMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Sample); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Exemplar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TimeSeries); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Label); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Labels); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LabelMatcher); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadHints); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Chunk); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_types_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChunkedSeries); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_prometheus_remote_types_proto_rawDesc, + NumEnums: 3, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_prometheus_remote_types_proto_goTypes, + DependencyIndexes: file_prometheus_remote_types_proto_depIdxs, + EnumInfos: file_prometheus_remote_types_proto_enumTypes, + MessageInfos: file_prometheus_remote_types_proto_msgTypes, + }.Build() + File_prometheus_remote_types_proto = out.File + file_prometheus_remote_types_proto_rawDesc = nil + file_prometheus_remote_types_proto_goTypes = nil + file_prometheus_remote_types_proto_depIdxs = nil +} diff --git a/proto/greptime/v1/column.proto b/proto/greptime/v1/column.proto index f67cf8dc..e32b69a4 100644 --- a/proto/greptime/v1/column.proto +++ b/proto/greptime/v1/column.proto @@ -4,6 +4,7 @@ package greptime.v1; option java_package="io.greptime.v1"; option java_outer_classname = "Columns"; +option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1"; message Column { string column_name = 1; diff --git a/proto/greptime/v1/database.proto b/proto/greptime/v1/database.proto index c4e6e807..e1f35519 100644 --- a/proto/greptime/v1/database.proto +++ b/proto/greptime/v1/database.proto @@ -4,6 +4,7 @@ package greptime.v1; option java_package = "io.greptime.v1"; option java_outer_classname = "Database"; +option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1"; import "greptime/v1/ddl.proto"; import "greptime/v1/column.proto"; diff --git a/proto/greptime/v1/ddl.proto b/proto/greptime/v1/ddl.proto index fddc486d..fce57d7f 100644 --- a/proto/greptime/v1/ddl.proto +++ b/proto/greptime/v1/ddl.proto @@ -4,6 +4,7 @@ package greptime.v1; option java_package = "io.greptime.v1"; option java_outer_classname = "Ddl"; +option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1"; import "greptime/v1/column.proto"; diff --git a/proto/greptime/v1/meta/cluster.proto b/proto/greptime/v1/meta/cluster.proto index 7bacb0b1..840d6b5a 100644 --- a/proto/greptime/v1/meta/cluster.proto +++ b/proto/greptime/v1/meta/cluster.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package greptime.v1.meta; +option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; + import "greptime/v1/meta/common.proto"; import "greptime/v1/meta/store.proto"; diff --git a/proto/greptime/v1/meta/common.proto b/proto/greptime/v1/meta/common.proto index af0fcd47..13f7322a 100644 --- a/proto/greptime/v1/meta/common.proto +++ b/proto/greptime/v1/meta/common.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package greptime.v1.meta; +option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; + message RequestHeader { uint64 protocol_version = 1; // cluster_id is the ID of the cluster which be sent to. diff --git a/proto/greptime/v1/meta/heartbeat.proto b/proto/greptime/v1/meta/heartbeat.proto index 91a8bcae..41b28cda 100644 --- a/proto/greptime/v1/meta/heartbeat.proto +++ b/proto/greptime/v1/meta/heartbeat.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package greptime.v1.meta; +option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; + import "greptime/v1/meta/common.proto"; service Heartbeat { diff --git a/proto/greptime/v1/meta/lock.proto b/proto/greptime/v1/meta/lock.proto index 5c95995a..be143a31 100644 --- a/proto/greptime/v1/meta/lock.proto +++ b/proto/greptime/v1/meta/lock.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package greptime.v1.meta; +option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; + import "greptime/v1/meta/common.proto"; service Lock { diff --git a/proto/greptime/v1/meta/route.proto b/proto/greptime/v1/meta/route.proto index 1b1cc675..7eaf3e25 100644 --- a/proto/greptime/v1/meta/route.proto +++ b/proto/greptime/v1/meta/route.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package greptime.v1.meta; +option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; + import "greptime/v1/meta/common.proto"; service Router { diff --git a/proto/greptime/v1/meta/store.proto b/proto/greptime/v1/meta/store.proto index cd951f45..1b62fcc4 100644 --- a/proto/greptime/v1/meta/store.proto +++ b/proto/greptime/v1/meta/store.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package greptime.v1.meta; +option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; + import "greptime/v1/meta/common.proto"; service Store { diff --git a/proto/prometheus/remote/remote.proto b/proto/prometheus/remote/remote.proto index 623f3630..97f541a3 100644 --- a/proto/prometheus/remote/remote.proto +++ b/proto/prometheus/remote/remote.proto @@ -14,7 +14,7 @@ syntax = "proto3"; package prometheus; -option go_package = "prompb"; +option go_package = "github.com/GreptimeTeam/greptime-proto/go/prometheus/remote"; import "prometheus/remote/types.proto"; diff --git a/proto/prometheus/remote/types.proto b/proto/prometheus/remote/types.proto index 0d17e88d..3a86ceb9 100644 --- a/proto/prometheus/remote/types.proto +++ b/proto/prometheus/remote/types.proto @@ -14,7 +14,7 @@ syntax = "proto3"; package prometheus; -option go_package = "prompb"; +option go_package = "github.com/GreptimeTeam/greptime-proto/go/prometheus/remote"; message MetricMetadata { enum MetricType { diff --git a/scripts/generate-go.sh b/scripts/generate-go.sh new file mode 100755 index 00000000..94e9f9fd --- /dev/null +++ b/scripts/generate-go.sh @@ -0,0 +1,24 @@ +#! /usr/bin/env bash + +set -e + +PROTOC=./bin/protoc/bin/protoc +GO_OUTPUT=./go + +if ! [ -f "${PROTOC}" ]; then + echo "${PROTOC} not found! Please run scripts/install-protoc.sh first." + exit 1 +fi + +# TODO(zyy17): Can we make the following commands as one command? +${PROTOC} --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \ + --go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \ + -Iproto proto/greptime/v1/meta/*.proto + +${PROTOC} --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \ + --go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \ + -Iproto proto/greptime/v1/*.proto + +${PROTOC} --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \ + --go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \ + -Iproto proto/prometheus/remote/*.proto diff --git a/scripts/install-protobuf-go-plugins.sh b/scripts/install-protobuf-go-plugins.sh new file mode 100755 index 00000000..68a5a284 --- /dev/null +++ b/scripts/install-protobuf-go-plugins.sh @@ -0,0 +1,11 @@ +#! /usr/bin/env bash + +set -e + +PROTOC_GEN_GO_VERSION=v1.28.1 +PROTOC_GEN_GO_GRPC_VERSION=v1.2.0 + +# Install protoc-gen-go and protoc-gen-go-grpc. +# Reference: https://grpc.io/docs/languages/go/quickstart/. +go install google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOC_GEN_GO_VERSION} +go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION} diff --git a/scripts/install-protoc.sh b/scripts/install-protoc.sh new file mode 100755 index 00000000..9f79dc55 --- /dev/null +++ b/scripts/install-protoc.sh @@ -0,0 +1,43 @@ +#! /usr/bin/env bash + +set -e + +# Install protoc +LOCAL_DIR=bin +PROTOC_VERSION=21.7 +DOWNLOAD_URL=https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION} + +# Create a directory to store the downloaded files. +if [ ! -d ${LOCAL_DIR} ]; then + mkdir ${LOCAL_DIR} +fi + +if [ -f "${LOCAL_DIR}/protoc/bin/protoc" ]; then + echo "The protoc is already installed, skip the installation!" + exit 0 +fi + +# Install protoc in macOS +if [ "$(uname)" == "Darwin" ]; then + if [ "$(arch)" == "arm64" ]; then + echo "Downloading macOS protoc ${PROTOC_VERSION} for arm64" + curl ${DOWNLOAD_URL}/protoc-${PROTOC_VERSION}-osx-aarch_64.zip -o ${LOCAL_DIR}/protoc.zip -L + else + echo "Downloading macOS protoc ${PROTOC_VERSION} for x86_64" + curl ${DOWNLOAD_URL}/protoc-${PROTOC_VERSION}-osx-x86_64.zip -o ${LOCAL_DIR}/protoc.zip -L + fi +elif [ "$(uname -s)" == "Linux" ]; then + if [ "$(uname -m)" == "aarch64" ]; then + echo "Downloading Linux protoc ${PROTOC_VERSION} for arm64" + curl ${DOWNLOAD_URL}/protoc-${PROTOC_VERSION}-linux-aarch_64.zip -o ${LOCAL_DIR}/protoc.zip -L + else + echo "Downloading Linux protoc ${PROTOC_VERSION} for x86_64" + curl ${DOWNLOAD_URL}/protoc-${PROTOC_VERSION}-linux-x86_64.zip -o ${LOCAL_DIR}/protoc.zip -L + fi +else + echo "Unsupported platform" + exit 1 +fi + +echo "Unzipping protoc..." +unzip ${LOCAL_DIR}/protoc.zip -d ${LOCAL_DIR}/protoc From 67a5dc878e41ec60542909d91108f2d7797ec79e Mon Sep 17 00:00:00 2001 From: zyy17 Date: Tue, 14 Feb 2023 19:50:26 +0800 Subject: [PATCH 2/6] ci: check go protbuf generation --- .github/workflows/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 13bb9f0d..d8ad7bfd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,6 +26,10 @@ jobs: timeout-minutes: 60 steps: - uses: actions/checkout@v3 + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: "1.18.4" - uses: arduino/setup-protoc@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} @@ -36,6 +40,10 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Run cargo check run: cargo check --workspace --all-targets + - name: Check Go protbuf generation + run: | + make go + git diff --exit-code fmt: name: Rustfmt From e6e5518eccb2ab099a335826dc7cbd1c6e2a71eb Mon Sep 17 00:00:00 2001 From: zyy17 Date: Tue, 14 Feb 2023 20:25:03 +0800 Subject: [PATCH 3/6] refactor: use 'namely/protoc-all:1.51_1' to compile the proto instead of locally binary --- Makefile | 19 +++----- README.md | 10 +---- go/greptime/v1/column.pb.go | 13 +++--- go/greptime/v1/database.pb.go | 4 +- go/greptime/v1/ddl.pb.go | 6 ++- go/greptime/v1/meta/cluster.pb.go | 2 +- go/greptime/v1/meta/cluster_grpc.pb.go | 2 +- go/greptime/v1/meta/common.pb.go | 2 +- go/greptime/v1/meta/heartbeat.pb.go | 2 +- go/greptime/v1/meta/heartbeat_grpc.pb.go | 2 +- go/greptime/v1/meta/lock.pb.go | 2 +- go/greptime/v1/meta/lock_grpc.pb.go | 2 +- go/greptime/v1/meta/route.pb.go | 2 +- go/greptime/v1/meta/route_grpc.pb.go | 56 +++++++++++++----------- go/greptime/v1/meta/store.pb.go | 2 +- go/greptime/v1/meta/store_grpc.pb.go | 2 +- go/prometheus/remote/remote.pb.go | 2 +- go/prometheus/remote/types.pb.go | 2 +- scripts/generate-go.sh | 24 ++++------ scripts/install-protobuf-go-plugins.sh | 11 ----- scripts/install-protoc.sh | 43 ------------------ 21 files changed, 74 insertions(+), 136 deletions(-) delete mode 100755 scripts/install-protobuf-go-plugins.sh delete mode 100755 scripts/install-protoc.sh diff --git a/Makefile b/Makefile index 544f4265..f9b94617 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,16 @@ -.PHONY: all rust go go-deps install-protoc clean +.PHONY: all rust go go-deps + +BUILDER_CONTAINER=namely/protoc-all:1.51_1 all: rust go rust: cargo build -go: install-protoc install-protobuf-go-plugins go-deps - ./scripts/generate-go.sh +go: go-deps + docker run -t -w /greptime-proto \ + --entrypoint ./scripts/generate-go.sh \ + -v ${PWD}:/greptime-proto ${BUILDER_CONTAINER} go-deps: go mod download - -install-protoc: - ./scripts/install-protoc.sh - -install-protobuf-go-plugins: - ./scripts/install-protobuf-go-plugins.sh - -clean: - rm -rf bin diff --git a/README.md b/README.md index 5006830f..db5dadd5 100644 --- a/README.md +++ b/README.md @@ -22,15 +22,7 @@ GreptimeDB protobuf files. make go ``` - The compilation will install `protoc`/ `protoc-gen-go` / `protoc-gen-go-grpc` locally. - -- **Install protoc locally** - - ```console - make install-protoc - ``` - - Then the `protoc` will install in `./bin/`. + The compilation will use builder container `namely/protoc-all`. ## Usage diff --git a/go/greptime/v1/column.pb.go b/go/greptime/v1/column.pb.go index 0d1af94d..e70122f3 100644 --- a/go/greptime/v1/column.pb.go +++ b/go/greptime/v1/column.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.7 +// protoc v3.21.6 // source: greptime/v1/column.proto package v1 @@ -176,11 +176,12 @@ type Column struct { // The array of non-null values in this column. // // For example: suppose there is a column "foo" that contains some int32 values (1, 2, 3, 4, 5, null, 7, 8, 9, null); - // column: - // column_name: foo - // semantic_type: Tag - // values: 1, 2, 3, 4, 5, 7, 8, 9 - // null_masks: 00100000 00000010 + // + // column: + // column_name: foo + // semantic_type: Tag + // values: 1, 2, 3, 4, 5, 7, 8, 9 + // null_masks: 00100000 00000010 Values *Column_Values `protobuf:"bytes,3,opt,name=values,proto3" json:"values,omitempty"` // Mask maps the positions of null values. // If a bit in null_mask is 1, it indicates that the column value at that position is null. diff --git a/go/greptime/v1/database.pb.go b/go/greptime/v1/database.pb.go index d6aa0c7b..6c79a8b6 100644 --- a/go/greptime/v1/database.pb.go +++ b/go/greptime/v1/database.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.7 +// protoc v3.21.6 // source: greptime/v1/database.proto package v1 @@ -84,6 +84,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_Query // *GreptimeRequest_Ddl @@ -185,6 +186,7 @@ type QueryRequest struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Query: + // // *QueryRequest_Sql // *QueryRequest_LogicalPlan Query isQueryRequest_Query `protobuf_oneof:"query"` diff --git a/go/greptime/v1/ddl.pb.go b/go/greptime/v1/ddl.pb.go index b1445c5a..ac510989 100644 --- a/go/greptime/v1/ddl.pb.go +++ b/go/greptime/v1/ddl.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.7 +// protoc v3.21.6 // source: greptime/v1/ddl.proto package v1 @@ -29,6 +29,7 @@ type DdlRequest struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Expr: + // // *DdlRequest_CreateDatabase // *DdlRequest_CreateTable // *DdlRequest_Alter @@ -267,6 +268,7 @@ type AlterExpr struct { SchemaName string `protobuf:"bytes,2,opt,name=schema_name,json=schemaName,proto3" json:"schema_name,omitempty"` TableName string `protobuf:"bytes,3,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` // Types that are assignable to Kind: + // // *AlterExpr_AddColumns // *AlterExpr_DropColumns // *AlterExpr_RenameTable @@ -444,7 +446,7 @@ type CreateDatabaseExpr struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - //TODO(hl): maybe rename to schema_name? + // TODO(hl): maybe rename to schema_name? DatabaseName string `protobuf:"bytes,1,opt,name=database_name,json=databaseName,proto3" json:"database_name,omitempty"` CreateIfNotExists bool `protobuf:"varint,2,opt,name=create_if_not_exists,json=createIfNotExists,proto3" json:"create_if_not_exists,omitempty"` } diff --git a/go/greptime/v1/meta/cluster.pb.go b/go/greptime/v1/meta/cluster.pb.go index 46b5d174..c77e4939 100644 --- a/go/greptime/v1/meta/cluster.pb.go +++ b/go/greptime/v1/meta/cluster.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.7 +// protoc v3.21.6 // source: greptime/v1/meta/cluster.proto package meta diff --git a/go/greptime/v1/meta/cluster_grpc.pb.go b/go/greptime/v1/meta/cluster_grpc.pb.go index a78c2aee..0d698610 100644 --- a/go/greptime/v1/meta/cluster_grpc.pb.go +++ b/go/greptime/v1/meta/cluster_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.7 +// - protoc v3.21.6 // source: greptime/v1/meta/cluster.proto package meta diff --git a/go/greptime/v1/meta/common.pb.go b/go/greptime/v1/meta/common.pb.go index 82c63681..361f3383 100644 --- a/go/greptime/v1/meta/common.pb.go +++ b/go/greptime/v1/meta/common.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.7 +// protoc v3.21.6 // source: greptime/v1/meta/common.proto package meta diff --git a/go/greptime/v1/meta/heartbeat.pb.go b/go/greptime/v1/meta/heartbeat.pb.go index ba3fca3b..51713ff8 100644 --- a/go/greptime/v1/meta/heartbeat.pb.go +++ b/go/greptime/v1/meta/heartbeat.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.7 +// protoc v3.21.6 // source: greptime/v1/meta/heartbeat.proto package meta diff --git a/go/greptime/v1/meta/heartbeat_grpc.pb.go b/go/greptime/v1/meta/heartbeat_grpc.pb.go index ad2c918f..814728d1 100644 --- a/go/greptime/v1/meta/heartbeat_grpc.pb.go +++ b/go/greptime/v1/meta/heartbeat_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.7 +// - protoc v3.21.6 // source: greptime/v1/meta/heartbeat.proto package meta diff --git a/go/greptime/v1/meta/lock.pb.go b/go/greptime/v1/meta/lock.pb.go index 5b0c1a42..1ae6c13e 100644 --- a/go/greptime/v1/meta/lock.pb.go +++ b/go/greptime/v1/meta/lock.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.7 +// protoc v3.21.6 // source: greptime/v1/meta/lock.proto package meta diff --git a/go/greptime/v1/meta/lock_grpc.pb.go b/go/greptime/v1/meta/lock_grpc.pb.go index 0497310b..775babd4 100644 --- a/go/greptime/v1/meta/lock_grpc.pb.go +++ b/go/greptime/v1/meta/lock_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.7 +// - protoc v3.21.6 // source: greptime/v1/meta/lock.proto package meta diff --git a/go/greptime/v1/meta/route.pb.go b/go/greptime/v1/meta/route.pb.go index ee9cba79..0a572173 100644 --- a/go/greptime/v1/meta/route.pb.go +++ b/go/greptime/v1/meta/route.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.7 +// protoc v3.21.6 // source: greptime/v1/meta/route.proto package meta diff --git a/go/greptime/v1/meta/route_grpc.pb.go b/go/greptime/v1/meta/route_grpc.pb.go index b838c420..7d67a383 100644 --- a/go/greptime/v1/meta/route_grpc.pb.go +++ b/go/greptime/v1/meta/route_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.7 +// - protoc v3.21.6 // source: greptime/v1/meta/route.proto package meta @@ -28,20 +28,23 @@ type RouterClient interface { // // ```text // table_1 - // table_name - // table_schema - // regions - // region_1 - // leader_peer - // follower_peer_1, follower_peer_2 - // region_2 - // leader_peer - // follower_peer_1, follower_peer_2, follower_peer_3 - // region_xxx + // + // table_name + // table_schema + // regions + // region_1 + // leader_peer + // follower_peer_1, follower_peer_2 + // region_2 + // leader_peer + // follower_peer_1, follower_peer_2, follower_peer_3 + // region_xxx + // // table_2 - // ... - // ``` // + // ... + // + // ``` Route(ctx context.Context, in *RouteRequest, opts ...grpc.CallOption) (*RouteResponse, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*RouteResponse, error) } @@ -91,20 +94,23 @@ type RouterServer interface { // // ```text // table_1 - // table_name - // table_schema - // regions - // region_1 - // leader_peer - // follower_peer_1, follower_peer_2 - // region_2 - // leader_peer - // follower_peer_1, follower_peer_2, follower_peer_3 - // region_xxx + // + // table_name + // table_schema + // regions + // region_1 + // leader_peer + // follower_peer_1, follower_peer_2 + // region_2 + // leader_peer + // follower_peer_1, follower_peer_2, follower_peer_3 + // region_xxx + // // table_2 - // ... - // ``` // + // ... + // + // ``` Route(context.Context, *RouteRequest) (*RouteResponse, error) Delete(context.Context, *DeleteRequest) (*RouteResponse, error) mustEmbedUnimplementedRouterServer() diff --git a/go/greptime/v1/meta/store.pb.go b/go/greptime/v1/meta/store.pb.go index 7e35489f..59c89563 100644 --- a/go/greptime/v1/meta/store.pb.go +++ b/go/greptime/v1/meta/store.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.7 +// protoc v3.21.6 // source: greptime/v1/meta/store.proto package meta diff --git a/go/greptime/v1/meta/store_grpc.pb.go b/go/greptime/v1/meta/store_grpc.pb.go index f490cc0b..acd9b74a 100644 --- a/go/greptime/v1/meta/store_grpc.pb.go +++ b/go/greptime/v1/meta/store_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.7 +// - protoc v3.21.6 // source: greptime/v1/meta/store.proto package meta diff --git a/go/prometheus/remote/remote.pb.go b/go/prometheus/remote/remote.pb.go index b797ea50..191b3f94 100644 --- a/go/prometheus/remote/remote.pb.go +++ b/go/prometheus/remote/remote.pb.go @@ -14,7 +14,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.7 +// protoc v3.21.6 // source: prometheus/remote/remote.proto package remote diff --git a/go/prometheus/remote/types.pb.go b/go/prometheus/remote/types.pb.go index 96a1f5f7..0351f4a8 100644 --- a/go/prometheus/remote/types.pb.go +++ b/go/prometheus/remote/types.pb.go @@ -14,7 +14,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.7 +// protoc v3.21.6 // source: prometheus/remote/types.proto package remote diff --git a/scripts/generate-go.sh b/scripts/generate-go.sh index 94e9f9fd..06974e0c 100755 --- a/scripts/generate-go.sh +++ b/scripts/generate-go.sh @@ -2,23 +2,17 @@ set -e -PROTOC=./bin/protoc/bin/protoc GO_OUTPUT=./go -if ! [ -f "${PROTOC}" ]; then - echo "${PROTOC} not found! Please run scripts/install-protoc.sh first." - exit 1 -fi - # TODO(zyy17): Can we make the following commands as one command? -${PROTOC} --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \ - --go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \ - -Iproto proto/greptime/v1/meta/*.proto +protoc --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \ + --go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \ + -Iproto proto/greptime/v1/meta/*.proto -${PROTOC} --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \ - --go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \ - -Iproto proto/greptime/v1/*.proto +protoc --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \ + --go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \ + -Iproto proto/greptime/v1/*.proto -${PROTOC} --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \ - --go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \ - -Iproto proto/prometheus/remote/*.proto +protoc --go_out=${GO_OUTPUT} --go_opt=paths=source_relative \ + --go-grpc_out=${GO_OUTPUT} --go-grpc_opt=paths=source_relative \ + -Iproto proto/prometheus/remote/*.proto diff --git a/scripts/install-protobuf-go-plugins.sh b/scripts/install-protobuf-go-plugins.sh deleted file mode 100755 index 68a5a284..00000000 --- a/scripts/install-protobuf-go-plugins.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /usr/bin/env bash - -set -e - -PROTOC_GEN_GO_VERSION=v1.28.1 -PROTOC_GEN_GO_GRPC_VERSION=v1.2.0 - -# Install protoc-gen-go and protoc-gen-go-grpc. -# Reference: https://grpc.io/docs/languages/go/quickstart/. -go install google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOC_GEN_GO_VERSION} -go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION} diff --git a/scripts/install-protoc.sh b/scripts/install-protoc.sh deleted file mode 100755 index 9f79dc55..00000000 --- a/scripts/install-protoc.sh +++ /dev/null @@ -1,43 +0,0 @@ -#! /usr/bin/env bash - -set -e - -# Install protoc -LOCAL_DIR=bin -PROTOC_VERSION=21.7 -DOWNLOAD_URL=https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION} - -# Create a directory to store the downloaded files. -if [ ! -d ${LOCAL_DIR} ]; then - mkdir ${LOCAL_DIR} -fi - -if [ -f "${LOCAL_DIR}/protoc/bin/protoc" ]; then - echo "The protoc is already installed, skip the installation!" - exit 0 -fi - -# Install protoc in macOS -if [ "$(uname)" == "Darwin" ]; then - if [ "$(arch)" == "arm64" ]; then - echo "Downloading macOS protoc ${PROTOC_VERSION} for arm64" - curl ${DOWNLOAD_URL}/protoc-${PROTOC_VERSION}-osx-aarch_64.zip -o ${LOCAL_DIR}/protoc.zip -L - else - echo "Downloading macOS protoc ${PROTOC_VERSION} for x86_64" - curl ${DOWNLOAD_URL}/protoc-${PROTOC_VERSION}-osx-x86_64.zip -o ${LOCAL_DIR}/protoc.zip -L - fi -elif [ "$(uname -s)" == "Linux" ]; then - if [ "$(uname -m)" == "aarch64" ]; then - echo "Downloading Linux protoc ${PROTOC_VERSION} for arm64" - curl ${DOWNLOAD_URL}/protoc-${PROTOC_VERSION}-linux-aarch_64.zip -o ${LOCAL_DIR}/protoc.zip -L - else - echo "Downloading Linux protoc ${PROTOC_VERSION} for x86_64" - curl ${DOWNLOAD_URL}/protoc-${PROTOC_VERSION}-linux-x86_64.zip -o ${LOCAL_DIR}/protoc.zip -L - fi -else - echo "Unsupported platform" - exit 1 -fi - -echo "Unzipping protoc..." -unzip ${LOCAL_DIR}/protoc.zip -d ${LOCAL_DIR}/protoc From 1c351d1d855253fbc4bd83bb0b3c36117791a8ef Mon Sep 17 00:00:00 2001 From: zyy17 Date: Tue, 14 Feb 2023 20:29:26 +0800 Subject: [PATCH 4/6] refactor: no need to add the 'bin/' igore --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1dd7e771..088ba6ba 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,3 @@ Cargo.lock # These are backup files generated by rustfmt **/*.rs.bk - -bin/ From 55cfbd9286690b3e16c4b0bb571f858bde128118 Mon Sep 17 00:00:00 2001 From: zyy17 Date: Tue, 14 Feb 2023 20:32:44 +0800 Subject: [PATCH 5/6] chore: modify code format --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f9b94617..4e85b269 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,8 @@ rust: go: go-deps docker run -t -w /greptime-proto \ - --entrypoint ./scripts/generate-go.sh \ - -v ${PWD}:/greptime-proto ${BUILDER_CONTAINER} + --entrypoint ./scripts/generate-go.sh \ + -v ${PWD}:/greptime-proto ${BUILDER_CONTAINER} go-deps: go mod download From fcd77147b40aebe7ea52f60e5492dd9f67f7dcba Mon Sep 17 00:00:00 2001 From: zyy17 Date: Wed, 15 Feb 2023 14:52:24 +0800 Subject: [PATCH 6/6] refactor: add some comments to describe our modification --- proto/prometheus/remote/remote.proto | 2 ++ proto/prometheus/remote/types.proto | 2 ++ 2 files changed, 4 insertions(+) diff --git a/proto/prometheus/remote/remote.proto b/proto/prometheus/remote/remote.proto index 97f541a3..9d84d51a 100644 --- a/proto/prometheus/remote/remote.proto +++ b/proto/prometheus/remote/remote.proto @@ -14,6 +14,8 @@ syntax = "proto3"; package prometheus; +// GreptimeTeam modify the original go_package definition to make it constistent with the go package name. +// And we also remove the gogoproto dependency which is now deprecated. option go_package = "github.com/GreptimeTeam/greptime-proto/go/prometheus/remote"; import "prometheus/remote/types.proto"; diff --git a/proto/prometheus/remote/types.proto b/proto/prometheus/remote/types.proto index 3a86ceb9..78feeaf3 100644 --- a/proto/prometheus/remote/types.proto +++ b/proto/prometheus/remote/types.proto @@ -14,6 +14,8 @@ syntax = "proto3"; package prometheus; +// GreptimeTeam modify the original go_package definition to make it constistent with the go package name. +// And we also remove the gogoproto dependency which is now deprecated. option go_package = "github.com/GreptimeTeam/greptime-proto/go/prometheus/remote"; message MetricMetadata {