diff --git a/c++/greptime/v1/meta/heartbeat.pb.cc b/c++/greptime/v1/meta/heartbeat.pb.cc index 151c274a..c308685b 100644 --- a/c++/greptime/v1/meta/heartbeat.pb.cc +++ b/c++/greptime/v1/meta/heartbeat.pb.cc @@ -50,6 +50,7 @@ PROTOBUF_CONSTEXPR RegionStat::RegionStat( , /*decltype(_impl_.wcus_)*/int64_t{0} , /*decltype(_impl_.approximate_bytes_)*/int64_t{0} , /*decltype(_impl_.approximate_rows_)*/int64_t{0} + , /*decltype(_impl_.role_)*/0 , /*decltype(_impl_._cached_size_)*/{}} {} struct RegionStatDefaultTypeInternal { PROTOBUF_CONSTEXPR RegionStatDefaultTypeInternal() @@ -141,7 +142,7 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORIT } // namespace v1 } // namespace greptime static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[7]; -static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_greptime_2fv1_2fmeta_2fheartbeat_2eproto = nullptr; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2fmeta_2fheartbeat_2eproto[1]; static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fmeta_2fheartbeat_2eproto = nullptr; const uint32_t TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { @@ -170,6 +171,7 @@ const uint32_t TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto::offsets[] P PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.approximate_bytes_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.approximate_rows_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.engine_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.role_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatResponse, _internal_metadata_), ~0u, // no _extensions_ @@ -220,11 +222,11 @@ const uint32_t TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto::offsets[] P static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, -1, sizeof(::greptime::v1::meta::HeartbeatRequest)}, { 13, -1, -1, sizeof(::greptime::v1::meta::RegionStat)}, - { 25, -1, -1, sizeof(::greptime::v1::meta::HeartbeatResponse)}, - { 34, -1, -1, sizeof(::greptime::v1::meta::RegionLease)}, - { 43, -1, -1, sizeof(::greptime::v1::meta::AskLeaderRequest)}, - { 50, -1, -1, sizeof(::greptime::v1::meta::AskLeaderResponse)}, - { 58, -1, -1, sizeof(::greptime::v1::meta::MailboxMessage)}, + { 26, -1, -1, sizeof(::greptime::v1::meta::HeartbeatResponse)}, + { 35, -1, -1, sizeof(::greptime::v1::meta::RegionLease)}, + { 44, -1, -1, sizeof(::greptime::v1::meta::AskLeaderRequest)}, + { 51, -1, -1, sizeof(::greptime::v1::meta::AskLeaderResponse)}, + { 59, -1, -1, sizeof(::greptime::v1::meta::MailboxMessage)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -248,38 +250,40 @@ const char descriptor_table_protodef_greptime_2fv1_2fmeta_2fheartbeat_2eproto[] "e.v1.meta.RegionStat\0229\n\017mailbox_message\030" "\005 \001(\0132 .greptime.v1.meta.MailboxMessage\022" "\034\n\024duration_since_epoch\030\006 \001(\004\022\022\n\nnode_ep" - "och\030\007 \001(\004\"\200\001\n\nRegionStat\022\021\n\tregion_id\030\001 " + "och\030\007 \001(\004\"\254\001\n\nRegionStat\022\021\n\tregion_id\030\001 " "\001(\004\022\014\n\004rcus\030\002 \001(\003\022\014\n\004wcus\030\003 \001(\003\022\031\n\021appro" "ximate_bytes\030\004 \001(\003\022\030\n\020approximate_rows\030\005" - " \001(\003\022\016\n\006engine\030\006 \001(\t\"\265\001\n\021HeartbeatRespon" - "se\0220\n\006header\030\001 \001(\0132 .greptime.v1.meta.Re" - "sponseHeader\0229\n\017mailbox_message\030\002 \001(\0132 ." - "greptime.v1.meta.MailboxMessage\0223\n\014regio" - "n_lease\030\003 \001(\0132\035.greptime.v1.meta.RegionL" - "ease\"V\n\013RegionLease\022\022\n\nregion_ids\030\001 \003(\004\022" - "\034\n\024duration_since_epoch\030\002 \001(\004\022\025\n\rlease_s" - "econds\030\003 \001(\004\"C\n\020AskLeaderRequest\022/\n\006head" - "er\030\001 \001(\0132\037.greptime.v1.meta.RequestHeade" - "r\"m\n\021AskLeaderResponse\0220\n\006header\030\001 \001(\0132 " - ".greptime.v1.meta.ResponseHeader\022&\n\006lead" - "er\030\002 \001(\0132\026.greptime.v1.meta.Peer\"|\n\016Mail" - "boxMessage\022\n\n\002id\030\001 \001(\004\022\017\n\007subject\030\002 \001(\t\022" - "\014\n\004from\030\003 \001(\t\022\n\n\002to\030\004 \001(\t\022\030\n\020timestamp_m" - "illis\030\005 \001(\003\022\016\n\004json\030\006 \001(\tH\000B\t\n\007payload2\277" - "\001\n\tHeartbeat\022Z\n\tHeartbeat\022\".greptime.v1." - "meta.HeartbeatRequest\032#.greptime.v1.meta" - ".HeartbeatResponse\"\000(\0010\001\022V\n\tAskLeader\022\"." - "greptime.v1.meta.AskLeaderRequest\032#.grep" - "time.v1.meta.AskLeaderResponse\"\000B(from._internal_metadata_); @@ -757,8 +776,8 @@ RegionStat::RegionStat(const RegionStat& from) _this->GetArenaForAllocation()); } ::memcpy(&_impl_.region_id_, &from._impl_.region_id_, - static_cast(reinterpret_cast(&_impl_.approximate_rows_) - - reinterpret_cast(&_impl_.region_id_)) + sizeof(_impl_.approximate_rows_)); + static_cast(reinterpret_cast(&_impl_.role_) - + reinterpret_cast(&_impl_.region_id_)) + sizeof(_impl_.role_)); // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.RegionStat) } @@ -773,6 +792,7 @@ inline void RegionStat::SharedCtor( , decltype(_impl_.wcus_){int64_t{0}} , decltype(_impl_.approximate_bytes_){int64_t{0}} , decltype(_impl_.approximate_rows_){int64_t{0}} + , decltype(_impl_.role_){0} , /*decltype(_impl_._cached_size_)*/{} }; _impl_.engine_.InitDefault(); @@ -807,8 +827,8 @@ void RegionStat::Clear() { _impl_.engine_.ClearToEmpty(); ::memset(&_impl_.region_id_, 0, static_cast( - reinterpret_cast(&_impl_.approximate_rows_) - - reinterpret_cast(&_impl_.region_id_)) + sizeof(_impl_.approximate_rows_)); + reinterpret_cast(&_impl_.role_) - + reinterpret_cast(&_impl_.region_id_)) + sizeof(_impl_.role_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -868,6 +888,15 @@ const char* RegionStat::_InternalParse(const char* ptr, ::_pbi::ParseContext* ct } else goto handle_unusual; continue; + // .greptime.v1.meta.RegionRole role = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_role(static_cast<::greptime::v1::meta::RegionRole>(val)); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -937,6 +966,13 @@ uint8_t* RegionStat::_InternalSerialize( 6, this->_internal_engine(), target); } + // .greptime.v1.meta.RegionRole role = 7; + if (this->_internal_role() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 7, this->_internal_role(), target); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); @@ -985,6 +1021,12 @@ size_t RegionStat::ByteSizeLong() const { total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_approximate_rows()); } + // .greptime.v1.meta.RegionRole role = 7; + if (this->_internal_role() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_role()); + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -1021,6 +1063,9 @@ void RegionStat::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PRO if (from._internal_approximate_rows() != 0) { _this->_internal_set_approximate_rows(from._internal_approximate_rows()); } + if (from._internal_role() != 0) { + _this->_internal_set_role(from._internal_role()); + } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -1045,8 +1090,8 @@ void RegionStat::InternalSwap(RegionStat* other) { &other->_impl_.engine_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(RegionStat, _impl_.approximate_rows_) - + sizeof(RegionStat::_impl_.approximate_rows_) + PROTOBUF_FIELD_OFFSET(RegionStat, _impl_.role_) + + sizeof(RegionStat::_impl_.role_) - PROTOBUF_FIELD_OFFSET(RegionStat, _impl_.region_id_)>( reinterpret_cast(&_impl_.region_id_), reinterpret_cast(&other->_impl_.region_id_)); diff --git a/c++/greptime/v1/meta/heartbeat.pb.h b/c++/greptime/v1/meta/heartbeat.pb.h index f7b297e9..d096bd45 100644 --- a/c++/greptime/v1/meta/heartbeat.pb.h +++ b/c++/greptime/v1/meta/heartbeat.pb.h @@ -29,6 +29,7 @@ #include #include // IWYU pragma: export #include // IWYU pragma: export +#include #include #include "greptime/v1/meta/common.pb.h" // @@protoc_insertion_point(includes) @@ -85,6 +86,31 @@ namespace greptime { namespace v1 { namespace meta { +enum RegionRole : int { + Leader = 0, + Follower = 1, + RegionRole_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + RegionRole_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool RegionRole_IsValid(int value); +constexpr RegionRole RegionRole_MIN = Leader; +constexpr RegionRole RegionRole_MAX = Follower; +constexpr int RegionRole_ARRAYSIZE = RegionRole_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RegionRole_descriptor(); +template +inline const std::string& RegionRole_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function RegionRole_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + RegionRole_descriptor(), enum_t_value); +} +inline bool RegionRole_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, RegionRole* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + RegionRole_descriptor(), name, value); +} // =================================================================== class HeartbeatRequest final : @@ -473,6 +499,7 @@ class RegionStat final : kWcusFieldNumber = 3, kApproximateBytesFieldNumber = 4, kApproximateRowsFieldNumber = 5, + kRoleFieldNumber = 7, }; // string engine = 6; void clear_engine(); @@ -533,6 +560,15 @@ class RegionStat final : void _internal_set_approximate_rows(int64_t value); public: + // .greptime.v1.meta.RegionRole role = 7; + void clear_role(); + ::greptime::v1::meta::RegionRole role() const; + void set_role(::greptime::v1::meta::RegionRole value); + private: + ::greptime::v1::meta::RegionRole _internal_role() const; + void _internal_set_role(::greptime::v1::meta::RegionRole value); + public: + // @@protoc_insertion_point(class_scope:greptime.v1.meta.RegionStat) private: class _Internal; @@ -547,6 +583,7 @@ class RegionStat final : int64_t wcus_; int64_t approximate_bytes_; int64_t approximate_rows_; + int role_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; @@ -2101,6 +2138,26 @@ inline void RegionStat::set_allocated_engine(std::string* engine) { // @@protoc_insertion_point(field_set_allocated:greptime.v1.meta.RegionStat.engine) } +// .greptime.v1.meta.RegionRole role = 7; +inline void RegionStat::clear_role() { + _impl_.role_ = 0; +} +inline ::greptime::v1::meta::RegionRole RegionStat::_internal_role() const { + return static_cast< ::greptime::v1::meta::RegionRole >(_impl_.role_); +} +inline ::greptime::v1::meta::RegionRole RegionStat::role() const { + // @@protoc_insertion_point(field_get:greptime.v1.meta.RegionStat.role) + return _internal_role(); +} +inline void RegionStat::_internal_set_role(::greptime::v1::meta::RegionRole value) { + + _impl_.role_ = value; +} +inline void RegionStat::set_role(::greptime::v1::meta::RegionRole value) { + _internal_set_role(value); + // @@protoc_insertion_point(field_set:greptime.v1.meta.RegionStat.role) +} + // ------------------------------------------------------------------- // HeartbeatResponse @@ -3026,6 +3083,16 @@ inline MailboxMessage::PayloadCase MailboxMessage::payload_case() const { } // namespace v1 } // namespace greptime +PROTOBUF_NAMESPACE_OPEN + +template <> struct is_proto_enum< ::greptime::v1::meta::RegionRole> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::greptime::v1::meta::RegionRole>() { + return ::greptime::v1::meta::RegionRole_descriptor(); +} + +PROTOBUF_NAMESPACE_CLOSE + // @@protoc_insertion_point(global_scope) #include diff --git a/go/greptime/v1/meta/heartbeat.pb.go b/go/greptime/v1/meta/heartbeat.pb.go index b9203f7c..dee4b10e 100644 --- a/go/greptime/v1/meta/heartbeat.pb.go +++ b/go/greptime/v1/meta/heartbeat.pb.go @@ -34,6 +34,54 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type RegionRole int32 + +const ( + // Writable region(mito2), Readonly region(file). + RegionRole_Leader RegionRole = 0 + // Readonly region. + RegionRole_Follower RegionRole = 1 +) + +// Enum value maps for RegionRole. +var ( + RegionRole_name = map[int32]string{ + 0: "Leader", + 1: "Follower", + } + RegionRole_value = map[string]int32{ + "Leader": 0, + "Follower": 1, + } +) + +func (x RegionRole) Enum() *RegionRole { + p := new(RegionRole) + *p = x + return p +} + +func (x RegionRole) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RegionRole) Descriptor() protoreflect.EnumDescriptor { + return file_greptime_v1_meta_heartbeat_proto_enumTypes[0].Descriptor() +} + +func (RegionRole) Type() protoreflect.EnumType { + return &file_greptime_v1_meta_heartbeat_proto_enumTypes[0] +} + +func (x RegionRole) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RegionRole.Descriptor instead. +func (RegionRole) EnumDescriptor() ([]byte, []int) { + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{0} +} + type HeartbeatRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -151,6 +199,8 @@ type RegionStat struct { ApproximateRows int64 `protobuf:"varint,5,opt,name=approximate_rows,json=approximateRows,proto3" json:"approximate_rows,omitempty"` // engine name Engine string `protobuf:"bytes,6,opt,name=engine,proto3" json:"engine,omitempty"` + // Region role + Role RegionRole `protobuf:"varint,7,opt,name=role,proto3,enum=greptime.v1.meta.RegionRole" json:"role,omitempty"` } func (x *RegionStat) Reset() { @@ -227,6 +277,13 @@ func (x *RegionStat) GetEngine() string { return "" } +func (x *RegionStat) GetRole() RegionRole { + if x != nil { + return x.Role + } + return RegionRole_Leader +} + type HeartbeatResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -602,7 +659,7 @@ var file_greptime_v1_meta_heartbeat_proto_rawDesc = []byte{ 0x52, 0x12, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x22, 0xc1, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x53, 0x74, + 0x6f, 0x63, 0x68, 0x22, 0xf3, 0x01, 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, 0x12, 0x0a, 0x04, 0x72, 0x63, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x72, @@ -614,69 +671,75 @@ var file_greptime_v1_meta_heartbeat_proto_rawDesc = []byte{ 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x22, 0xda, 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, 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, 0x49, 0x0a, 0x0f, 0x6d, 0x61, 0x69, 0x6c, 0x62, - 0x6f, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 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, 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, 0x12, 0x40, 0x0a, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 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, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x0b, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4c, - 0x65, 0x61, 0x73, 0x65, 0x22, 0x83, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4c, - 0x65, 0x61, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x69, - 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x09, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x12, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x6e, 0x63, 0x65, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x73, - 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 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, + 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0e, 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, 0x52, + 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0xda, 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, 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, 0x49, 0x0a, 0x0f, 0x6d, 0x61, 0x69, + 0x6c, 0x62, 0x6f, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 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, 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, 0x12, 0x40, 0x0a, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 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, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x0b, 0x72, 0x65, 0x67, 0x69, 0x6f, + 0x6e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x83, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x69, 0x6f, + 0x6e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x09, 0x72, 0x65, 0x67, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x12, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x6e, + 0x63, 0x65, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 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, 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, + 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, 0x22, 0xaa, 0x01, 0x0a, 0x0e, 0x4d, 0x61, 0x69, + 0x6c, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x69, + 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x14, 0x0a, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2a, 0x26, 0x0a, 0x0a, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, + 0x6f, 0x6c, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x10, 0x00, 0x12, + 0x0c, 0x0a, 0x08, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x10, 0x01, 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, - 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, 0x22, 0xaa, 0x01, 0x0a, 0x0e, 0x4d, 0x61, 0x69, 0x6c, 0x62, - 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x69, 0x6c, 0x6c, - 0x69, 0x73, 0x12, 0x14, 0x0a, 0x04, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x48, 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, + 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 ( @@ -691,41 +754,44 @@ func file_greptime_v1_meta_heartbeat_proto_rawDescGZIP() []byte { return file_greptime_v1_meta_heartbeat_proto_rawDescData } +var file_greptime_v1_meta_heartbeat_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_greptime_v1_meta_heartbeat_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_greptime_v1_meta_heartbeat_proto_goTypes = []interface{}{ - (*HeartbeatRequest)(nil), // 0: greptime.v1.meta.HeartbeatRequest - (*RegionStat)(nil), // 1: greptime.v1.meta.RegionStat - (*HeartbeatResponse)(nil), // 2: greptime.v1.meta.HeartbeatResponse - (*RegionLease)(nil), // 3: greptime.v1.meta.RegionLease - (*AskLeaderRequest)(nil), // 4: greptime.v1.meta.AskLeaderRequest - (*AskLeaderResponse)(nil), // 5: greptime.v1.meta.AskLeaderResponse - (*MailboxMessage)(nil), // 6: greptime.v1.meta.MailboxMessage - (*RequestHeader)(nil), // 7: greptime.v1.meta.RequestHeader - (*Peer)(nil), // 8: greptime.v1.meta.Peer - (*TimeInterval)(nil), // 9: greptime.v1.meta.TimeInterval - (*ResponseHeader)(nil), // 10: greptime.v1.meta.ResponseHeader + (RegionRole)(0), // 0: greptime.v1.meta.RegionRole + (*HeartbeatRequest)(nil), // 1: greptime.v1.meta.HeartbeatRequest + (*RegionStat)(nil), // 2: greptime.v1.meta.RegionStat + (*HeartbeatResponse)(nil), // 3: greptime.v1.meta.HeartbeatResponse + (*RegionLease)(nil), // 4: greptime.v1.meta.RegionLease + (*AskLeaderRequest)(nil), // 5: greptime.v1.meta.AskLeaderRequest + (*AskLeaderResponse)(nil), // 6: greptime.v1.meta.AskLeaderResponse + (*MailboxMessage)(nil), // 7: greptime.v1.meta.MailboxMessage + (*RequestHeader)(nil), // 8: greptime.v1.meta.RequestHeader + (*Peer)(nil), // 9: greptime.v1.meta.Peer + (*TimeInterval)(nil), // 10: greptime.v1.meta.TimeInterval + (*ResponseHeader)(nil), // 11: greptime.v1.meta.ResponseHeader } var file_greptime_v1_meta_heartbeat_proto_depIdxs = []int32{ - 7, // 0: greptime.v1.meta.HeartbeatRequest.header:type_name -> greptime.v1.meta.RequestHeader - 8, // 1: greptime.v1.meta.HeartbeatRequest.peer:type_name -> greptime.v1.meta.Peer - 9, // 2: greptime.v1.meta.HeartbeatRequest.report_interval:type_name -> greptime.v1.meta.TimeInterval - 1, // 3: greptime.v1.meta.HeartbeatRequest.region_stats:type_name -> greptime.v1.meta.RegionStat - 6, // 4: greptime.v1.meta.HeartbeatRequest.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage - 10, // 5: greptime.v1.meta.HeartbeatResponse.header:type_name -> greptime.v1.meta.ResponseHeader - 6, // 6: greptime.v1.meta.HeartbeatResponse.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage - 3, // 7: greptime.v1.meta.HeartbeatResponse.region_lease:type_name -> greptime.v1.meta.RegionLease - 7, // 8: greptime.v1.meta.AskLeaderRequest.header:type_name -> greptime.v1.meta.RequestHeader - 10, // 9: greptime.v1.meta.AskLeaderResponse.header:type_name -> greptime.v1.meta.ResponseHeader - 8, // 10: greptime.v1.meta.AskLeaderResponse.leader:type_name -> greptime.v1.meta.Peer - 0, // 11: greptime.v1.meta.Heartbeat.Heartbeat:input_type -> greptime.v1.meta.HeartbeatRequest - 4, // 12: greptime.v1.meta.Heartbeat.AskLeader:input_type -> greptime.v1.meta.AskLeaderRequest - 2, // 13: greptime.v1.meta.Heartbeat.Heartbeat:output_type -> greptime.v1.meta.HeartbeatResponse - 5, // 14: greptime.v1.meta.Heartbeat.AskLeader:output_type -> greptime.v1.meta.AskLeaderResponse - 13, // [13:15] is the sub-list for method output_type - 11, // [11:13] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 8, // 0: greptime.v1.meta.HeartbeatRequest.header:type_name -> greptime.v1.meta.RequestHeader + 9, // 1: greptime.v1.meta.HeartbeatRequest.peer:type_name -> greptime.v1.meta.Peer + 10, // 2: greptime.v1.meta.HeartbeatRequest.report_interval:type_name -> greptime.v1.meta.TimeInterval + 2, // 3: greptime.v1.meta.HeartbeatRequest.region_stats:type_name -> greptime.v1.meta.RegionStat + 7, // 4: greptime.v1.meta.HeartbeatRequest.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage + 0, // 5: greptime.v1.meta.RegionStat.role:type_name -> greptime.v1.meta.RegionRole + 11, // 6: greptime.v1.meta.HeartbeatResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 7, // 7: greptime.v1.meta.HeartbeatResponse.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage + 4, // 8: greptime.v1.meta.HeartbeatResponse.region_lease:type_name -> greptime.v1.meta.RegionLease + 8, // 9: greptime.v1.meta.AskLeaderRequest.header:type_name -> greptime.v1.meta.RequestHeader + 11, // 10: greptime.v1.meta.AskLeaderResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 9, // 11: greptime.v1.meta.AskLeaderResponse.leader:type_name -> greptime.v1.meta.Peer + 1, // 12: greptime.v1.meta.Heartbeat.Heartbeat:input_type -> greptime.v1.meta.HeartbeatRequest + 5, // 13: greptime.v1.meta.Heartbeat.AskLeader:input_type -> greptime.v1.meta.AskLeaderRequest + 3, // 14: greptime.v1.meta.Heartbeat.Heartbeat:output_type -> greptime.v1.meta.HeartbeatResponse + 6, // 15: greptime.v1.meta.Heartbeat.AskLeader:output_type -> greptime.v1.meta.AskLeaderResponse + 14, // [14:16] is the sub-list for method output_type + 12, // [12:14] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_greptime_v1_meta_heartbeat_proto_init() } @@ -828,13 +894,14 @@ func file_greptime_v1_meta_heartbeat_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_greptime_v1_meta_heartbeat_proto_rawDesc, - NumEnums: 0, + NumEnums: 1, NumMessages: 7, NumExtensions: 0, NumServices: 1, }, GoTypes: file_greptime_v1_meta_heartbeat_proto_goTypes, DependencyIndexes: file_greptime_v1_meta_heartbeat_proto_depIdxs, + EnumInfos: file_greptime_v1_meta_heartbeat_proto_enumTypes, MessageInfos: file_greptime_v1_meta_heartbeat_proto_msgTypes, }.Build() File_greptime_v1_meta_heartbeat_proto = out.File diff --git a/java/src/main/java/greptime/v1/meta/HeartbeatOuterClass.java b/java/src/main/java/greptime/v1/meta/HeartbeatOuterClass.java index c07a7d51..89384123 100644 --- a/java/src/main/java/greptime/v1/meta/HeartbeatOuterClass.java +++ b/java/src/main/java/greptime/v1/meta/HeartbeatOuterClass.java @@ -14,6 +14,130 @@ public static void registerAllExtensions( registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } + /** + * Protobuf enum {@code greptime.v1.meta.RegionRole} + */ + public enum RegionRole + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Writable region(mito2), Readonly region(file).
+     * 
+ * + * Leader = 0; + */ + Leader(0), + /** + *
+     * Readonly region.
+     * 
+ * + * Follower = 1; + */ + Follower(1), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Writable region(mito2), Readonly region(file).
+     * 
+ * + * Leader = 0; + */ + public static final int Leader_VALUE = 0; + /** + *
+     * Readonly region.
+     * 
+ * + * Follower = 1; + */ + public static final int Follower_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RegionRole valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RegionRole forNumber(int value) { + switch (value) { + case 0: return Leader; + case 1: return Follower; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + RegionRole> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RegionRole findValueByNumber(int number) { + return RegionRole.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return greptime.v1.meta.HeartbeatOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final RegionRole[] VALUES = values(); + + public static RegionRole valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RegionRole(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:greptime.v1.meta.RegionRole) + } + public interface HeartbeatRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:greptime.v1.meta.HeartbeatRequest) com.google.protobuf.MessageOrBuilder { @@ -2164,6 +2288,25 @@ public interface RegionStatOrBuilder extends */ com.google.protobuf.ByteString getEngineBytes(); + + /** + *
+     * Region role
+     * 
+ * + * .greptime.v1.meta.RegionRole role = 7; + * @return The enum numeric value on the wire for role. + */ + int getRoleValue(); + /** + *
+     * Region role
+     * 
+ * + * .greptime.v1.meta.RegionRole role = 7; + * @return The role. + */ + greptime.v1.meta.HeartbeatOuterClass.RegionRole getRole(); } /** * Protobuf type {@code greptime.v1.meta.RegionStat} @@ -2179,6 +2322,7 @@ private RegionStat(com.google.protobuf.GeneratedMessageV3.Builder builder) { } private RegionStat() { engine_ = ""; + role_ = 0; } @java.lang.Override @@ -2242,6 +2386,12 @@ private RegionStat( engine_ = s; break; } + case 56: { + int rawValue = input.readEnum(); + + role_ = rawValue; + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -2393,6 +2543,33 @@ public java.lang.String getEngine() { } } + public static final int ROLE_FIELD_NUMBER = 7; + private int role_; + /** + *
+     * Region role
+     * 
+ * + * .greptime.v1.meta.RegionRole role = 7; + * @return The enum numeric value on the wire for role. + */ + @java.lang.Override public int getRoleValue() { + return role_; + } + /** + *
+     * Region role
+     * 
+ * + * .greptime.v1.meta.RegionRole role = 7; + * @return The role. + */ + @java.lang.Override public greptime.v1.meta.HeartbeatOuterClass.RegionRole getRole() { + @SuppressWarnings("deprecation") + greptime.v1.meta.HeartbeatOuterClass.RegionRole result = greptime.v1.meta.HeartbeatOuterClass.RegionRole.valueOf(role_); + return result == null ? greptime.v1.meta.HeartbeatOuterClass.RegionRole.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -2425,6 +2602,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(engine_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, engine_); } + if (role_ != greptime.v1.meta.HeartbeatOuterClass.RegionRole.Leader.getNumber()) { + output.writeEnum(7, role_); + } unknownFields.writeTo(output); } @@ -2457,6 +2637,10 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(engine_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, engine_); } + if (role_ != greptime.v1.meta.HeartbeatOuterClass.RegionRole.Leader.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(7, role_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -2484,6 +2668,7 @@ public boolean equals(final java.lang.Object obj) { != other.getApproximateRows()) return false; if (!getEngine() .equals(other.getEngine())) return false; + if (role_ != other.role_) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -2512,6 +2697,8 @@ public int hashCode() { getApproximateRows()); hash = (37 * hash) + ENGINE_FIELD_NUMBER; hash = (53 * hash) + getEngine().hashCode(); + hash = (37 * hash) + ROLE_FIELD_NUMBER; + hash = (53 * hash) + role_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -2657,6 +2844,8 @@ public Builder clear() { engine_ = ""; + role_ = 0; + return this; } @@ -2689,6 +2878,7 @@ public greptime.v1.meta.HeartbeatOuterClass.RegionStat buildPartial() { result.approximateBytes_ = approximateBytes_; result.approximateRows_ = approximateRows_; result.engine_ = engine_; + result.role_ = role_; onBuilt(); return result; } @@ -2756,6 +2946,9 @@ public Builder mergeFrom(greptime.v1.meta.HeartbeatOuterClass.RegionStat other) engine_ = other.engine_; onChanged(); } + if (other.role_ != 0) { + setRoleValue(other.getRoleValue()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -3083,6 +3276,80 @@ public Builder setEngineBytes( onChanged(); return this; } + + private int role_ = 0; + /** + *
+       * Region role
+       * 
+ * + * .greptime.v1.meta.RegionRole role = 7; + * @return The enum numeric value on the wire for role. + */ + @java.lang.Override public int getRoleValue() { + return role_; + } + /** + *
+       * Region role
+       * 
+ * + * .greptime.v1.meta.RegionRole role = 7; + * @param value The enum numeric value on the wire for role to set. + * @return This builder for chaining. + */ + public Builder setRoleValue(int value) { + + role_ = value; + onChanged(); + return this; + } + /** + *
+       * Region role
+       * 
+ * + * .greptime.v1.meta.RegionRole role = 7; + * @return The role. + */ + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.RegionRole getRole() { + @SuppressWarnings("deprecation") + greptime.v1.meta.HeartbeatOuterClass.RegionRole result = greptime.v1.meta.HeartbeatOuterClass.RegionRole.valueOf(role_); + return result == null ? greptime.v1.meta.HeartbeatOuterClass.RegionRole.UNRECOGNIZED : result; + } + /** + *
+       * Region role
+       * 
+ * + * .greptime.v1.meta.RegionRole role = 7; + * @param value The role to set. + * @return This builder for chaining. + */ + public Builder setRole(greptime.v1.meta.HeartbeatOuterClass.RegionRole value) { + if (value == null) { + throw new NullPointerException(); + } + + role_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * Region role
+       * 
+ * + * .greptime.v1.meta.RegionRole role = 7; + * @return This builder for chaining. + */ + public Builder clearRole() { + + role_ = 0; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -7792,31 +8059,33 @@ public greptime.v1.meta.HeartbeatOuterClass.MailboxMessage getDefaultInstanceFor "e.v1.meta.RegionStat\0229\n\017mailbox_message\030" + "\005 \001(\0132 .greptime.v1.meta.MailboxMessage\022" + "\034\n\024duration_since_epoch\030\006 \001(\004\022\022\n\nnode_ep" + - "och\030\007 \001(\004\"\200\001\n\nRegionStat\022\021\n\tregion_id\030\001 " + + "och\030\007 \001(\004\"\254\001\n\nRegionStat\022\021\n\tregion_id\030\001 " + "\001(\004\022\014\n\004rcus\030\002 \001(\003\022\014\n\004wcus\030\003 \001(\003\022\031\n\021appro" + "ximate_bytes\030\004 \001(\003\022\030\n\020approximate_rows\030\005" + - " \001(\003\022\016\n\006engine\030\006 \001(\t\"\265\001\n\021HeartbeatRespon" + - "se\0220\n\006header\030\001 \001(\0132 .greptime.v1.meta.Re" + - "sponseHeader\0229\n\017mailbox_message\030\002 \001(\0132 ." + - "greptime.v1.meta.MailboxMessage\0223\n\014regio" + - "n_lease\030\003 \001(\0132\035.greptime.v1.meta.RegionL" + - "ease\"V\n\013RegionLease\022\022\n\nregion_ids\030\001 \003(\004\022" + - "\034\n\024duration_since_epoch\030\002 \001(\004\022\025\n\rlease_s" + - "econds\030\003 \001(\004\"C\n\020AskLeaderRequest\022/\n\006head" + - "er\030\001 \001(\0132\037.greptime.v1.meta.RequestHeade" + - "r\"m\n\021AskLeaderResponse\0220\n\006header\030\001 \001(\0132 " + - ".greptime.v1.meta.ResponseHeader\022&\n\006lead" + - "er\030\002 \001(\0132\026.greptime.v1.meta.Peer\"|\n\016Mail" + - "boxMessage\022\n\n\002id\030\001 \001(\004\022\017\n\007subject\030\002 \001(\t\022" + - "\014\n\004from\030\003 \001(\t\022\n\n\002to\030\004 \001(\t\022\030\n\020timestamp_m" + - "illis\030\005 \001(\003\022\016\n\004json\030\006 \001(\tH\000B\t\n\007payload2\277" + - "\001\n\tHeartbeat\022Z\n\tHeartbeat\022\".greptime.v1." + - "meta.HeartbeatRequest\032#.greptime.v1.meta" + - ".HeartbeatResponse\"\000(\0010\001\022V\n\tAskLeader\022\"." + - "greptime.v1.meta.AskLeaderRequest\032#.grep" + - "time.v1.meta.AskLeaderResponse\"\000B