feat: region lease (#49)

* feat: region lease

* feat: region lease

* feat: region lease
This commit is contained in:
LFC
2023-06-14 19:33:35 +08:00
committed by GitHub
parent 4398d20c56
commit abb1d0a8f3
4 changed files with 322 additions and 122 deletions
+109 -34
View File
@@ -390,6 +390,61 @@ func (x *TableName) GetTableName() string {
return "" return ""
} }
type TableIdent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TableId uint32 `protobuf:"varint,1,opt,name=table_id,json=tableId,proto3" json:"table_id,omitempty"`
TableName *TableName `protobuf:"bytes,2,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"`
}
func (x *TableIdent) Reset() {
*x = TableIdent{}
if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_meta_common_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TableIdent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TableIdent) ProtoMessage() {}
func (x *TableIdent) 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 TableIdent.ProtoReflect.Descriptor instead.
func (*TableIdent) Descriptor() ([]byte, []int) {
return file_greptime_v1_meta_common_proto_rawDescGZIP(), []int{5}
}
func (x *TableIdent) GetTableId() uint32 {
if x != nil {
return x.TableId
}
return 0
}
func (x *TableIdent) GetTableName() *TableName {
if x != nil {
return x.TableName
}
return nil
}
type TimeInterval struct { type TimeInterval struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@@ -404,7 +459,7 @@ type TimeInterval struct {
func (x *TimeInterval) Reset() { func (x *TimeInterval) Reset() {
*x = TimeInterval{} *x = TimeInterval{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_meta_common_proto_msgTypes[5] mi := &file_greptime_v1_meta_common_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -417,7 +472,7 @@ func (x *TimeInterval) String() string {
func (*TimeInterval) ProtoMessage() {} func (*TimeInterval) ProtoMessage() {}
func (x *TimeInterval) ProtoReflect() protoreflect.Message { func (x *TimeInterval) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_meta_common_proto_msgTypes[5] mi := &file_greptime_v1_meta_common_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -430,7 +485,7 @@ func (x *TimeInterval) ProtoReflect() protoreflect.Message {
// Deprecated: Use TimeInterval.ProtoReflect.Descriptor instead. // Deprecated: Use TimeInterval.ProtoReflect.Descriptor instead.
func (*TimeInterval) Descriptor() ([]byte, []int) { func (*TimeInterval) Descriptor() ([]byte, []int) {
return file_greptime_v1_meta_common_proto_rawDescGZIP(), []int{5} return file_greptime_v1_meta_common_proto_rawDescGZIP(), []int{6}
} }
func (x *TimeInterval) GetStartTimestampMillis() int64 { func (x *TimeInterval) GetStartTimestampMillis() int64 {
@@ -461,7 +516,7 @@ type KeyValue struct {
func (x *KeyValue) Reset() { func (x *KeyValue) Reset() {
*x = KeyValue{} *x = KeyValue{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_meta_common_proto_msgTypes[6] mi := &file_greptime_v1_meta_common_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -474,7 +529,7 @@ func (x *KeyValue) String() string {
func (*KeyValue) ProtoMessage() {} func (*KeyValue) ProtoMessage() {}
func (x *KeyValue) ProtoReflect() protoreflect.Message { func (x *KeyValue) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_meta_common_proto_msgTypes[6] mi := &file_greptime_v1_meta_common_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -487,7 +542,7 @@ func (x *KeyValue) ProtoReflect() protoreflect.Message {
// Deprecated: Use KeyValue.ProtoReflect.Descriptor instead. // Deprecated: Use KeyValue.ProtoReflect.Descriptor instead.
func (*KeyValue) Descriptor() ([]byte, []int) { func (*KeyValue) Descriptor() ([]byte, []int) {
return file_greptime_v1_meta_common_proto_rawDescGZIP(), []int{6} return file_greptime_v1_meta_common_proto_rawDescGZIP(), []int{7}
} }
func (x *KeyValue) GetKey() []byte { func (x *KeyValue) GetKey() []byte {
@@ -542,24 +597,30 @@ var file_greptime_v1_meta_common_proto_rawDesc = []byte{
0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x6d, 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, 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, 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, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x63, 0x0a, 0x0a, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x65,
0x72, 0x76, 0x61, 0x6c, 0x12, 0x34, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01,
0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x3a, 0x0a,
0x20, 0x01, 0x28, 0x03, 0x52, 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x74, 0x61, 0x6d, 0x70, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x65, 0x6e, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e,
0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x09,
0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x76, 0x0a, 0x0c, 0x54, 0x69, 0x6d,
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, 0x32, 0x0a, 0x08, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x34, 0x0a, 0x16, 0x73, 0x74, 0x61,
0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x69, 0x6c,
0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x14, 0x73, 0x74, 0x61, 0x72, 0x74,
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12,
0x2a, 0x22, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x41, 0x54, 0x41, 0x30, 0x0a, 0x14, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
0x4e, 0x4f, 0x44, 0x45, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x52, 0x4f, 0x4e, 0x54, 0x45, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x65,
0x4e, 0x44, 0x10, 0x01, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x69, 0x6c, 0x6c, 0x69,
0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x2f, 0x73, 0x22, 0x32, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a,
0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
0x6f, 0x2f, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05,
0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0x22, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0c, 0x0a,
0x08, 0x44, 0x41, 0x54, 0x41, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x46,
0x52, 0x4f, 0x4e, 0x54, 0x45, 0x4e, 0x44, 0x10, 0x01, 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 ( var (
@@ -575,7 +636,7 @@ func file_greptime_v1_meta_common_proto_rawDescGZIP() []byte {
} }
var file_greptime_v1_meta_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_greptime_v1_meta_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_greptime_v1_meta_common_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_greptime_v1_meta_common_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_greptime_v1_meta_common_proto_goTypes = []interface{}{ var file_greptime_v1_meta_common_proto_goTypes = []interface{}{
(Role)(0), // 0: greptime.v1.meta.Role (Role)(0), // 0: greptime.v1.meta.Role
(*RequestHeader)(nil), // 1: greptime.v1.meta.RequestHeader (*RequestHeader)(nil), // 1: greptime.v1.meta.RequestHeader
@@ -583,17 +644,19 @@ var file_greptime_v1_meta_common_proto_goTypes = []interface{}{
(*Error)(nil), // 3: greptime.v1.meta.Error (*Error)(nil), // 3: greptime.v1.meta.Error
(*Peer)(nil), // 4: greptime.v1.meta.Peer (*Peer)(nil), // 4: greptime.v1.meta.Peer
(*TableName)(nil), // 5: greptime.v1.meta.TableName (*TableName)(nil), // 5: greptime.v1.meta.TableName
(*TimeInterval)(nil), // 6: greptime.v1.meta.TimeInterval (*TableIdent)(nil), // 6: greptime.v1.meta.TableIdent
(*KeyValue)(nil), // 7: greptime.v1.meta.KeyValue (*TimeInterval)(nil), // 7: greptime.v1.meta.TimeInterval
(*KeyValue)(nil), // 8: greptime.v1.meta.KeyValue
} }
var file_greptime_v1_meta_common_proto_depIdxs = []int32{ var file_greptime_v1_meta_common_proto_depIdxs = []int32{
0, // 0: greptime.v1.meta.RequestHeader.role:type_name -> greptime.v1.meta.Role 0, // 0: greptime.v1.meta.RequestHeader.role:type_name -> greptime.v1.meta.Role
3, // 1: greptime.v1.meta.ResponseHeader.error:type_name -> greptime.v1.meta.Error 3, // 1: greptime.v1.meta.ResponseHeader.error:type_name -> greptime.v1.meta.Error
2, // [2:2] is the sub-list for method output_type 5, // 2: greptime.v1.meta.TableIdent.table_name:type_name -> greptime.v1.meta.TableName
2, // [2:2] is the sub-list for method input_type 3, // [3:3] is the sub-list for method output_type
2, // [2:2] is the sub-list for extension type_name 3, // [3:3] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension extendee 3, // [3:3] is the sub-list for extension type_name
0, // [0:2] is the sub-list for field 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_common_proto_init() } func init() { file_greptime_v1_meta_common_proto_init() }
@@ -663,7 +726,7 @@ func file_greptime_v1_meta_common_proto_init() {
} }
} }
file_greptime_v1_meta_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_greptime_v1_meta_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TimeInterval); i { switch v := v.(*TableIdent); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@@ -675,6 +738,18 @@ func file_greptime_v1_meta_common_proto_init() {
} }
} }
file_greptime_v1_meta_common_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { file_greptime_v1_meta_common_proto_msgTypes[6].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[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*KeyValue); i { switch v := v.(*KeyValue); i {
case 0: case 0:
return &v.state return &v.state
@@ -693,7 +768,7 @@ func file_greptime_v1_meta_common_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_greptime_v1_meta_common_proto_rawDesc, RawDescriptor: file_greptime_v1_meta_common_proto_rawDesc,
NumEnums: 1, NumEnums: 1,
NumMessages: 7, NumMessages: 8,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },
+200 -88
View File
@@ -431,6 +431,7 @@ type HeartbeatResponse struct {
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
MailboxMessage *MailboxMessage `protobuf:"bytes,2,opt,name=mailbox_message,json=mailboxMessage,proto3" json:"mailbox_message,omitempty"` MailboxMessage *MailboxMessage `protobuf:"bytes,2,opt,name=mailbox_message,json=mailboxMessage,proto3" json:"mailbox_message,omitempty"`
RegionLeases []*RegionLease `protobuf:"bytes,3,rep,name=region_leases,json=regionLeases,proto3" json:"region_leases,omitempty"`
} }
func (x *HeartbeatResponse) Reset() { func (x *HeartbeatResponse) Reset() {
@@ -479,6 +480,84 @@ func (x *HeartbeatResponse) GetMailboxMessage() *MailboxMessage {
return nil return nil
} }
func (x *HeartbeatResponse) GetRegionLeases() []*RegionLease {
if x != nil {
return x.RegionLeases
}
return nil
}
type RegionLease struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TableIdent *TableIdent `protobuf:"bytes,1,opt,name=table_ident,json=tableIdent,proto3" json:"table_ident,omitempty"`
Regions []uint32 `protobuf:"varint,2,rep,packed,name=regions,proto3" json:"regions,omitempty"`
LastHeartbeatTimeMillis int64 `protobuf:"varint,3,opt,name=last_heartbeat_time_millis,json=lastHeartbeatTimeMillis,proto3" json:"last_heartbeat_time_millis,omitempty"`
LeaseSeconds uint64 `protobuf:"varint,4,opt,name=lease_seconds,json=leaseSeconds,proto3" json:"lease_seconds,omitempty"`
}
func (x *RegionLease) Reset() {
*x = RegionLease{}
if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RegionLease) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RegionLease) ProtoMessage() {}
func (x *RegionLease) 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 RegionLease.ProtoReflect.Descriptor instead.
func (*RegionLease) Descriptor() ([]byte, []int) {
return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{5}
}
func (x *RegionLease) GetTableIdent() *TableIdent {
if x != nil {
return x.TableIdent
}
return nil
}
func (x *RegionLease) GetRegions() []uint32 {
if x != nil {
return x.Regions
}
return nil
}
func (x *RegionLease) GetLastHeartbeatTimeMillis() int64 {
if x != nil {
return x.LastHeartbeatTimeMillis
}
return 0
}
func (x *RegionLease) GetLeaseSeconds() uint64 {
if x != nil {
return x.LeaseSeconds
}
return 0
}
type AskLeaderRequest struct { type AskLeaderRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@@ -490,7 +569,7 @@ type AskLeaderRequest struct {
func (x *AskLeaderRequest) Reset() { func (x *AskLeaderRequest) Reset() {
*x = AskLeaderRequest{} *x = AskLeaderRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[5] mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -503,7 +582,7 @@ func (x *AskLeaderRequest) String() string {
func (*AskLeaderRequest) ProtoMessage() {} func (*AskLeaderRequest) ProtoMessage() {}
func (x *AskLeaderRequest) ProtoReflect() protoreflect.Message { func (x *AskLeaderRequest) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[5] mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -516,7 +595,7 @@ func (x *AskLeaderRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use AskLeaderRequest.ProtoReflect.Descriptor instead. // Deprecated: Use AskLeaderRequest.ProtoReflect.Descriptor instead.
func (*AskLeaderRequest) Descriptor() ([]byte, []int) { func (*AskLeaderRequest) Descriptor() ([]byte, []int) {
return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{5} return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{6}
} }
func (x *AskLeaderRequest) GetHeader() *RequestHeader { func (x *AskLeaderRequest) GetHeader() *RequestHeader {
@@ -538,7 +617,7 @@ type AskLeaderResponse struct {
func (x *AskLeaderResponse) Reset() { func (x *AskLeaderResponse) Reset() {
*x = AskLeaderResponse{} *x = AskLeaderResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[6] mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -551,7 +630,7 @@ func (x *AskLeaderResponse) String() string {
func (*AskLeaderResponse) ProtoMessage() {} func (*AskLeaderResponse) ProtoMessage() {}
func (x *AskLeaderResponse) ProtoReflect() protoreflect.Message { func (x *AskLeaderResponse) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[6] mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -564,7 +643,7 @@ func (x *AskLeaderResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use AskLeaderResponse.ProtoReflect.Descriptor instead. // Deprecated: Use AskLeaderResponse.ProtoReflect.Descriptor instead.
func (*AskLeaderResponse) Descriptor() ([]byte, []int) { func (*AskLeaderResponse) Descriptor() ([]byte, []int) {
return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{6} return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{7}
} }
func (x *AskLeaderResponse) GetHeader() *ResponseHeader { func (x *AskLeaderResponse) GetHeader() *ResponseHeader {
@@ -606,7 +685,7 @@ type MailboxMessage struct {
func (x *MailboxMessage) Reset() { func (x *MailboxMessage) Reset() {
*x = MailboxMessage{} *x = MailboxMessage{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[7] mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@@ -619,7 +698,7 @@ func (x *MailboxMessage) String() string {
func (*MailboxMessage) ProtoMessage() {} func (*MailboxMessage) ProtoMessage() {}
func (x *MailboxMessage) ProtoReflect() protoreflect.Message { func (x *MailboxMessage) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[7] mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@@ -632,7 +711,7 @@ func (x *MailboxMessage) ProtoReflect() protoreflect.Message {
// Deprecated: Use MailboxMessage.ProtoReflect.Descriptor instead. // Deprecated: Use MailboxMessage.ProtoReflect.Descriptor instead.
func (*MailboxMessage) Descriptor() ([]byte, []int) { func (*MailboxMessage) Descriptor() ([]byte, []int) {
return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{7} return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{8}
} }
func (x *MailboxMessage) GetId() uint64 { func (x *MailboxMessage) GetId() uint64 {
@@ -784,7 +863,7 @@ var file_greptime_v1_meta_heartbeat_proto_rawDesc = []byte{
0x6e, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x6e, 0x53, 0x79, 0x6e, 0x63, 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, 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, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x4c, 0x65, 0x61, 0x72, 0x6e, 0x65, 0x72, 0x22,
0x98, 0x01, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0xdc, 0x01, 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, 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, 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, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
@@ -793,47 +872,64 @@ var file_greptime_v1_meta_heartbeat_proto_rawDesc = []byte{
0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74,
0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4d, 0x61, 0x69, 0x6c, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4d, 0x61, 0x69, 0x6c,
0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0e, 0x6d, 0x61, 0x69, 0x6c, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0e, 0x6d, 0x61, 0x69, 0x6c,
0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x4b, 0x0a, 0x10, 0x41, 0x73, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x42, 0x0a, 0x0d, 0x72, 0x65,
0x6b, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28,
0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e,
0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x61, 0x73, 0x65,
0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x52, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x22, 0xc8,
0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x7d, 0x0a, 0x11, 0x41, 0x73, 0x6b, 0x4c, 0x65, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x3d,
0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x0a, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20,
0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76,
0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x65, 0x6e,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x74, 0x52, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a,
0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x07,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3b, 0x0a, 0x1a, 0x6c, 0x61, 0x73, 0x74, 0x5f,
0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d,
0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0xaa, 0x01, 0x0a, 0x0e, 0x4d, 0x61, 0x69, 0x6c, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x17, 0x6c, 0x61, 0x73,
0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x4d, 0x69,
0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65,
0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6c, 0x65, 0x61,
0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x73, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0x4b, 0x0a, 0x10, 0x41, 0x73, 0x6b,
0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x04, 0x20, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a,
0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e,
0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61,
0x03, 0x52, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x69, 0x6c, 0x6c, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06,
0x69, 0x73, 0x12, 0x14, 0x0a, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x7d, 0x0a, 0x11, 0x41, 0x73, 0x6b, 0x4c, 0x65, 0x61,
0x48, 0x00, 0x52, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x68,
0x6f, 0x61, 0x64, 0x32, 0xbf, 0x01, 0x0a, 0x09, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x72,
0x74, 0x12, 0x5a, 0x0a, 0x09, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x22, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52,
0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68,
0x61, 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18,
0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65,
0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x06, 0x6c,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x56, 0x0a, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0xaa, 0x01, 0x0a, 0x0e, 0x4d, 0x61, 0x69, 0x6c, 0x62, 0x6f,
0x09, 0x41, 0x73, 0x6b, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x65, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x41, 0x73, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a,
0x6b, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65,
0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x61, 0x2e, 0x41, 0x73, 0x6b, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x04, 0x20, 0x01,
0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
0x2f, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x52, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x69, 0x6c, 0x6c, 0x69,
0x67, 0x6f, 0x2f, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48,
0x65, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x00, 0x52, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f,
0x61, 0x64, 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 ( var (
@@ -848,50 +944,54 @@ func file_greptime_v1_meta_heartbeat_proto_rawDescGZIP() []byte {
return 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, 10) var file_greptime_v1_meta_heartbeat_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_greptime_v1_meta_heartbeat_proto_goTypes = []interface{}{ var file_greptime_v1_meta_heartbeat_proto_goTypes = []interface{}{
(*HeartbeatRequest)(nil), // 0: greptime.v1.meta.HeartbeatRequest (*HeartbeatRequest)(nil), // 0: greptime.v1.meta.HeartbeatRequest
(*NodeStat)(nil), // 1: greptime.v1.meta.NodeStat (*NodeStat)(nil), // 1: greptime.v1.meta.NodeStat
(*RegionStat)(nil), // 2: greptime.v1.meta.RegionStat (*RegionStat)(nil), // 2: greptime.v1.meta.RegionStat
(*ReplicaStat)(nil), // 3: greptime.v1.meta.ReplicaStat (*ReplicaStat)(nil), // 3: greptime.v1.meta.ReplicaStat
(*HeartbeatResponse)(nil), // 4: greptime.v1.meta.HeartbeatResponse (*HeartbeatResponse)(nil), // 4: greptime.v1.meta.HeartbeatResponse
(*AskLeaderRequest)(nil), // 5: greptime.v1.meta.AskLeaderRequest (*RegionLease)(nil), // 5: greptime.v1.meta.RegionLease
(*AskLeaderResponse)(nil), // 6: greptime.v1.meta.AskLeaderResponse (*AskLeaderRequest)(nil), // 6: greptime.v1.meta.AskLeaderRequest
(*MailboxMessage)(nil), // 7: greptime.v1.meta.MailboxMessage (*AskLeaderResponse)(nil), // 7: greptime.v1.meta.AskLeaderResponse
nil, // 8: greptime.v1.meta.NodeStat.AttrsEntry (*MailboxMessage)(nil), // 8: greptime.v1.meta.MailboxMessage
nil, // 9: greptime.v1.meta.RegionStat.AttrsEntry nil, // 9: greptime.v1.meta.NodeStat.AttrsEntry
(*RequestHeader)(nil), // 10: greptime.v1.meta.RequestHeader nil, // 10: greptime.v1.meta.RegionStat.AttrsEntry
(*Peer)(nil), // 11: greptime.v1.meta.Peer (*RequestHeader)(nil), // 11: greptime.v1.meta.RequestHeader
(*TimeInterval)(nil), // 12: greptime.v1.meta.TimeInterval (*Peer)(nil), // 12: greptime.v1.meta.Peer
(*TableName)(nil), // 13: greptime.v1.meta.TableName (*TimeInterval)(nil), // 13: greptime.v1.meta.TimeInterval
(*ResponseHeader)(nil), // 14: greptime.v1.meta.ResponseHeader (*TableName)(nil), // 14: greptime.v1.meta.TableName
(*ResponseHeader)(nil), // 15: greptime.v1.meta.ResponseHeader
(*TableIdent)(nil), // 16: greptime.v1.meta.TableIdent
} }
var file_greptime_v1_meta_heartbeat_proto_depIdxs = []int32{ var file_greptime_v1_meta_heartbeat_proto_depIdxs = []int32{
10, // 0: greptime.v1.meta.HeartbeatRequest.header:type_name -> greptime.v1.meta.RequestHeader 11, // 0: greptime.v1.meta.HeartbeatRequest.header:type_name -> greptime.v1.meta.RequestHeader
11, // 1: greptime.v1.meta.HeartbeatRequest.peer:type_name -> greptime.v1.meta.Peer 12, // 1: greptime.v1.meta.HeartbeatRequest.peer:type_name -> greptime.v1.meta.Peer
12, // 2: greptime.v1.meta.HeartbeatRequest.report_interval:type_name -> greptime.v1.meta.TimeInterval 13, // 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 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 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 3, // 5: greptime.v1.meta.HeartbeatRequest.replica_stats:type_name -> greptime.v1.meta.ReplicaStat
7, // 6: greptime.v1.meta.HeartbeatRequest.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage 8, // 6: greptime.v1.meta.HeartbeatRequest.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage
8, // 7: greptime.v1.meta.NodeStat.attrs:type_name -> greptime.v1.meta.NodeStat.AttrsEntry 9, // 7: greptime.v1.meta.NodeStat.attrs:type_name -> greptime.v1.meta.NodeStat.AttrsEntry
13, // 8: greptime.v1.meta.RegionStat.table_name:type_name -> greptime.v1.meta.TableName 14, // 8: greptime.v1.meta.RegionStat.table_name:type_name -> greptime.v1.meta.TableName
9, // 9: greptime.v1.meta.RegionStat.attrs:type_name -> greptime.v1.meta.RegionStat.AttrsEntry 10, // 9: greptime.v1.meta.RegionStat.attrs:type_name -> greptime.v1.meta.RegionStat.AttrsEntry
11, // 10: greptime.v1.meta.ReplicaStat.peer:type_name -> greptime.v1.meta.Peer 12, // 10: greptime.v1.meta.ReplicaStat.peer:type_name -> greptime.v1.meta.Peer
14, // 11: greptime.v1.meta.HeartbeatResponse.header:type_name -> greptime.v1.meta.ResponseHeader 15, // 11: greptime.v1.meta.HeartbeatResponse.header:type_name -> greptime.v1.meta.ResponseHeader
7, // 12: greptime.v1.meta.HeartbeatResponse.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage 8, // 12: greptime.v1.meta.HeartbeatResponse.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage
10, // 13: greptime.v1.meta.AskLeaderRequest.header:type_name -> greptime.v1.meta.RequestHeader 5, // 13: greptime.v1.meta.HeartbeatResponse.region_leases:type_name -> greptime.v1.meta.RegionLease
14, // 14: greptime.v1.meta.AskLeaderResponse.header:type_name -> greptime.v1.meta.ResponseHeader 16, // 14: greptime.v1.meta.RegionLease.table_ident:type_name -> greptime.v1.meta.TableIdent
11, // 15: greptime.v1.meta.AskLeaderResponse.leader:type_name -> greptime.v1.meta.Peer 11, // 15: greptime.v1.meta.AskLeaderRequest.header:type_name -> greptime.v1.meta.RequestHeader
0, // 16: greptime.v1.meta.Heartbeat.Heartbeat:input_type -> greptime.v1.meta.HeartbeatRequest 15, // 16: greptime.v1.meta.AskLeaderResponse.header:type_name -> greptime.v1.meta.ResponseHeader
5, // 17: greptime.v1.meta.Heartbeat.AskLeader:input_type -> greptime.v1.meta.AskLeaderRequest 12, // 17: greptime.v1.meta.AskLeaderResponse.leader:type_name -> greptime.v1.meta.Peer
4, // 18: greptime.v1.meta.Heartbeat.Heartbeat:output_type -> greptime.v1.meta.HeartbeatResponse 0, // 18: greptime.v1.meta.Heartbeat.Heartbeat:input_type -> greptime.v1.meta.HeartbeatRequest
6, // 19: greptime.v1.meta.Heartbeat.AskLeader:output_type -> greptime.v1.meta.AskLeaderResponse 6, // 19: greptime.v1.meta.Heartbeat.AskLeader:input_type -> greptime.v1.meta.AskLeaderRequest
18, // [18:20] is the sub-list for method output_type 4, // 20: greptime.v1.meta.Heartbeat.Heartbeat:output_type -> greptime.v1.meta.HeartbeatResponse
16, // [16:18] is the sub-list for method input_type 7, // 21: greptime.v1.meta.Heartbeat.AskLeader:output_type -> greptime.v1.meta.AskLeaderResponse
16, // [16:16] is the sub-list for extension type_name 20, // [20:22] is the sub-list for method output_type
16, // [16:16] is the sub-list for extension extendee 18, // [18:20] is the sub-list for method input_type
0, // [0:16] is the sub-list for field type_name 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_heartbeat_proto_init() } func init() { file_greptime_v1_meta_heartbeat_proto_init() }
@@ -962,7 +1062,7 @@ func file_greptime_v1_meta_heartbeat_proto_init() {
} }
} }
file_greptime_v1_meta_heartbeat_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_greptime_v1_meta_heartbeat_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AskLeaderRequest); i { switch v := v.(*RegionLease); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@@ -974,7 +1074,7 @@ func file_greptime_v1_meta_heartbeat_proto_init() {
} }
} }
file_greptime_v1_meta_heartbeat_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { file_greptime_v1_meta_heartbeat_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AskLeaderResponse); i { switch v := v.(*AskLeaderRequest); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@@ -986,6 +1086,18 @@ func file_greptime_v1_meta_heartbeat_proto_init() {
} }
} }
file_greptime_v1_meta_heartbeat_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { file_greptime_v1_meta_heartbeat_proto_msgTypes[7].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
}
}
file_greptime_v1_meta_heartbeat_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MailboxMessage); i { switch v := v.(*MailboxMessage); i {
case 0: case 0:
return &v.state return &v.state
@@ -998,7 +1110,7 @@ func file_greptime_v1_meta_heartbeat_proto_init() {
} }
} }
} }
file_greptime_v1_meta_heartbeat_proto_msgTypes[7].OneofWrappers = []interface{}{ file_greptime_v1_meta_heartbeat_proto_msgTypes[8].OneofWrappers = []interface{}{
(*MailboxMessage_Json)(nil), (*MailboxMessage_Json)(nil),
} }
type x struct{} type x struct{}
@@ -1007,7 +1119,7 @@ func file_greptime_v1_meta_heartbeat_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_greptime_v1_meta_heartbeat_proto_rawDesc, RawDescriptor: file_greptime_v1_meta_heartbeat_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 10, NumMessages: 11,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },
+5
View File
@@ -55,6 +55,11 @@ message TableName {
string table_name = 3; string table_name = 3;
} }
message TableIdent {
uint32 table_id = 1;
TableName table_name = 2;
}
message TimeInterval { message TimeInterval {
// The unix timestamp in millis of the start of this period. // The unix timestamp in millis of the start of this period.
int64 start_timestamp_millis = 1; int64 start_timestamp_millis = 1;
+8
View File
@@ -97,6 +97,14 @@ message HeartbeatResponse {
ResponseHeader header = 1; ResponseHeader header = 1;
MailboxMessage mailbox_message = 2; MailboxMessage mailbox_message = 2;
repeated RegionLease region_leases = 3;
}
message RegionLease {
TableIdent table_ident = 1;
repeated uint32 regions = 2;
int64 last_heartbeat_time_millis = 3;
uint64 lease_seconds = 4;
} }
message AskLeaderRequest { RequestHeader header = 1; } message AskLeaderRequest { RequestHeader header = 1; }