From c574bedfe38e45ae2fe7e283dd51abae5b9164b8 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Wed, 25 Sep 2024 12:44:17 +0000 Subject: [PATCH] refactor: introduce `RegionRoleState` --- c++/greptime/v1/meta/heartbeat.pb.cc | 581 ++++-- c++/greptime/v1/meta/heartbeat.pb.h | 622 ++++++- go/greptime/v1/meta/heartbeat.pb.go | 575 +++--- .../greptime/v1/meta/HeartbeatOuterClass.java | 1651 ++++++++++++++--- proto/greptime/v1/meta/heartbeat.proto | 25 +- 5 files changed, 2762 insertions(+), 692 deletions(-) diff --git a/c++/greptime/v1/meta/heartbeat.pb.cc b/c++/greptime/v1/meta/heartbeat.pb.cc index b7e6607e..7bbe4698 100644 --- a/c++/greptime/v1/meta/heartbeat.pb.cc +++ b/c++/greptime/v1/meta/heartbeat.pb.cc @@ -43,6 +43,20 @@ struct HeartbeatRequestDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HeartbeatRequestDefaultTypeInternal _HeartbeatRequest_default_instance_; +PROTOBUF_CONSTEXPR RegionRoleState::RegionRoleState( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.role_state_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{}} {} +struct RegionRoleStateDefaultTypeInternal { + PROTOBUF_CONSTEXPR RegionRoleStateDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~RegionRoleStateDefaultTypeInternal() {} + union { + RegionRoleState _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RegionRoleStateDefaultTypeInternal _RegionRoleState_default_instance_; PROTOBUF_CONSTEXPR NodeInfo::NodeInfo( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.version_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} @@ -73,11 +87,11 @@ PROTOBUF_CONSTEXPR RegionStat::RegionStat( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.extensions_)*/{::_pbi::ConstantInitialized()} , /*decltype(_impl_.engine_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.role_state_)*/nullptr , /*decltype(_impl_.region_id_)*/uint64_t{0u} , /*decltype(_impl_.rcus_)*/int64_t{0} , /*decltype(_impl_.wcus_)*/int64_t{0} , /*decltype(_impl_.approximate_bytes_)*/int64_t{0} - , /*decltype(_impl_.role_)*/0 , /*decltype(_impl_._cached_size_)*/{}} {} struct RegionStatDefaultTypeInternal { PROTOBUF_CONSTEXPR RegionStatDefaultTypeInternal() @@ -105,8 +119,8 @@ struct HeartbeatResponseDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HeartbeatResponseDefaultTypeInternal _HeartbeatResponse_default_instance_; PROTOBUF_CONSTEXPR GrantedRegion::GrantedRegion( ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.region_id_)*/uint64_t{0u} - , /*decltype(_impl_.role_)*/0 + /*decltype(_impl_.role_state_)*/nullptr + , /*decltype(_impl_.region_id_)*/uint64_t{0u} , /*decltype(_impl_._cached_size_)*/{}} {} struct GrantedRegionDefaultTypeInternal { PROTOBUF_CONSTEXPR GrantedRegionDefaultTypeInternal() @@ -183,8 +197,8 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORIT } // namespace meta } // namespace v1 } // namespace greptime -static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[10]; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2fmeta_2fheartbeat_2eproto[1]; +static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[11]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2fmeta_2fheartbeat_2eproto[2]; 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) = { @@ -203,6 +217,15 @@ const uint32_t TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto::offsets[] P PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatRequest, _impl_.node_epoch_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatRequest, _impl_.info_), ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionRoleState, _internal_metadata_), + ~0u, // no _extensions_ + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionRoleState, _impl_._oneof_case_[0]), + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionRoleState, _impl_.role_state_), + ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::NodeInfo, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -232,7 +255,7 @@ const uint32_t TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto::offsets[] P PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.wcus_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.approximate_bytes_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.engine_), - PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.role_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.role_state_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionStat, _impl_.extensions_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatResponse, _internal_metadata_), @@ -250,7 +273,7 @@ const uint32_t TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto::offsets[] P ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::GrantedRegion, _impl_.region_id_), - PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::GrantedRegion, _impl_.role_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::GrantedRegion, _impl_.role_state_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionLease, _internal_metadata_), ~0u, // no _extensions_ @@ -292,19 +315,21 @@ 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)}, - { 14, -1, -1, sizeof(::greptime::v1::meta::NodeInfo)}, - { 23, 31, -1, sizeof(::greptime::v1::meta::RegionStat_ExtensionsEntry_DoNotUse)}, - { 33, -1, -1, sizeof(::greptime::v1::meta::RegionStat)}, - { 46, -1, -1, sizeof(::greptime::v1::meta::HeartbeatResponse)}, - { 55, -1, -1, sizeof(::greptime::v1::meta::GrantedRegion)}, - { 63, -1, -1, sizeof(::greptime::v1::meta::RegionLease)}, - { 73, -1, -1, sizeof(::greptime::v1::meta::AskLeaderRequest)}, - { 80, -1, -1, sizeof(::greptime::v1::meta::AskLeaderResponse)}, - { 88, -1, -1, sizeof(::greptime::v1::meta::MailboxMessage)}, + { 14, -1, -1, sizeof(::greptime::v1::meta::RegionRoleState)}, + { 23, -1, -1, sizeof(::greptime::v1::meta::NodeInfo)}, + { 32, 40, -1, sizeof(::greptime::v1::meta::RegionStat_ExtensionsEntry_DoNotUse)}, + { 42, -1, -1, sizeof(::greptime::v1::meta::RegionStat)}, + { 55, -1, -1, sizeof(::greptime::v1::meta::HeartbeatResponse)}, + { 64, -1, -1, sizeof(::greptime::v1::meta::GrantedRegion)}, + { 72, -1, -1, sizeof(::greptime::v1::meta::RegionLease)}, + { 82, -1, -1, sizeof(::greptime::v1::meta::AskLeaderRequest)}, + { 89, -1, -1, sizeof(::greptime::v1::meta::AskLeaderResponse)}, + { 97, -1, -1, sizeof(::greptime::v1::meta::MailboxMessage)}, }; static const ::_pb::Message* const file_default_instances[] = { &::greptime::v1::meta::_HeartbeatRequest_default_instance_._instance, + &::greptime::v1::meta::_RegionRoleState_default_instance_._instance, &::greptime::v1::meta::_NodeInfo_default_instance_._instance, &::greptime::v1::meta::_RegionStat_ExtensionsEntry_DoNotUse_default_instance_._instance, &::greptime::v1::meta::_RegionStat_default_instance_._instance, @@ -328,50 +353,56 @@ const char descriptor_table_protodef_greptime_2fv1_2fmeta_2fheartbeat_2eproto[] "\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\022(\n\004info\030\010 \001(\0132\032.greptime.v1.me" - "ta.NodeInfo\"F\n\010NodeInfo\022\017\n\007version\030\001 \001(\t" - "\022\022\n\ngit_commit\030\002 \001(\t\022\025\n\rstart_time_ms\030\003 " - "\001(\004\"\207\002\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\021approximate" - "_bytes\030\004 \001(\003\022\016\n\006engine\030\006 \001(\t\022*\n\004role\030\007 \001" - "(\0162\034.greptime.v1.meta.RegionRole\022@\n\nexte" - "nsions\030c \003(\0132,.greptime.v1.meta.RegionSt" - "at.ExtensionsEntry\0321\n\017ExtensionsEntry\022\013\n" - "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\014:\0028\001\"\265\001\n\021Heartb" - "eatResponse\0220\n\006header\030\001 \001(\0132 .greptime.v" - "1.meta.ResponseHeader\0229\n\017mailbox_message" - "\030\002 \001(\0132 .greptime.v1.meta.MailboxMessage" - "\0223\n\014region_lease\030\003 \001(\0132\035.greptime.v1.met" - "a.RegionLease\"N\n\rGrantedRegion\022\021\n\tregion" - "_id\030\001 \001(\004\022*\n\004role\030\002 \001(\0162\034.greptime.v1.me" - "ta.RegionRole\"\222\001\n\013RegionLease\0220\n\007regions" - "\030\001 \003(\0132\037.greptime.v1.meta.GrantedRegion\022" - "\034\n\024duration_since_epoch\030\002 \001(\004\022\025\n\rlease_s" - "econds\030\003 \001(\004\022\034\n\024closeable_region_ids\030\004 \003" - "(\004\"C\n\020AskLeaderRequest\022/\n\006header\030\001 \001(\0132\037" - ".greptime.v1.meta.RequestHeader\"m\n\021AskLe" - "aderResponse\0220\n\006header\030\001 \001(\0132 .greptime." - "v1.meta.ResponseHeader\022&\n\006leader\030\002 \001(\0132\026" - ".greptime.v1.meta.Peer\"|\n\016MailboxMessage" - "\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_millis\030\005 \001(" - "\003\022\016\n\004json\030\006 \001(\tH\000B\t\n\007payload*&\n\nRegionRo" - "le\022\n\n\006Leader\020\000\022\014\n\010Follower\020\0012\277\001\n\tHeartbe" - "at\022Z\n\tHeartbeat\022\".greptime.v1.meta.Heart" - "beatRequest\032#.greptime.v1.meta.Heartbeat" - "Response\"\000(\0010\001\022V\n\tAskLeader\022\".greptime.v" - "1.meta.AskLeaderRequest\032#.greptime.v1.me" - "ta.AskLeaderResponse\"\000B(from._internal_metadata_); + clear_has_role_state(); + switch (from.role_state_case()) { + case kLeaderState: { + _this->_internal_set_leader_state(from._internal_leader_state()); + break; + } + case kFollowerState: { + _this->_internal_set_follower_state(from._internal_follower_state()); + break; + } + case ROLE_STATE_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.RegionRoleState) +} + +inline void RegionRoleState::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.role_state_){} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{} + }; + clear_has_role_state(); +} + +RegionRoleState::~RegionRoleState() { + // @@protoc_insertion_point(destructor:greptime.v1.meta.RegionRoleState) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void RegionRoleState::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (has_role_state()) { + clear_role_state(); + } +} + +void RegionRoleState::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void RegionRoleState::clear_role_state() { +// @@protoc_insertion_point(one_of_clear_start:greptime.v1.meta.RegionRoleState) + switch (role_state_case()) { + case kLeaderState: { + // No need to clear + break; + } + case kFollowerState: { + // No need to clear + break; + } + case ROLE_STATE_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = ROLE_STATE_NOT_SET; +} + + +void RegionRoleState::Clear() { +// @@protoc_insertion_point(message_clear_start:greptime.v1.meta.RegionRoleState) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_role_state(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* RegionRoleState::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .greptime.v1.meta.RegionLeaderState leader_state = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_leader_state(static_cast<::greptime::v1::meta::RegionLeaderState>(val)); + } else + goto handle_unusual; + continue; + // .greptime.v1.meta.RegionLeaderState follower_state = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_follower_state(static_cast<::greptime::v1::meta::RegionLeaderState>(val)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* RegionRoleState::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.RegionRoleState) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .greptime.v1.meta.RegionLeaderState leader_state = 1; + if (_internal_has_leader_state()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_leader_state(), target); + } + + // .greptime.v1.meta.RegionLeaderState follower_state = 2; + if (_internal_has_follower_state()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this->_internal_follower_state(), 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); + } + // @@protoc_insertion_point(serialize_to_array_end:greptime.v1.meta.RegionRoleState) + return target; +} + +size_t RegionRoleState::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.RegionRoleState) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + switch (role_state_case()) { + // .greptime.v1.meta.RegionLeaderState leader_state = 1; + case kLeaderState: { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_leader_state()); + break; + } + // .greptime.v1.meta.RegionLeaderState follower_state = 2; + case kFollowerState: { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_follower_state()); + break; + } + case ROLE_STATE_NOT_SET: { + break; + } + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData RegionRoleState::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + RegionRoleState::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*RegionRoleState::GetClassData() const { return &_class_data_; } + + +void RegionRoleState::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.meta.RegionRoleState) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.role_state_case()) { + case kLeaderState: { + _this->_internal_set_leader_state(from._internal_leader_state()); + break; + } + case kFollowerState: { + _this->_internal_set_follower_state(from._internal_follower_state()); + break; + } + case ROLE_STATE_NOT_SET: { + break; + } + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void RegionRoleState::CopyFrom(const RegionRoleState& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.meta.RegionRoleState) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool RegionRoleState::IsInitialized() const { + return true; +} + +void RegionRoleState::InternalSwap(RegionRoleState* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.role_state_, other->_impl_.role_state_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); +} + +::PROTOBUF_NAMESPACE_ID::Metadata RegionRoleState::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once, + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[1]); +} + +// =================================================================== + class NodeInfo::_Internal { public: }; @@ -1145,7 +1446,7 @@ void NodeInfo::InternalSwap(NodeInfo* other) { ::PROTOBUF_NAMESPACE_ID::Metadata NodeInfo::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[1]); + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[2]); } // =================================================================== @@ -1159,15 +1460,20 @@ void RegionStat_ExtensionsEntry_DoNotUse::MergeFrom(const RegionStat_ExtensionsE ::PROTOBUF_NAMESPACE_ID::Metadata RegionStat_ExtensionsEntry_DoNotUse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[2]); + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[3]); } // =================================================================== class RegionStat::_Internal { public: + static const ::greptime::v1::meta::RegionRoleState& role_state(const RegionStat* msg); }; +const ::greptime::v1::meta::RegionRoleState& +RegionStat::_Internal::role_state(const RegionStat* msg) { + return *msg->_impl_.role_state_; +} RegionStat::RegionStat(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { @@ -1183,11 +1489,11 @@ RegionStat::RegionStat(const RegionStat& from) new (&_impl_) Impl_{ /*decltype(_impl_.extensions_)*/{} , decltype(_impl_.engine_){} + , decltype(_impl_.role_state_){nullptr} , decltype(_impl_.region_id_){} , decltype(_impl_.rcus_){} , decltype(_impl_.wcus_){} , decltype(_impl_.approximate_bytes_){} - , decltype(_impl_.role_){} , /*decltype(_impl_._cached_size_)*/{}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); @@ -1200,9 +1506,12 @@ RegionStat::RegionStat(const RegionStat& from) _this->_impl_.engine_.Set(from._internal_engine(), _this->GetArenaForAllocation()); } + if (from._internal_has_role_state()) { + _this->_impl_.role_state_ = new ::greptime::v1::meta::RegionRoleState(*from._impl_.role_state_); + } ::memcpy(&_impl_.region_id_, &from._impl_.region_id_, - static_cast(reinterpret_cast(&_impl_.role_) - - reinterpret_cast(&_impl_.region_id_)) + sizeof(_impl_.role_)); + static_cast(reinterpret_cast(&_impl_.approximate_bytes_) - + reinterpret_cast(&_impl_.region_id_)) + sizeof(_impl_.approximate_bytes_)); // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.RegionStat) } @@ -1213,11 +1522,11 @@ inline void RegionStat::SharedCtor( new (&_impl_) Impl_{ /*decltype(_impl_.extensions_)*/{::_pbi::ArenaInitialized(), arena} , decltype(_impl_.engine_){} + , decltype(_impl_.role_state_){nullptr} , decltype(_impl_.region_id_){uint64_t{0u}} , decltype(_impl_.rcus_){int64_t{0}} , decltype(_impl_.wcus_){int64_t{0}} , decltype(_impl_.approximate_bytes_){int64_t{0}} - , decltype(_impl_.role_){0} , /*decltype(_impl_._cached_size_)*/{} }; _impl_.engine_.InitDefault(); @@ -1241,6 +1550,7 @@ inline void RegionStat::SharedDtor() { _impl_.extensions_.Destruct(); _impl_.extensions_.~MapField(); _impl_.engine_.Destroy(); + if (this != internal_default_instance()) delete _impl_.role_state_; } void RegionStat::ArenaDtor(void* object) { @@ -1259,9 +1569,13 @@ void RegionStat::Clear() { _impl_.extensions_.Clear(); _impl_.engine_.ClearToEmpty(); + if (GetArenaForAllocation() == nullptr && _impl_.role_state_ != nullptr) { + delete _impl_.role_state_; + } + _impl_.role_state_ = nullptr; ::memset(&_impl_.region_id_, 0, static_cast( - reinterpret_cast(&_impl_.role_) - - reinterpret_cast(&_impl_.region_id_)) + sizeof(_impl_.role_)); + reinterpret_cast(&_impl_.approximate_bytes_) - + reinterpret_cast(&_impl_.region_id_)) + sizeof(_impl_.approximate_bytes_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -1313,12 +1627,11 @@ const char* RegionStat::_InternalParse(const char* ptr, ::_pbi::ParseContext* ct } else goto handle_unusual; continue; - // .greptime.v1.meta.RegionRole role = 7; + // .greptime.v1.meta.RegionRoleState role_state = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + ptr = ctx->ParseMessage(_internal_mutable_role_state(), ptr); CHK_(ptr); - _internal_set_role(static_cast<::greptime::v1::meta::RegionRole>(val)); } else goto handle_unusual; continue; @@ -1398,11 +1711,11 @@ 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); + // .greptime.v1.meta.RegionRoleState role_state = 7; + if (this->_internal_has_role_state()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(7, _Internal::role_state(this), + _Internal::role_state(this).GetCachedSize(), target, stream); } // map extensions = 99; @@ -1463,6 +1776,13 @@ size_t RegionStat::ByteSizeLong() const { this->_internal_engine()); } + // .greptime.v1.meta.RegionRoleState role_state = 7; + if (this->_internal_has_role_state()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.role_state_); + } + // uint64 region_id = 1; if (this->_internal_region_id() != 0) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_region_id()); @@ -1483,12 +1803,6 @@ size_t RegionStat::ByteSizeLong() const { total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_approximate_bytes()); } - // .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_); } @@ -1511,6 +1825,10 @@ void RegionStat::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PRO if (!from._internal_engine().empty()) { _this->_internal_set_engine(from._internal_engine()); } + if (from._internal_has_role_state()) { + _this->_internal_mutable_role_state()->::greptime::v1::meta::RegionRoleState::MergeFrom( + from._internal_role_state()); + } if (from._internal_region_id() != 0) { _this->_internal_set_region_id(from._internal_region_id()); } @@ -1523,9 +1841,6 @@ void RegionStat::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PRO if (from._internal_approximate_bytes() != 0) { _this->_internal_set_approximate_bytes(from._internal_approximate_bytes()); } - if (from._internal_role() != 0) { - _this->_internal_set_role(from._internal_role()); - } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -1551,17 +1866,17 @@ void RegionStat::InternalSwap(RegionStat* other) { &other->_impl_.engine_, rhs_arena ); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - 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_)); + PROTOBUF_FIELD_OFFSET(RegionStat, _impl_.approximate_bytes_) + + sizeof(RegionStat::_impl_.approximate_bytes_) + - PROTOBUF_FIELD_OFFSET(RegionStat, _impl_.role_state_)>( + reinterpret_cast(&_impl_.role_state_), + reinterpret_cast(&other->_impl_.role_state_)); } ::PROTOBUF_NAMESPACE_ID::Metadata RegionStat::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[3]); + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[4]); } // =================================================================== @@ -1847,15 +2162,20 @@ void HeartbeatResponse::InternalSwap(HeartbeatResponse* other) { ::PROTOBUF_NAMESPACE_ID::Metadata HeartbeatResponse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[4]); + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[5]); } // =================================================================== class GrantedRegion::_Internal { public: + static const ::greptime::v1::meta::RegionRoleState& role_state(const GrantedRegion* msg); }; +const ::greptime::v1::meta::RegionRoleState& +GrantedRegion::_Internal::role_state(const GrantedRegion* msg) { + return *msg->_impl_.role_state_; +} GrantedRegion::GrantedRegion(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { @@ -1866,14 +2186,15 @@ GrantedRegion::GrantedRegion(const GrantedRegion& from) : ::PROTOBUF_NAMESPACE_ID::Message() { GrantedRegion* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.region_id_){} - , decltype(_impl_.role_){} + decltype(_impl_.role_state_){nullptr} + , decltype(_impl_.region_id_){} , /*decltype(_impl_._cached_size_)*/{}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.region_id_, &from._impl_.region_id_, - static_cast(reinterpret_cast(&_impl_.role_) - - reinterpret_cast(&_impl_.region_id_)) + sizeof(_impl_.role_)); + if (from._internal_has_role_state()) { + _this->_impl_.role_state_ = new ::greptime::v1::meta::RegionRoleState(*from._impl_.role_state_); + } + _this->_impl_.region_id_ = from._impl_.region_id_; // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.GrantedRegion) } @@ -1882,8 +2203,8 @@ inline void GrantedRegion::SharedCtor( (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.region_id_){uint64_t{0u}} - , decltype(_impl_.role_){0} + decltype(_impl_.role_state_){nullptr} + , decltype(_impl_.region_id_){uint64_t{0u}} , /*decltype(_impl_._cached_size_)*/{} }; } @@ -1899,6 +2220,7 @@ GrantedRegion::~GrantedRegion() { inline void GrantedRegion::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete _impl_.role_state_; } void GrantedRegion::SetCachedSize(int size) const { @@ -1911,9 +2233,11 @@ void GrantedRegion::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - ::memset(&_impl_.region_id_, 0, static_cast( - reinterpret_cast(&_impl_.role_) - - reinterpret_cast(&_impl_.region_id_)) + sizeof(_impl_.role_)); + if (GetArenaForAllocation() == nullptr && _impl_.role_state_ != nullptr) { + delete _impl_.role_state_; + } + _impl_.role_state_ = nullptr; + _impl_.region_id_ = uint64_t{0u}; _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -1931,12 +2255,11 @@ const char* GrantedRegion::_InternalParse(const char* ptr, ::_pbi::ParseContext* } else goto handle_unusual; continue; - // .greptime.v1.meta.RegionRole role = 2; + // .greptime.v1.meta.RegionRoleState role_state = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_role_state(), ptr); CHK_(ptr); - _internal_set_role(static_cast<::greptime::v1::meta::RegionRole>(val)); } else goto handle_unusual; continue; @@ -1975,11 +2298,11 @@ uint8_t* GrantedRegion::_InternalSerialize( target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_region_id(), target); } - // .greptime.v1.meta.RegionRole role = 2; - if (this->_internal_role() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 2, this->_internal_role(), target); + // .greptime.v1.meta.RegionRoleState role_state = 2; + if (this->_internal_has_role_state()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::role_state(this), + _Internal::role_state(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -1998,17 +2321,18 @@ size_t GrantedRegion::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + // .greptime.v1.meta.RegionRoleState role_state = 2; + if (this->_internal_has_role_state()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.role_state_); + } + // uint64 region_id = 1; if (this->_internal_region_id() != 0) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_region_id()); } - // .greptime.v1.meta.RegionRole role = 2; - if (this->_internal_role() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_role()); - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -2027,12 +2351,13 @@ void GrantedRegion::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const :: uint32_t cached_has_bits = 0; (void) cached_has_bits; + if (from._internal_has_role_state()) { + _this->_internal_mutable_role_state()->::greptime::v1::meta::RegionRoleState::MergeFrom( + from._internal_role_state()); + } if (from._internal_region_id() != 0) { _this->_internal_set_region_id(from._internal_region_id()); } - if (from._internal_role() != 0) { - _this->_internal_set_role(from._internal_role()); - } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -2051,17 +2376,17 @@ void GrantedRegion::InternalSwap(GrantedRegion* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(GrantedRegion, _impl_.role_) - + sizeof(GrantedRegion::_impl_.role_) - - PROTOBUF_FIELD_OFFSET(GrantedRegion, _impl_.region_id_)>( - reinterpret_cast(&_impl_.region_id_), - reinterpret_cast(&other->_impl_.region_id_)); + PROTOBUF_FIELD_OFFSET(GrantedRegion, _impl_.region_id_) + + sizeof(GrantedRegion::_impl_.region_id_) + - PROTOBUF_FIELD_OFFSET(GrantedRegion, _impl_.role_state_)>( + reinterpret_cast(&_impl_.role_state_), + reinterpret_cast(&other->_impl_.role_state_)); } ::PROTOBUF_NAMESPACE_ID::Metadata GrantedRegion::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[5]); + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[6]); } // =================================================================== @@ -2348,7 +2673,7 @@ void RegionLease::InternalSwap(RegionLease* other) { ::PROTOBUF_NAMESPACE_ID::Metadata RegionLease::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[6]); + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[7]); } // =================================================================== @@ -2547,7 +2872,7 @@ void AskLeaderRequest::InternalSwap(AskLeaderRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata AskLeaderRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[7]); + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[8]); } // =================================================================== @@ -2798,7 +3123,7 @@ void AskLeaderResponse::InternalSwap(AskLeaderResponse* other) { ::PROTOBUF_NAMESPACE_ID::Metadata AskLeaderResponse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[8]); + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[9]); } // =================================================================== @@ -3238,7 +3563,7 @@ void MailboxMessage::InternalSwap(MailboxMessage* other) { ::PROTOBUF_NAMESPACE_ID::Metadata MailboxMessage::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[9]); + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[10]); } // @@protoc_insertion_point(namespace_scope) @@ -3250,6 +3575,10 @@ template<> PROTOBUF_NOINLINE ::greptime::v1::meta::HeartbeatRequest* Arena::CreateMaybeMessage< ::greptime::v1::meta::HeartbeatRequest >(Arena* arena) { return Arena::CreateMessageInternal< ::greptime::v1::meta::HeartbeatRequest >(arena); } +template<> PROTOBUF_NOINLINE ::greptime::v1::meta::RegionRoleState* +Arena::CreateMaybeMessage< ::greptime::v1::meta::RegionRoleState >(Arena* arena) { + return Arena::CreateMessageInternal< ::greptime::v1::meta::RegionRoleState >(arena); +} template<> PROTOBUF_NOINLINE ::greptime::v1::meta::NodeInfo* Arena::CreateMaybeMessage< ::greptime::v1::meta::NodeInfo >(Arena* arena) { return Arena::CreateMessageInternal< ::greptime::v1::meta::NodeInfo >(arena); diff --git a/c++/greptime/v1/meta/heartbeat.pb.h b/c++/greptime/v1/meta/heartbeat.pb.h index ce72d075..afbfdca1 100644 --- a/c++/greptime/v1/meta/heartbeat.pb.h +++ b/c++/greptime/v1/meta/heartbeat.pb.h @@ -76,6 +76,9 @@ extern NodeInfoDefaultTypeInternal _NodeInfo_default_instance_; class RegionLease; struct RegionLeaseDefaultTypeInternal; extern RegionLeaseDefaultTypeInternal _RegionLease_default_instance_; +class RegionRoleState; +struct RegionRoleStateDefaultTypeInternal; +extern RegionRoleStateDefaultTypeInternal _RegionRoleState_default_instance_; class RegionStat; struct RegionStatDefaultTypeInternal; extern RegionStatDefaultTypeInternal _RegionStat_default_instance_; @@ -94,6 +97,7 @@ template<> ::greptime::v1::meta::HeartbeatResponse* Arena::CreateMaybeMessage<:: template<> ::greptime::v1::meta::MailboxMessage* Arena::CreateMaybeMessage<::greptime::v1::meta::MailboxMessage>(Arena*); template<> ::greptime::v1::meta::NodeInfo* Arena::CreateMaybeMessage<::greptime::v1::meta::NodeInfo>(Arena*); template<> ::greptime::v1::meta::RegionLease* Arena::CreateMaybeMessage<::greptime::v1::meta::RegionLease>(Arena*); +template<> ::greptime::v1::meta::RegionRoleState* Arena::CreateMaybeMessage<::greptime::v1::meta::RegionRoleState>(Arena*); template<> ::greptime::v1::meta::RegionStat* Arena::CreateMaybeMessage<::greptime::v1::meta::RegionStat>(Arena*); template<> ::greptime::v1::meta::RegionStat_ExtensionsEntry_DoNotUse* Arena::CreateMaybeMessage<::greptime::v1::meta::RegionStat_ExtensionsEntry_DoNotUse>(Arena*); PROTOBUF_NAMESPACE_CLOSE @@ -101,30 +105,54 @@ 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() +enum RegionLeaderState : int { + Writable = 0, + Downgrading = 1, + RegionLeaderState_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + RegionLeaderState_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; +bool RegionLeaderState_IsValid(int value); +constexpr RegionLeaderState RegionLeaderState_MIN = Writable; +constexpr RegionLeaderState RegionLeaderState_MAX = Downgrading; +constexpr int RegionLeaderState_ARRAYSIZE = RegionLeaderState_MAX + 1; -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RegionRole_descriptor(); +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RegionLeaderState_descriptor(); template -inline const std::string& RegionRole_Name(T enum_t_value) { - static_assert(::std::is_same::value || +inline const std::string& RegionLeaderState_Name(T enum_t_value) { + static_assert(::std::is_same::value || ::std::is_integral::value, - "Incorrect type passed to function RegionRole_Name."); + "Incorrect type passed to function RegionLeaderState_Name."); return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - RegionRole_descriptor(), enum_t_value); + RegionLeaderState_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); +inline bool RegionLeaderState_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, RegionLeaderState* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + RegionLeaderState_descriptor(), name, value); +} +enum RegionFollowerState : int { + Readonly = 0, + RegionFollowerState_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + RegionFollowerState_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool RegionFollowerState_IsValid(int value); +constexpr RegionFollowerState RegionFollowerState_MIN = Readonly; +constexpr RegionFollowerState RegionFollowerState_MAX = Readonly; +constexpr int RegionFollowerState_ARRAYSIZE = RegionFollowerState_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* RegionFollowerState_descriptor(); +template +inline const std::string& RegionFollowerState_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function RegionFollowerState_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + RegionFollowerState_descriptor(), enum_t_value); +} +inline bool RegionFollowerState_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, RegionFollowerState* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + RegionFollowerState_descriptor(), name, value); } // =================================================================== @@ -407,6 +435,192 @@ class HeartbeatRequest final : }; // ------------------------------------------------------------------- +class RegionRoleState final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.meta.RegionRoleState) */ { + public: + inline RegionRoleState() : RegionRoleState(nullptr) {} + ~RegionRoleState() override; + explicit PROTOBUF_CONSTEXPR RegionRoleState(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + RegionRoleState(const RegionRoleState& from); + RegionRoleState(RegionRoleState&& from) noexcept + : RegionRoleState() { + *this = ::std::move(from); + } + + inline RegionRoleState& operator=(const RegionRoleState& from) { + CopyFrom(from); + return *this; + } + inline RegionRoleState& operator=(RegionRoleState&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const RegionRoleState& default_instance() { + return *internal_default_instance(); + } + enum RoleStateCase { + kLeaderState = 1, + kFollowerState = 2, + ROLE_STATE_NOT_SET = 0, + }; + + static inline const RegionRoleState* internal_default_instance() { + return reinterpret_cast( + &_RegionRoleState_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(RegionRoleState& a, RegionRoleState& b) { + a.Swap(&b); + } + inline void Swap(RegionRoleState* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(RegionRoleState* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + RegionRoleState* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const RegionRoleState& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const RegionRoleState& from) { + RegionRoleState::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(RegionRoleState* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "greptime.v1.meta.RegionRoleState"; + } + protected: + explicit RegionRoleState(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kLeaderStateFieldNumber = 1, + kFollowerStateFieldNumber = 2, + }; + // .greptime.v1.meta.RegionLeaderState leader_state = 1; + bool has_leader_state() const; + private: + bool _internal_has_leader_state() const; + public: + void clear_leader_state(); + ::greptime::v1::meta::RegionLeaderState leader_state() const; + void set_leader_state(::greptime::v1::meta::RegionLeaderState value); + private: + ::greptime::v1::meta::RegionLeaderState _internal_leader_state() const; + void _internal_set_leader_state(::greptime::v1::meta::RegionLeaderState value); + public: + + // .greptime.v1.meta.RegionLeaderState follower_state = 2; + bool has_follower_state() const; + private: + bool _internal_has_follower_state() const; + public: + void clear_follower_state(); + ::greptime::v1::meta::RegionLeaderState follower_state() const; + void set_follower_state(::greptime::v1::meta::RegionLeaderState value); + private: + ::greptime::v1::meta::RegionLeaderState _internal_follower_state() const; + void _internal_set_follower_state(::greptime::v1::meta::RegionLeaderState value); + public: + + void clear_role_state(); + RoleStateCase role_state_case() const; + // @@protoc_insertion_point(class_scope:greptime.v1.meta.RegionRoleState) + private: + class _Internal; + void set_has_leader_state(); + void set_has_follower_state(); + + inline bool has_role_state() const; + inline void clear_has_role_state(); + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + union RoleStateUnion { + constexpr RoleStateUnion() : _constinit_{} {} + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; + int leader_state_; + int follower_state_; + } role_state_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + uint32_t _oneof_case_[1]; + + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto; +}; +// ------------------------------------------------------------------- + class NodeInfo final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.meta.NodeInfo) */ { public: @@ -455,7 +669,7 @@ class NodeInfo final : &_NodeInfo_default_instance_); } static constexpr int kIndexInFileMessages = - 1; + 2; friend void swap(NodeInfo& a, NodeInfo& b) { a.Swap(&b); @@ -661,7 +875,7 @@ class RegionStat final : &_RegionStat_default_instance_); } static constexpr int kIndexInFileMessages = - 3; + 4; friend void swap(RegionStat& a, RegionStat& b) { a.Swap(&b); @@ -739,11 +953,11 @@ class RegionStat final : enum : int { kExtensionsFieldNumber = 99, kEngineFieldNumber = 6, + kRoleStateFieldNumber = 7, kRegionIdFieldNumber = 1, kRcusFieldNumber = 2, kWcusFieldNumber = 3, kApproximateBytesFieldNumber = 4, - kRoleFieldNumber = 7, }; // map extensions = 99; int extensions_size() const; @@ -776,6 +990,24 @@ class RegionStat final : std::string* _internal_mutable_engine(); public: + // .greptime.v1.meta.RegionRoleState role_state = 7; + bool has_role_state() const; + private: + bool _internal_has_role_state() const; + public: + void clear_role_state(); + const ::greptime::v1::meta::RegionRoleState& role_state() const; + PROTOBUF_NODISCARD ::greptime::v1::meta::RegionRoleState* release_role_state(); + ::greptime::v1::meta::RegionRoleState* mutable_role_state(); + void set_allocated_role_state(::greptime::v1::meta::RegionRoleState* role_state); + private: + const ::greptime::v1::meta::RegionRoleState& _internal_role_state() const; + ::greptime::v1::meta::RegionRoleState* _internal_mutable_role_state(); + public: + void unsafe_arena_set_allocated_role_state( + ::greptime::v1::meta::RegionRoleState* role_state); + ::greptime::v1::meta::RegionRoleState* unsafe_arena_release_role_state(); + // uint64 region_id = 1; void clear_region_id(); uint64_t region_id() const; @@ -812,15 +1044,6 @@ class RegionStat final : void _internal_set_approximate_bytes(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; @@ -835,11 +1058,11 @@ class RegionStat final : ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BYTES> extensions_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr engine_; + ::greptime::v1::meta::RegionRoleState* role_state_; uint64_t region_id_; int64_t rcus_; int64_t wcus_; int64_t approximate_bytes_; - int role_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; @@ -895,7 +1118,7 @@ class HeartbeatResponse final : &_HeartbeatResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 4; + 5; friend void swap(HeartbeatResponse& a, HeartbeatResponse& b) { a.Swap(&b); @@ -1092,7 +1315,7 @@ class GrantedRegion final : &_GrantedRegion_default_instance_); } static constexpr int kIndexInFileMessages = - 5; + 6; friend void swap(GrantedRegion& a, GrantedRegion& b) { a.Swap(&b); @@ -1165,9 +1388,27 @@ class GrantedRegion final : // accessors ------------------------------------------------------- enum : int { + kRoleStateFieldNumber = 2, kRegionIdFieldNumber = 1, - kRoleFieldNumber = 2, }; + // .greptime.v1.meta.RegionRoleState role_state = 2; + bool has_role_state() const; + private: + bool _internal_has_role_state() const; + public: + void clear_role_state(); + const ::greptime::v1::meta::RegionRoleState& role_state() const; + PROTOBUF_NODISCARD ::greptime::v1::meta::RegionRoleState* release_role_state(); + ::greptime::v1::meta::RegionRoleState* mutable_role_state(); + void set_allocated_role_state(::greptime::v1::meta::RegionRoleState* role_state); + private: + const ::greptime::v1::meta::RegionRoleState& _internal_role_state() const; + ::greptime::v1::meta::RegionRoleState* _internal_mutable_role_state(); + public: + void unsafe_arena_set_allocated_role_state( + ::greptime::v1::meta::RegionRoleState* role_state); + ::greptime::v1::meta::RegionRoleState* unsafe_arena_release_role_state(); + // uint64 region_id = 1; void clear_region_id(); uint64_t region_id() const; @@ -1177,15 +1418,6 @@ class GrantedRegion final : void _internal_set_region_id(uint64_t value); public: - // .greptime.v1.meta.RegionRole role = 2; - 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.GrantedRegion) private: class _Internal; @@ -1194,8 +1426,8 @@ class GrantedRegion final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { + ::greptime::v1::meta::RegionRoleState* role_state_; uint64_t region_id_; - int role_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; @@ -1251,7 +1483,7 @@ class RegionLease final : &_RegionLease_default_instance_); } static constexpr int kIndexInFileMessages = - 6; + 7; friend void swap(RegionLease& a, RegionLease& b) { a.Swap(&b); @@ -1455,7 +1687,7 @@ class AskLeaderRequest final : &_AskLeaderRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 7; + 8; friend void swap(AskLeaderRequest& a, AskLeaderRequest& b) { a.Swap(&b); @@ -1612,7 +1844,7 @@ class AskLeaderResponse final : &_AskLeaderResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 8; + 9; friend void swap(AskLeaderResponse& a, AskLeaderResponse& b) { a.Swap(&b); @@ -1794,7 +2026,7 @@ class MailboxMessage final : &_MailboxMessage_default_instance_); } static constexpr int kIndexInFileMessages = - 9; + 10; friend void swap(MailboxMessage& a, MailboxMessage& b) { a.Swap(&b); @@ -2511,6 +2743,95 @@ inline void HeartbeatRequest::set_allocated_info(::greptime::v1::meta::NodeInfo* // ------------------------------------------------------------------- +// RegionRoleState + +// .greptime.v1.meta.RegionLeaderState leader_state = 1; +inline bool RegionRoleState::_internal_has_leader_state() const { + return role_state_case() == kLeaderState; +} +inline bool RegionRoleState::has_leader_state() const { + return _internal_has_leader_state(); +} +inline void RegionRoleState::set_has_leader_state() { + _impl_._oneof_case_[0] = kLeaderState; +} +inline void RegionRoleState::clear_leader_state() { + if (_internal_has_leader_state()) { + _impl_.role_state_.leader_state_ = 0; + clear_has_role_state(); + } +} +inline ::greptime::v1::meta::RegionLeaderState RegionRoleState::_internal_leader_state() const { + if (_internal_has_leader_state()) { + return static_cast< ::greptime::v1::meta::RegionLeaderState >(_impl_.role_state_.leader_state_); + } + return static_cast< ::greptime::v1::meta::RegionLeaderState >(0); +} +inline ::greptime::v1::meta::RegionLeaderState RegionRoleState::leader_state() const { + // @@protoc_insertion_point(field_get:greptime.v1.meta.RegionRoleState.leader_state) + return _internal_leader_state(); +} +inline void RegionRoleState::_internal_set_leader_state(::greptime::v1::meta::RegionLeaderState value) { + if (!_internal_has_leader_state()) { + clear_role_state(); + set_has_leader_state(); + } + _impl_.role_state_.leader_state_ = value; +} +inline void RegionRoleState::set_leader_state(::greptime::v1::meta::RegionLeaderState value) { + _internal_set_leader_state(value); + // @@protoc_insertion_point(field_set:greptime.v1.meta.RegionRoleState.leader_state) +} + +// .greptime.v1.meta.RegionLeaderState follower_state = 2; +inline bool RegionRoleState::_internal_has_follower_state() const { + return role_state_case() == kFollowerState; +} +inline bool RegionRoleState::has_follower_state() const { + return _internal_has_follower_state(); +} +inline void RegionRoleState::set_has_follower_state() { + _impl_._oneof_case_[0] = kFollowerState; +} +inline void RegionRoleState::clear_follower_state() { + if (_internal_has_follower_state()) { + _impl_.role_state_.follower_state_ = 0; + clear_has_role_state(); + } +} +inline ::greptime::v1::meta::RegionLeaderState RegionRoleState::_internal_follower_state() const { + if (_internal_has_follower_state()) { + return static_cast< ::greptime::v1::meta::RegionLeaderState >(_impl_.role_state_.follower_state_); + } + return static_cast< ::greptime::v1::meta::RegionLeaderState >(0); +} +inline ::greptime::v1::meta::RegionLeaderState RegionRoleState::follower_state() const { + // @@protoc_insertion_point(field_get:greptime.v1.meta.RegionRoleState.follower_state) + return _internal_follower_state(); +} +inline void RegionRoleState::_internal_set_follower_state(::greptime::v1::meta::RegionLeaderState value) { + if (!_internal_has_follower_state()) { + clear_role_state(); + set_has_follower_state(); + } + _impl_.role_state_.follower_state_ = value; +} +inline void RegionRoleState::set_follower_state(::greptime::v1::meta::RegionLeaderState value) { + _internal_set_follower_state(value); + // @@protoc_insertion_point(field_set:greptime.v1.meta.RegionRoleState.follower_state) +} + +inline bool RegionRoleState::has_role_state() const { + return role_state_case() != ROLE_STATE_NOT_SET; +} +inline void RegionRoleState::clear_has_role_state() { + _impl_._oneof_case_[0] = ROLE_STATE_NOT_SET; +} +inline RegionRoleState::RoleStateCase RegionRoleState::role_state_case() const { + return RegionRoleState::RoleStateCase(_impl_._oneof_case_[0]); +} +// ------------------------------------------------------------------- + // NodeInfo // string version = 1; @@ -2769,24 +3090,94 @@ 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; +// .greptime.v1.meta.RegionRoleState role_state = 7; +inline bool RegionStat::_internal_has_role_state() const { + return this != internal_default_instance() && _impl_.role_state_ != nullptr; +} +inline bool RegionStat::has_role_state() const { + return _internal_has_role_state(); +} +inline void RegionStat::clear_role_state() { + if (GetArenaForAllocation() == nullptr && _impl_.role_state_ != nullptr) { + delete _impl_.role_state_; + } + _impl_.role_state_ = nullptr; +} +inline const ::greptime::v1::meta::RegionRoleState& RegionStat::_internal_role_state() const { + const ::greptime::v1::meta::RegionRoleState* p = _impl_.role_state_; + return p != nullptr ? *p : reinterpret_cast( + ::greptime::v1::meta::_RegionRoleState_default_instance_); +} +inline const ::greptime::v1::meta::RegionRoleState& RegionStat::role_state() const { + // @@protoc_insertion_point(field_get:greptime.v1.meta.RegionStat.role_state) + return _internal_role_state(); +} +inline void RegionStat::unsafe_arena_set_allocated_role_state( + ::greptime::v1::meta::RegionRoleState* role_state) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.role_state_); + } + _impl_.role_state_ = role_state; + if (role_state) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:greptime.v1.meta.RegionStat.role_state) } -inline ::greptime::v1::meta::RegionRole RegionStat::_internal_role() const { - return static_cast< ::greptime::v1::meta::RegionRole >(_impl_.role_); +inline ::greptime::v1::meta::RegionRoleState* RegionStat::release_role_state() { + + ::greptime::v1::meta::RegionRoleState* temp = _impl_.role_state_; + _impl_.role_state_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; } -inline ::greptime::v1::meta::RegionRole RegionStat::role() const { - // @@protoc_insertion_point(field_get:greptime.v1.meta.RegionStat.role) - return _internal_role(); +inline ::greptime::v1::meta::RegionRoleState* RegionStat::unsafe_arena_release_role_state() { + // @@protoc_insertion_point(field_release:greptime.v1.meta.RegionStat.role_state) + + ::greptime::v1::meta::RegionRoleState* temp = _impl_.role_state_; + _impl_.role_state_ = nullptr; + return temp; } -inline void RegionStat::_internal_set_role(::greptime::v1::meta::RegionRole value) { +inline ::greptime::v1::meta::RegionRoleState* RegionStat::_internal_mutable_role_state() { - _impl_.role_ = value; + if (_impl_.role_state_ == nullptr) { + auto* p = CreateMaybeMessage<::greptime::v1::meta::RegionRoleState>(GetArenaForAllocation()); + _impl_.role_state_ = p; + } + return _impl_.role_state_; +} +inline ::greptime::v1::meta::RegionRoleState* RegionStat::mutable_role_state() { + ::greptime::v1::meta::RegionRoleState* _msg = _internal_mutable_role_state(); + // @@protoc_insertion_point(field_mutable:greptime.v1.meta.RegionStat.role_state) + return _msg; } -inline void RegionStat::set_role(::greptime::v1::meta::RegionRole value) { - _internal_set_role(value); - // @@protoc_insertion_point(field_set:greptime.v1.meta.RegionStat.role) +inline void RegionStat::set_allocated_role_state(::greptime::v1::meta::RegionRoleState* role_state) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.role_state_; + } + if (role_state) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(role_state); + if (message_arena != submessage_arena) { + role_state = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, role_state, submessage_arena); + } + + } else { + + } + _impl_.role_state_ = role_state; + // @@protoc_insertion_point(field_set_allocated:greptime.v1.meta.RegionStat.role_state) } // map extensions = 99; @@ -3111,24 +3502,94 @@ inline void GrantedRegion::set_region_id(uint64_t value) { // @@protoc_insertion_point(field_set:greptime.v1.meta.GrantedRegion.region_id) } -// .greptime.v1.meta.RegionRole role = 2; -inline void GrantedRegion::clear_role() { - _impl_.role_ = 0; +// .greptime.v1.meta.RegionRoleState role_state = 2; +inline bool GrantedRegion::_internal_has_role_state() const { + return this != internal_default_instance() && _impl_.role_state_ != nullptr; +} +inline bool GrantedRegion::has_role_state() const { + return _internal_has_role_state(); +} +inline void GrantedRegion::clear_role_state() { + if (GetArenaForAllocation() == nullptr && _impl_.role_state_ != nullptr) { + delete _impl_.role_state_; + } + _impl_.role_state_ = nullptr; +} +inline const ::greptime::v1::meta::RegionRoleState& GrantedRegion::_internal_role_state() const { + const ::greptime::v1::meta::RegionRoleState* p = _impl_.role_state_; + return p != nullptr ? *p : reinterpret_cast( + ::greptime::v1::meta::_RegionRoleState_default_instance_); +} +inline const ::greptime::v1::meta::RegionRoleState& GrantedRegion::role_state() const { + // @@protoc_insertion_point(field_get:greptime.v1.meta.GrantedRegion.role_state) + return _internal_role_state(); +} +inline void GrantedRegion::unsafe_arena_set_allocated_role_state( + ::greptime::v1::meta::RegionRoleState* role_state) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.role_state_); + } + _impl_.role_state_ = role_state; + if (role_state) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:greptime.v1.meta.GrantedRegion.role_state) } -inline ::greptime::v1::meta::RegionRole GrantedRegion::_internal_role() const { - return static_cast< ::greptime::v1::meta::RegionRole >(_impl_.role_); +inline ::greptime::v1::meta::RegionRoleState* GrantedRegion::release_role_state() { + + ::greptime::v1::meta::RegionRoleState* temp = _impl_.role_state_; + _impl_.role_state_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; } -inline ::greptime::v1::meta::RegionRole GrantedRegion::role() const { - // @@protoc_insertion_point(field_get:greptime.v1.meta.GrantedRegion.role) - return _internal_role(); +inline ::greptime::v1::meta::RegionRoleState* GrantedRegion::unsafe_arena_release_role_state() { + // @@protoc_insertion_point(field_release:greptime.v1.meta.GrantedRegion.role_state) + + ::greptime::v1::meta::RegionRoleState* temp = _impl_.role_state_; + _impl_.role_state_ = nullptr; + return temp; } -inline void GrantedRegion::_internal_set_role(::greptime::v1::meta::RegionRole value) { +inline ::greptime::v1::meta::RegionRoleState* GrantedRegion::_internal_mutable_role_state() { - _impl_.role_ = value; + if (_impl_.role_state_ == nullptr) { + auto* p = CreateMaybeMessage<::greptime::v1::meta::RegionRoleState>(GetArenaForAllocation()); + _impl_.role_state_ = p; + } + return _impl_.role_state_; } -inline void GrantedRegion::set_role(::greptime::v1::meta::RegionRole value) { - _internal_set_role(value); - // @@protoc_insertion_point(field_set:greptime.v1.meta.GrantedRegion.role) +inline ::greptime::v1::meta::RegionRoleState* GrantedRegion::mutable_role_state() { + ::greptime::v1::meta::RegionRoleState* _msg = _internal_mutable_role_state(); + // @@protoc_insertion_point(field_mutable:greptime.v1.meta.GrantedRegion.role_state) + return _msg; +} +inline void GrantedRegion::set_allocated_role_state(::greptime::v1::meta::RegionRoleState* role_state) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.role_state_; + } + if (role_state) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(role_state); + if (message_arena != submessage_arena) { + role_state = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, role_state, submessage_arena); + } + + } else { + + } + _impl_.role_state_ = role_state; + // @@protoc_insertion_point(field_set_allocated:greptime.v1.meta.GrantedRegion.role_state) } // ------------------------------------------------------------------- @@ -3826,6 +4287,8 @@ inline MailboxMessage::PayloadCase MailboxMessage::payload_case() const { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) @@ -3835,10 +4298,15 @@ inline MailboxMessage::PayloadCase MailboxMessage::payload_case() const { PROTOBUF_NAMESPACE_OPEN -template <> struct is_proto_enum< ::greptime::v1::meta::RegionRole> : ::std::true_type {}; +template <> struct is_proto_enum< ::greptime::v1::meta::RegionLeaderState> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::greptime::v1::meta::RegionLeaderState>() { + return ::greptime::v1::meta::RegionLeaderState_descriptor(); +} +template <> struct is_proto_enum< ::greptime::v1::meta::RegionFollowerState> : ::std::true_type {}; template <> -inline const EnumDescriptor* GetEnumDescriptor< ::greptime::v1::meta::RegionRole>() { - return ::greptime::v1::meta::RegionRole_descriptor(); +inline const EnumDescriptor* GetEnumDescriptor< ::greptime::v1::meta::RegionFollowerState>() { + return ::greptime::v1::meta::RegionFollowerState_descriptor(); } PROTOBUF_NAMESPACE_CLOSE diff --git a/go/greptime/v1/meta/heartbeat.pb.go b/go/greptime/v1/meta/heartbeat.pb.go index ade354bf..3e9a4a46 100644 --- a/go/greptime/v1/meta/heartbeat.pb.go +++ b/go/greptime/v1/meta/heartbeat.pb.go @@ -34,54 +34,95 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type RegionRole int32 +type RegionLeaderState int32 const ( - // Writable region(mito2), Readonly region(file). - RegionRole_Leader RegionRole = 0 - // Readonly region. - RegionRole_Follower RegionRole = 1 + RegionLeaderState_Writable RegionLeaderState = 0 + RegionLeaderState_Downgrading RegionLeaderState = 1 ) -// Enum value maps for RegionRole. +// Enum value maps for RegionLeaderState. var ( - RegionRole_name = map[int32]string{ - 0: "Leader", - 1: "Follower", + RegionLeaderState_name = map[int32]string{ + 0: "Writable", + 1: "Downgrading", } - RegionRole_value = map[string]int32{ - "Leader": 0, - "Follower": 1, + RegionLeaderState_value = map[string]int32{ + "Writable": 0, + "Downgrading": 1, } ) -func (x RegionRole) Enum() *RegionRole { - p := new(RegionRole) +func (x RegionLeaderState) Enum() *RegionLeaderState { + p := new(RegionLeaderState) *p = x return p } -func (x RegionRole) String() string { +func (x RegionLeaderState) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (RegionRole) Descriptor() protoreflect.EnumDescriptor { +func (RegionLeaderState) Descriptor() protoreflect.EnumDescriptor { return file_greptime_v1_meta_heartbeat_proto_enumTypes[0].Descriptor() } -func (RegionRole) Type() protoreflect.EnumType { +func (RegionLeaderState) Type() protoreflect.EnumType { return &file_greptime_v1_meta_heartbeat_proto_enumTypes[0] } -func (x RegionRole) Number() protoreflect.EnumNumber { +func (x RegionLeaderState) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use RegionRole.Descriptor instead. -func (RegionRole) EnumDescriptor() ([]byte, []int) { +// Deprecated: Use RegionLeaderState.Descriptor instead. +func (RegionLeaderState) EnumDescriptor() ([]byte, []int) { return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{0} } +type RegionFollowerState int32 + +const ( + RegionFollowerState_Readonly RegionFollowerState = 0 +) + +// Enum value maps for RegionFollowerState. +var ( + RegionFollowerState_name = map[int32]string{ + 0: "Readonly", + } + RegionFollowerState_value = map[string]int32{ + "Readonly": 0, + } +) + +func (x RegionFollowerState) Enum() *RegionFollowerState { + p := new(RegionFollowerState) + *p = x + return p +} + +func (x RegionFollowerState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RegionFollowerState) Descriptor() protoreflect.EnumDescriptor { + return file_greptime_v1_meta_heartbeat_proto_enumTypes[1].Descriptor() +} + +func (RegionFollowerState) Type() protoreflect.EnumType { + return &file_greptime_v1_meta_heartbeat_proto_enumTypes[1] +} + +func (x RegionFollowerState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RegionFollowerState.Descriptor instead. +func (RegionFollowerState) EnumDescriptor() ([]byte, []int) { + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{1} +} + type HeartbeatRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -191,6 +232,87 @@ func (x *HeartbeatRequest) GetInfo() *NodeInfo { return nil } +type RegionRoleState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to RoleState: + // + // *RegionRoleState_LeaderState + // *RegionRoleState_FollowerState + RoleState isRegionRoleState_RoleState `protobuf_oneof:"role_state"` +} + +func (x *RegionRoleState) Reset() { + *x = RegionRoleState{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegionRoleState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegionRoleState) ProtoMessage() {} + +func (x *RegionRoleState) 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 RegionRoleState.ProtoReflect.Descriptor instead. +func (*RegionRoleState) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{1} +} + +func (m *RegionRoleState) GetRoleState() isRegionRoleState_RoleState { + if m != nil { + return m.RoleState + } + return nil +} + +func (x *RegionRoleState) GetLeaderState() RegionLeaderState { + if x, ok := x.GetRoleState().(*RegionRoleState_LeaderState); ok { + return x.LeaderState + } + return RegionLeaderState_Writable +} + +func (x *RegionRoleState) GetFollowerState() RegionLeaderState { + if x, ok := x.GetRoleState().(*RegionRoleState_FollowerState); ok { + return x.FollowerState + } + return RegionLeaderState_Writable +} + +type isRegionRoleState_RoleState interface { + isRegionRoleState_RoleState() +} + +type RegionRoleState_LeaderState struct { + LeaderState RegionLeaderState `protobuf:"varint,1,opt,name=leader_state,json=leaderState,proto3,enum=greptime.v1.meta.RegionLeaderState,oneof"` +} + +type RegionRoleState_FollowerState struct { + FollowerState RegionLeaderState `protobuf:"varint,2,opt,name=follower_state,json=followerState,proto3,enum=greptime.v1.meta.RegionLeaderState,oneof"` +} + +func (*RegionRoleState_LeaderState) isRegionRoleState_RoleState() {} + +func (*RegionRoleState_FollowerState) isRegionRoleState_RoleState() {} + type NodeInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -207,7 +329,7 @@ type NodeInfo struct { func (x *NodeInfo) Reset() { *x = NodeInfo{} if protoimpl.UnsafeEnabled { - mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[1] + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -220,7 +342,7 @@ func (x *NodeInfo) String() string { func (*NodeInfo) ProtoMessage() {} func (x *NodeInfo) ProtoReflect() protoreflect.Message { - mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[1] + 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 { @@ -233,7 +355,7 @@ func (x *NodeInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use NodeInfo.ProtoReflect.Descriptor instead. func (*NodeInfo) Descriptor() ([]byte, []int) { - return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{1} + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{2} } func (x *NodeInfo) GetVersion() string { @@ -271,15 +393,15 @@ type RegionStat struct { ApproximateBytes int64 `protobuf:"varint,4,opt,name=approximate_bytes,json=approximateBytes,proto3" json:"approximate_bytes,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"` + // Region role state + RoleState *RegionRoleState `protobuf:"bytes,7,opt,name=role_state,json=roleState,proto3" json:"role_state,omitempty"` Extensions map[string][]byte `protobuf:"bytes,99,rep,name=extensions,proto3" json:"extensions,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] + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -292,7 +414,7 @@ func (x *RegionStat) String() string { func (*RegionStat) ProtoMessage() {} func (x *RegionStat) ProtoReflect() protoreflect.Message { - mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[2] + 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 { @@ -305,7 +427,7 @@ func (x *RegionStat) ProtoReflect() protoreflect.Message { // Deprecated: Use RegionStat.ProtoReflect.Descriptor instead. func (*RegionStat) Descriptor() ([]byte, []int) { - return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{2} + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{3} } func (x *RegionStat) GetRegionId() uint64 { @@ -343,11 +465,11 @@ func (x *RegionStat) GetEngine() string { return "" } -func (x *RegionStat) GetRole() RegionRole { +func (x *RegionStat) GetRoleState() *RegionRoleState { if x != nil { - return x.Role + return x.RoleState } - return RegionRole_Leader + return nil } func (x *RegionStat) GetExtensions() map[string][]byte { @@ -370,7 +492,7 @@ type HeartbeatResponse struct { func (x *HeartbeatResponse) Reset() { *x = HeartbeatResponse{} if protoimpl.UnsafeEnabled { - mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[3] + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -383,7 +505,7 @@ func (x *HeartbeatResponse) String() string { func (*HeartbeatResponse) ProtoMessage() {} func (x *HeartbeatResponse) ProtoReflect() protoreflect.Message { - mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[3] + 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 { @@ -396,7 +518,7 @@ func (x *HeartbeatResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use HeartbeatResponse.ProtoReflect.Descriptor instead. func (*HeartbeatResponse) Descriptor() ([]byte, []int) { - return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{3} + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{4} } func (x *HeartbeatResponse) GetHeader() *ResponseHeader { @@ -425,14 +547,14 @@ type GrantedRegion struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - RegionId uint64 `protobuf:"varint,1,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` - Role RegionRole `protobuf:"varint,2,opt,name=role,proto3,enum=greptime.v1.meta.RegionRole" json:"role,omitempty"` + RegionId uint64 `protobuf:"varint,1,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` + RoleState *RegionRoleState `protobuf:"bytes,2,opt,name=role_state,json=roleState,proto3" json:"role_state,omitempty"` } func (x *GrantedRegion) Reset() { *x = GrantedRegion{} if protoimpl.UnsafeEnabled { - mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[4] + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -445,7 +567,7 @@ func (x *GrantedRegion) String() string { func (*GrantedRegion) ProtoMessage() {} func (x *GrantedRegion) ProtoReflect() protoreflect.Message { - mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[4] + 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 { @@ -458,7 +580,7 @@ func (x *GrantedRegion) ProtoReflect() protoreflect.Message { // Deprecated: Use GrantedRegion.ProtoReflect.Descriptor instead. func (*GrantedRegion) Descriptor() ([]byte, []int) { - return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{4} + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{5} } func (x *GrantedRegion) GetRegionId() uint64 { @@ -468,11 +590,11 @@ func (x *GrantedRegion) GetRegionId() uint64 { return 0 } -func (x *GrantedRegion) GetRole() RegionRole { +func (x *GrantedRegion) GetRoleState() *RegionRoleState { if x != nil { - return x.Role + return x.RoleState } - return RegionRole_Leader + return nil } type RegionLease struct { @@ -489,7 +611,7 @@ type RegionLease struct { func (x *RegionLease) Reset() { *x = RegionLease{} 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.StoreMessageInfo(mi) } @@ -502,7 +624,7 @@ func (x *RegionLease) String() string { func (*RegionLease) ProtoMessage() {} func (x *RegionLease) 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 { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -515,7 +637,7 @@ func (x *RegionLease) ProtoReflect() protoreflect.Message { // Deprecated: Use RegionLease.ProtoReflect.Descriptor instead. func (*RegionLease) 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 *RegionLease) GetRegions() []*GrantedRegion { @@ -557,7 +679,7 @@ type AskLeaderRequest struct { func (x *AskLeaderRequest) Reset() { *x = AskLeaderRequest{} 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.StoreMessageInfo(mi) } @@ -570,7 +692,7 @@ func (x *AskLeaderRequest) String() string { func (*AskLeaderRequest) ProtoMessage() {} func (x *AskLeaderRequest) 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 { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -583,7 +705,7 @@ func (x *AskLeaderRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AskLeaderRequest.ProtoReflect.Descriptor instead. func (*AskLeaderRequest) 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 *AskLeaderRequest) GetHeader() *RequestHeader { @@ -605,7 +727,7 @@ type AskLeaderResponse struct { func (x *AskLeaderResponse) Reset() { *x = AskLeaderResponse{} 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.StoreMessageInfo(mi) } @@ -618,7 +740,7 @@ func (x *AskLeaderResponse) String() string { func (*AskLeaderResponse) ProtoMessage() {} func (x *AskLeaderResponse) 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 { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -631,7 +753,7 @@ func (x *AskLeaderResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AskLeaderResponse.ProtoReflect.Descriptor instead. func (*AskLeaderResponse) 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 *AskLeaderResponse) GetHeader() *ResponseHeader { @@ -673,7 +795,7 @@ type MailboxMessage struct { func (x *MailboxMessage) Reset() { *x = MailboxMessage{} if protoimpl.UnsafeEnabled { - mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[8] + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -686,7 +808,7 @@ func (x *MailboxMessage) String() string { func (*MailboxMessage) ProtoMessage() {} func (x *MailboxMessage) ProtoReflect() protoreflect.Message { - mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[8] + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -699,7 +821,7 @@ func (x *MailboxMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use MailboxMessage.ProtoReflect.Descriptor instead. func (*MailboxMessage) Descriptor() ([]byte, []int) { - return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{8} + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{9} } func (x *MailboxMessage) GetId() uint64 { @@ -798,110 +920,127 @@ var file_greptime_v1_meta_heartbeat_proto_rawDesc = []byte{ 0x6f, 0x63, 0x68, 0x12, 0x2e, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x08, 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, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, - 0x6e, 0x66, 0x6f, 0x22, 0x67, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x69, 0x74, - 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, - 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x4d, 0x73, 0x22, 0xd5, 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, 0x12, 0x0a, 0x04, 0x72, 0x63, 0x75, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x72, 0x63, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, - 0x77, 0x63, 0x75, 0x73, 0x18, 0x03, 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, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x61, 0x70, 0x70, - 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x42, 0x79, 0x74, 0x65, 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, 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, 0x12, 0x4c, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x63, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 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, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 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, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 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, + 0x6e, 0x66, 0x6f, 0x22, 0xb7, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x6f, + 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x48, 0x0a, 0x0c, 0x6c, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 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, 0x5e, 0x0a, 0x0d, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x52, 0x65, 0x67, 0x69, - 0x6f, 0x6e, 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, - 0x30, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 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, 0xd1, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x61, 0x73, - 0x65, 0x12, 0x39, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x52, 0x65, 0x67, - 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 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, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x61, 0x62, 0x6c, 0x65, - 0x5f, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x04, 0x52, 0x12, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x67, 0x69, - 0x6f, 0x6e, 0x49, 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, 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, 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, + 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x4c, 0x0a, 0x0e, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 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, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x48, 0x00, + 0x52, 0x0d, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, + 0x0c, 0x0a, 0x0a, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x67, 0x0a, + 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x5f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x54, 0x69, 0x6d, 0x65, 0x4d, 0x73, 0x22, 0xe5, 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, 0x12, 0x0a, 0x04, 0x72, 0x63, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x04, 0x72, 0x63, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x77, 0x63, 0x75, 0x73, 0x18, 0x03, + 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, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, + 0x74, 0x65, 0x42, 0x79, 0x74, 0x65, 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, 0x12, + 0x40, 0x0a, 0x0a, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 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, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x4c, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x63, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 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, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, + 0x3d, 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 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, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 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, 0x6e, 0x0a, 0x0d, 0x47, + 0x72, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 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, 0x40, 0x0a, 0x0a, 0x72, 0x6f, 0x6c, + 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 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, + 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x52, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0xd1, 0x01, 0x0a, 0x0b, + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x72, + 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, + 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, + 0x47, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x72, + 0x65, 0x67, 0x69, 0x6f, 0x6e, 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, 0x12, 0x30, 0x0a, + 0x14, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x6f, + 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x52, 0x12, 0x63, 0x6c, 0x6f, + 0x73, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 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, 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, 0x32, 0x0a, 0x11, 0x52, 0x65, 0x67, 0x69, + 0x6f, 0x6e, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0c, 0x0a, + 0x08, 0x57, 0x72, 0x69, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x44, + 0x6f, 0x77, 0x6e, 0x67, 0x72, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x10, 0x01, 0x2a, 0x23, 0x0a, 0x13, + 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x10, + 0x00, 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 ( @@ -916,51 +1055,55 @@ 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, 10) +var file_greptime_v1_meta_heartbeat_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_greptime_v1_meta_heartbeat_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_greptime_v1_meta_heartbeat_proto_goTypes = []interface{}{ - (RegionRole)(0), // 0: greptime.v1.meta.RegionRole - (*HeartbeatRequest)(nil), // 1: greptime.v1.meta.HeartbeatRequest - (*NodeInfo)(nil), // 2: greptime.v1.meta.NodeInfo - (*RegionStat)(nil), // 3: greptime.v1.meta.RegionStat - (*HeartbeatResponse)(nil), // 4: greptime.v1.meta.HeartbeatResponse - (*GrantedRegion)(nil), // 5: greptime.v1.meta.GrantedRegion - (*RegionLease)(nil), // 6: greptime.v1.meta.RegionLease - (*AskLeaderRequest)(nil), // 7: greptime.v1.meta.AskLeaderRequest - (*AskLeaderResponse)(nil), // 8: greptime.v1.meta.AskLeaderResponse - (*MailboxMessage)(nil), // 9: greptime.v1.meta.MailboxMessage - nil, // 10: greptime.v1.meta.RegionStat.ExtensionsEntry - (*RequestHeader)(nil), // 11: greptime.v1.meta.RequestHeader - (*Peer)(nil), // 12: greptime.v1.meta.Peer - (*TimeInterval)(nil), // 13: greptime.v1.meta.TimeInterval - (*ResponseHeader)(nil), // 14: greptime.v1.meta.ResponseHeader + (RegionLeaderState)(0), // 0: greptime.v1.meta.RegionLeaderState + (RegionFollowerState)(0), // 1: greptime.v1.meta.RegionFollowerState + (*HeartbeatRequest)(nil), // 2: greptime.v1.meta.HeartbeatRequest + (*RegionRoleState)(nil), // 3: greptime.v1.meta.RegionRoleState + (*NodeInfo)(nil), // 4: greptime.v1.meta.NodeInfo + (*RegionStat)(nil), // 5: greptime.v1.meta.RegionStat + (*HeartbeatResponse)(nil), // 6: greptime.v1.meta.HeartbeatResponse + (*GrantedRegion)(nil), // 7: greptime.v1.meta.GrantedRegion + (*RegionLease)(nil), // 8: greptime.v1.meta.RegionLease + (*AskLeaderRequest)(nil), // 9: greptime.v1.meta.AskLeaderRequest + (*AskLeaderResponse)(nil), // 10: greptime.v1.meta.AskLeaderResponse + (*MailboxMessage)(nil), // 11: greptime.v1.meta.MailboxMessage + nil, // 12: greptime.v1.meta.RegionStat.ExtensionsEntry + (*RequestHeader)(nil), // 13: greptime.v1.meta.RequestHeader + (*Peer)(nil), // 14: greptime.v1.meta.Peer + (*TimeInterval)(nil), // 15: greptime.v1.meta.TimeInterval + (*ResponseHeader)(nil), // 16: greptime.v1.meta.ResponseHeader } var file_greptime_v1_meta_heartbeat_proto_depIdxs = []int32{ - 11, // 0: greptime.v1.meta.HeartbeatRequest.header:type_name -> greptime.v1.meta.RequestHeader - 12, // 1: greptime.v1.meta.HeartbeatRequest.peer:type_name -> greptime.v1.meta.Peer - 13, // 2: greptime.v1.meta.HeartbeatRequest.report_interval:type_name -> greptime.v1.meta.TimeInterval - 3, // 3: greptime.v1.meta.HeartbeatRequest.region_stats:type_name -> greptime.v1.meta.RegionStat - 9, // 4: greptime.v1.meta.HeartbeatRequest.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage - 2, // 5: greptime.v1.meta.HeartbeatRequest.info:type_name -> greptime.v1.meta.NodeInfo - 0, // 6: greptime.v1.meta.RegionStat.role:type_name -> greptime.v1.meta.RegionRole - 10, // 7: greptime.v1.meta.RegionStat.extensions:type_name -> greptime.v1.meta.RegionStat.ExtensionsEntry - 14, // 8: greptime.v1.meta.HeartbeatResponse.header:type_name -> greptime.v1.meta.ResponseHeader - 9, // 9: greptime.v1.meta.HeartbeatResponse.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage - 6, // 10: greptime.v1.meta.HeartbeatResponse.region_lease:type_name -> greptime.v1.meta.RegionLease - 0, // 11: greptime.v1.meta.GrantedRegion.role:type_name -> greptime.v1.meta.RegionRole - 5, // 12: greptime.v1.meta.RegionLease.regions:type_name -> greptime.v1.meta.GrantedRegion - 11, // 13: greptime.v1.meta.AskLeaderRequest.header:type_name -> greptime.v1.meta.RequestHeader - 14, // 14: greptime.v1.meta.AskLeaderResponse.header:type_name -> greptime.v1.meta.ResponseHeader - 12, // 15: greptime.v1.meta.AskLeaderResponse.leader:type_name -> greptime.v1.meta.Peer - 1, // 16: greptime.v1.meta.Heartbeat.Heartbeat:input_type -> greptime.v1.meta.HeartbeatRequest - 7, // 17: greptime.v1.meta.Heartbeat.AskLeader:input_type -> greptime.v1.meta.AskLeaderRequest - 4, // 18: greptime.v1.meta.Heartbeat.Heartbeat:output_type -> greptime.v1.meta.HeartbeatResponse - 8, // 19: greptime.v1.meta.Heartbeat.AskLeader:output_type -> greptime.v1.meta.AskLeaderResponse - 18, // [18:20] is the sub-list for method output_type - 16, // [16:18] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 13, // 0: greptime.v1.meta.HeartbeatRequest.header:type_name -> greptime.v1.meta.RequestHeader + 14, // 1: greptime.v1.meta.HeartbeatRequest.peer:type_name -> greptime.v1.meta.Peer + 15, // 2: greptime.v1.meta.HeartbeatRequest.report_interval:type_name -> greptime.v1.meta.TimeInterval + 5, // 3: greptime.v1.meta.HeartbeatRequest.region_stats:type_name -> greptime.v1.meta.RegionStat + 11, // 4: greptime.v1.meta.HeartbeatRequest.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage + 4, // 5: greptime.v1.meta.HeartbeatRequest.info:type_name -> greptime.v1.meta.NodeInfo + 0, // 6: greptime.v1.meta.RegionRoleState.leader_state:type_name -> greptime.v1.meta.RegionLeaderState + 0, // 7: greptime.v1.meta.RegionRoleState.follower_state:type_name -> greptime.v1.meta.RegionLeaderState + 3, // 8: greptime.v1.meta.RegionStat.role_state:type_name -> greptime.v1.meta.RegionRoleState + 12, // 9: greptime.v1.meta.RegionStat.extensions:type_name -> greptime.v1.meta.RegionStat.ExtensionsEntry + 16, // 10: greptime.v1.meta.HeartbeatResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 11, // 11: greptime.v1.meta.HeartbeatResponse.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage + 8, // 12: greptime.v1.meta.HeartbeatResponse.region_lease:type_name -> greptime.v1.meta.RegionLease + 3, // 13: greptime.v1.meta.GrantedRegion.role_state:type_name -> greptime.v1.meta.RegionRoleState + 7, // 14: greptime.v1.meta.RegionLease.regions:type_name -> greptime.v1.meta.GrantedRegion + 13, // 15: greptime.v1.meta.AskLeaderRequest.header:type_name -> greptime.v1.meta.RequestHeader + 16, // 16: greptime.v1.meta.AskLeaderResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 14, // 17: greptime.v1.meta.AskLeaderResponse.leader:type_name -> greptime.v1.meta.Peer + 2, // 18: greptime.v1.meta.Heartbeat.Heartbeat:input_type -> greptime.v1.meta.HeartbeatRequest + 9, // 19: greptime.v1.meta.Heartbeat.AskLeader:input_type -> greptime.v1.meta.AskLeaderRequest + 6, // 20: greptime.v1.meta.Heartbeat.Heartbeat:output_type -> greptime.v1.meta.HeartbeatResponse + 10, // 21: greptime.v1.meta.Heartbeat.AskLeader:output_type -> greptime.v1.meta.AskLeaderResponse + 20, // [20:22] is the sub-list for method output_type + 18, // [18:20] 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_heartbeat_proto_init() } @@ -983,7 +1126,7 @@ func file_greptime_v1_meta_heartbeat_proto_init() { } } file_greptime_v1_meta_heartbeat_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeInfo); i { + switch v := v.(*RegionRoleState); i { case 0: return &v.state case 1: @@ -995,7 +1138,7 @@ func file_greptime_v1_meta_heartbeat_proto_init() { } } file_greptime_v1_meta_heartbeat_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegionStat); i { + switch v := v.(*NodeInfo); i { case 0: return &v.state case 1: @@ -1007,7 +1150,7 @@ func file_greptime_v1_meta_heartbeat_proto_init() { } } file_greptime_v1_meta_heartbeat_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeartbeatResponse); i { + switch v := v.(*RegionStat); i { case 0: return &v.state case 1: @@ -1019,7 +1162,7 @@ func file_greptime_v1_meta_heartbeat_proto_init() { } } file_greptime_v1_meta_heartbeat_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GrantedRegion); i { + switch v := v.(*HeartbeatResponse); i { case 0: return &v.state case 1: @@ -1031,7 +1174,7 @@ func file_greptime_v1_meta_heartbeat_proto_init() { } } file_greptime_v1_meta_heartbeat_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegionLease); i { + switch v := v.(*GrantedRegion); i { case 0: return &v.state case 1: @@ -1043,7 +1186,7 @@ func file_greptime_v1_meta_heartbeat_proto_init() { } } file_greptime_v1_meta_heartbeat_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AskLeaderRequest); i { + switch v := v.(*RegionLease); i { case 0: return &v.state case 1: @@ -1055,7 +1198,7 @@ func file_greptime_v1_meta_heartbeat_proto_init() { } } file_greptime_v1_meta_heartbeat_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AskLeaderResponse); i { + switch v := v.(*AskLeaderRequest); i { case 0: return &v.state case 1: @@ -1067,6 +1210,18 @@ func file_greptime_v1_meta_heartbeat_proto_init() { } } file_greptime_v1_meta_heartbeat_proto_msgTypes[8].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[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MailboxMessage); i { case 0: return &v.state @@ -1079,7 +1234,11 @@ func file_greptime_v1_meta_heartbeat_proto_init() { } } } - file_greptime_v1_meta_heartbeat_proto_msgTypes[8].OneofWrappers = []interface{}{ + file_greptime_v1_meta_heartbeat_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*RegionRoleState_LeaderState)(nil), + (*RegionRoleState_FollowerState)(nil), + } + file_greptime_v1_meta_heartbeat_proto_msgTypes[9].OneofWrappers = []interface{}{ (*MailboxMessage_Json)(nil), } type x struct{} @@ -1087,8 +1246,8 @@ 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: 1, - NumMessages: 10, + NumEnums: 2, + NumMessages: 11, NumExtensions: 0, NumServices: 1, }, diff --git a/java/src/main/java/greptime/v1/meta/HeartbeatOuterClass.java b/java/src/main/java/greptime/v1/meta/HeartbeatOuterClass.java index 919330d8..3384b5db 100644 --- a/java/src/main/java/greptime/v1/meta/HeartbeatOuterClass.java +++ b/java/src/main/java/greptime/v1/meta/HeartbeatOuterClass.java @@ -15,45 +15,29 @@ public static void registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } /** - * Protobuf enum {@code greptime.v1.meta.RegionRole} + * Protobuf enum {@code greptime.v1.meta.RegionLeaderState} */ - public enum RegionRole + public enum RegionLeaderState implements com.google.protobuf.ProtocolMessageEnum { /** - *
-     * Writable region(mito2), Readonly region(file).
-     * 
- * - * Leader = 0; + * Writable = 0; */ - Leader(0), + Writable(0), /** - *
-     * Readonly region.
-     * 
- * - * Follower = 1; + * Downgrading = 1; */ - Follower(1), + Downgrading(1), UNRECOGNIZED(-1), ; /** - *
-     * Writable region(mito2), Readonly region(file).
-     * 
- * - * Leader = 0; + * Writable = 0; */ - public static final int Leader_VALUE = 0; + public static final int Writable_VALUE = 0; /** - *
-     * Readonly region.
-     * 
- * - * Follower = 1; + * Downgrading = 1; */ - public static final int Follower_VALUE = 1; + public static final int Downgrading_VALUE = 1; public final int getNumber() { @@ -70,7 +54,7 @@ public final int getNumber() { * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated - public static RegionRole valueOf(int value) { + public static RegionLeaderState valueOf(int value) { return forNumber(value); } @@ -78,23 +62,23 @@ public static RegionRole valueOf(int 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) { + public static RegionLeaderState forNumber(int value) { switch (value) { - case 0: return Leader; - case 1: return Follower; + case 0: return Writable; + case 1: return Downgrading; default: return null; } } - public static com.google.protobuf.Internal.EnumLiteMap + 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); + RegionLeaderState> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RegionLeaderState findValueByNumber(int number) { + return RegionLeaderState.forNumber(number); } }; @@ -115,9 +99,108 @@ public RegionRole findValueByNumber(int number) { return greptime.v1.meta.HeartbeatOuterClass.getDescriptor().getEnumTypes().get(0); } - private static final RegionRole[] VALUES = values(); + private static final RegionLeaderState[] VALUES = values(); + + public static RegionLeaderState 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 RegionLeaderState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:greptime.v1.meta.RegionLeaderState) + } + + /** + * Protobuf enum {@code greptime.v1.meta.RegionFollowerState} + */ + public enum RegionFollowerState + implements com.google.protobuf.ProtocolMessageEnum { + /** + * Readonly = 0; + */ + Readonly(0), + UNRECOGNIZED(-1), + ; + + /** + * Readonly = 0; + */ + public static final int Readonly_VALUE = 0; + + + 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 RegionFollowerState 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 RegionFollowerState forNumber(int value) { + switch (value) { + case 0: return Readonly; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + RegionFollowerState> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RegionFollowerState findValueByNumber(int number) { + return RegionFollowerState.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(1); + } + + private static final RegionFollowerState[] VALUES = values(); - public static RegionRole valueOf( + public static RegionFollowerState valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { throw new java.lang.IllegalArgumentException( @@ -131,11 +214,11 @@ public static RegionRole valueOf( private final int value; - private RegionRole(int value) { + private RegionFollowerState(int value) { this.value = value; } - // @@protoc_insertion_point(enum_scope:greptime.v1.meta.RegionRole) + // @@protoc_insertion_point(enum_scope:greptime.v1.meta.RegionFollowerState) } public interface HeartbeatRequestOrBuilder extends @@ -2317,57 +2400,846 @@ public Builder mergeInfo(greptime.v1.meta.HeartbeatOuterClass.NodeInfo value) { } else { infoBuilder_.mergeFrom(value); } - + + return this; + } + /** + * .greptime.v1.meta.NodeInfo info = 8; + */ + public Builder clearInfo() { + if (infoBuilder_ == null) { + info_ = null; + onChanged(); + } else { + info_ = null; + infoBuilder_ = null; + } + + return this; + } + /** + * .greptime.v1.meta.NodeInfo info = 8; + */ + public greptime.v1.meta.HeartbeatOuterClass.NodeInfo.Builder getInfoBuilder() { + + onChanged(); + return getInfoFieldBuilder().getBuilder(); + } + /** + * .greptime.v1.meta.NodeInfo info = 8; + */ + public greptime.v1.meta.HeartbeatOuterClass.NodeInfoOrBuilder getInfoOrBuilder() { + if (infoBuilder_ != null) { + return infoBuilder_.getMessageOrBuilder(); + } else { + return info_ == null ? + greptime.v1.meta.HeartbeatOuterClass.NodeInfo.getDefaultInstance() : info_; + } + } + /** + * .greptime.v1.meta.NodeInfo info = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + greptime.v1.meta.HeartbeatOuterClass.NodeInfo, greptime.v1.meta.HeartbeatOuterClass.NodeInfo.Builder, greptime.v1.meta.HeartbeatOuterClass.NodeInfoOrBuilder> + getInfoFieldBuilder() { + if (infoBuilder_ == null) { + infoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + greptime.v1.meta.HeartbeatOuterClass.NodeInfo, greptime.v1.meta.HeartbeatOuterClass.NodeInfo.Builder, greptime.v1.meta.HeartbeatOuterClass.NodeInfoOrBuilder>( + getInfo(), + getParentForChildren(), + isClean()); + info_ = null; + } + return infoBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:greptime.v1.meta.HeartbeatRequest) + } + + // @@protoc_insertion_point(class_scope:greptime.v1.meta.HeartbeatRequest) + private static final greptime.v1.meta.HeartbeatOuterClass.HeartbeatRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new greptime.v1.meta.HeartbeatOuterClass.HeartbeatRequest(); + } + + public static greptime.v1.meta.HeartbeatOuterClass.HeartbeatRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HeartbeatRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HeartbeatRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.HeartbeatRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface RegionRoleStateOrBuilder extends + // @@protoc_insertion_point(interface_extends:greptime.v1.meta.RegionRoleState) + com.google.protobuf.MessageOrBuilder { + + /** + * .greptime.v1.meta.RegionLeaderState leader_state = 1; + * @return Whether the leaderState field is set. + */ + boolean hasLeaderState(); + /** + * .greptime.v1.meta.RegionLeaderState leader_state = 1; + * @return The enum numeric value on the wire for leaderState. + */ + int getLeaderStateValue(); + /** + * .greptime.v1.meta.RegionLeaderState leader_state = 1; + * @return The leaderState. + */ + greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState getLeaderState(); + + /** + * .greptime.v1.meta.RegionLeaderState follower_state = 2; + * @return Whether the followerState field is set. + */ + boolean hasFollowerState(); + /** + * .greptime.v1.meta.RegionLeaderState follower_state = 2; + * @return The enum numeric value on the wire for followerState. + */ + int getFollowerStateValue(); + /** + * .greptime.v1.meta.RegionLeaderState follower_state = 2; + * @return The followerState. + */ + greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState getFollowerState(); + + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.RoleStateCase getRoleStateCase(); + } + /** + * Protobuf type {@code greptime.v1.meta.RegionRoleState} + */ + public static final class RegionRoleState extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:greptime.v1.meta.RegionRoleState) + RegionRoleStateOrBuilder { + private static final long serialVersionUID = 0L; + // Use RegionRoleState.newBuilder() to construct. + private RegionRoleState(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RegionRoleState() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RegionRoleState(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RegionRoleState( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + roleStateCase_ = 1; + roleState_ = rawValue; + break; + } + case 16: { + int rawValue = input.readEnum(); + roleStateCase_ = 2; + roleState_ = rawValue; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_RegionRoleState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_RegionRoleState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.class, greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.Builder.class); + } + + private int roleStateCase_ = 0; + private java.lang.Object roleState_; + public enum RoleStateCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + LEADER_STATE(1), + FOLLOWER_STATE(2), + ROLESTATE_NOT_SET(0); + private final int value; + private RoleStateCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RoleStateCase valueOf(int value) { + return forNumber(value); + } + + public static RoleStateCase forNumber(int value) { + switch (value) { + case 1: return LEADER_STATE; + case 2: return FOLLOWER_STATE; + case 0: return ROLESTATE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public RoleStateCase + getRoleStateCase() { + return RoleStateCase.forNumber( + roleStateCase_); + } + + public static final int LEADER_STATE_FIELD_NUMBER = 1; + /** + * .greptime.v1.meta.RegionLeaderState leader_state = 1; + * @return Whether the leaderState field is set. + */ + public boolean hasLeaderState() { + return roleStateCase_ == 1; + } + /** + * .greptime.v1.meta.RegionLeaderState leader_state = 1; + * @return The enum numeric value on the wire for leaderState. + */ + public int getLeaderStateValue() { + if (roleStateCase_ == 1) { + return (java.lang.Integer) roleState_; + } + return 0; + } + /** + * .greptime.v1.meta.RegionLeaderState leader_state = 1; + * @return The leaderState. + */ + public greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState getLeaderState() { + if (roleStateCase_ == 1) { + @SuppressWarnings("deprecation") + greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState result = greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState.valueOf( + (java.lang.Integer) roleState_); + return result == null ? greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState.UNRECOGNIZED : result; + } + return greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState.Writable; + } + + public static final int FOLLOWER_STATE_FIELD_NUMBER = 2; + /** + * .greptime.v1.meta.RegionLeaderState follower_state = 2; + * @return Whether the followerState field is set. + */ + public boolean hasFollowerState() { + return roleStateCase_ == 2; + } + /** + * .greptime.v1.meta.RegionLeaderState follower_state = 2; + * @return The enum numeric value on the wire for followerState. + */ + public int getFollowerStateValue() { + if (roleStateCase_ == 2) { + return (java.lang.Integer) roleState_; + } + return 0; + } + /** + * .greptime.v1.meta.RegionLeaderState follower_state = 2; + * @return The followerState. + */ + public greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState getFollowerState() { + if (roleStateCase_ == 2) { + @SuppressWarnings("deprecation") + greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState result = greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState.valueOf( + (java.lang.Integer) roleState_); + return result == null ? greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState.UNRECOGNIZED : result; + } + return greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState.Writable; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (roleStateCase_ == 1) { + output.writeEnum(1, ((java.lang.Integer) roleState_)); + } + if (roleStateCase_ == 2) { + output.writeEnum(2, ((java.lang.Integer) roleState_)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (roleStateCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, ((java.lang.Integer) roleState_)); + } + if (roleStateCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, ((java.lang.Integer) roleState_)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof greptime.v1.meta.HeartbeatOuterClass.RegionRoleState)) { + return super.equals(obj); + } + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState other = (greptime.v1.meta.HeartbeatOuterClass.RegionRoleState) obj; + + if (!getRoleStateCase().equals(other.getRoleStateCase())) return false; + switch (roleStateCase_) { + case 1: + if (getLeaderStateValue() + != other.getLeaderStateValue()) return false; + break; + case 2: + if (getFollowerStateValue() + != other.getFollowerStateValue()) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (roleStateCase_) { + case 1: + hash = (37 * hash) + LEADER_STATE_FIELD_NUMBER; + hash = (53 * hash) + getLeaderStateValue(); + break; + case 2: + hash = (37 * hash) + FOLLOWER_STATE_FIELD_NUMBER; + hash = (53 * hash) + getFollowerStateValue(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static greptime.v1.meta.HeartbeatOuterClass.RegionRoleState parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static greptime.v1.meta.HeartbeatOuterClass.RegionRoleState parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static greptime.v1.meta.HeartbeatOuterClass.RegionRoleState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static greptime.v1.meta.HeartbeatOuterClass.RegionRoleState parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static greptime.v1.meta.HeartbeatOuterClass.RegionRoleState parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static greptime.v1.meta.HeartbeatOuterClass.RegionRoleState parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static greptime.v1.meta.HeartbeatOuterClass.RegionRoleState parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static greptime.v1.meta.HeartbeatOuterClass.RegionRoleState parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static greptime.v1.meta.HeartbeatOuterClass.RegionRoleState parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static greptime.v1.meta.HeartbeatOuterClass.RegionRoleState parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static greptime.v1.meta.HeartbeatOuterClass.RegionRoleState parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static greptime.v1.meta.HeartbeatOuterClass.RegionRoleState parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(greptime.v1.meta.HeartbeatOuterClass.RegionRoleState prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code greptime.v1.meta.RegionRoleState} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:greptime.v1.meta.RegionRoleState) + greptime.v1.meta.HeartbeatOuterClass.RegionRoleStateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_RegionRoleState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_RegionRoleState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.class, greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.Builder.class); + } + + // Construct using greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + roleStateCase_ = 0; + roleState_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_RegionRoleState_descriptor; + } + + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleState getDefaultInstanceForType() { + return greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.getDefaultInstance(); + } + + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleState build() { + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleState buildPartial() { + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState result = new greptime.v1.meta.HeartbeatOuterClass.RegionRoleState(this); + if (roleStateCase_ == 1) { + result.roleState_ = roleState_; + } + if (roleStateCase_ == 2) { + result.roleState_ = roleState_; + } + result.roleStateCase_ = roleStateCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof greptime.v1.meta.HeartbeatOuterClass.RegionRoleState) { + return mergeFrom((greptime.v1.meta.HeartbeatOuterClass.RegionRoleState)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(greptime.v1.meta.HeartbeatOuterClass.RegionRoleState other) { + if (other == greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.getDefaultInstance()) return this; + switch (other.getRoleStateCase()) { + case LEADER_STATE: { + setLeaderStateValue(other.getLeaderStateValue()); + break; + } + case FOLLOWER_STATE: { + setFollowerStateValue(other.getFollowerStateValue()); + break; + } + case ROLESTATE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (greptime.v1.meta.HeartbeatOuterClass.RegionRoleState) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int roleStateCase_ = 0; + private java.lang.Object roleState_; + public RoleStateCase + getRoleStateCase() { + return RoleStateCase.forNumber( + roleStateCase_); + } + + public Builder clearRoleState() { + roleStateCase_ = 0; + roleState_ = null; + onChanged(); + return this; + } + + + /** + * .greptime.v1.meta.RegionLeaderState leader_state = 1; + * @return Whether the leaderState field is set. + */ + @java.lang.Override + public boolean hasLeaderState() { + return roleStateCase_ == 1; + } + /** + * .greptime.v1.meta.RegionLeaderState leader_state = 1; + * @return The enum numeric value on the wire for leaderState. + */ + @java.lang.Override + public int getLeaderStateValue() { + if (roleStateCase_ == 1) { + return ((java.lang.Integer) roleState_).intValue(); + } + return 0; + } + /** + * .greptime.v1.meta.RegionLeaderState leader_state = 1; + * @param value The enum numeric value on the wire for leaderState to set. + * @return This builder for chaining. + */ + public Builder setLeaderStateValue(int value) { + roleStateCase_ = 1; + roleState_ = value; + onChanged(); + return this; + } + /** + * .greptime.v1.meta.RegionLeaderState leader_state = 1; + * @return The leaderState. + */ + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState getLeaderState() { + if (roleStateCase_ == 1) { + @SuppressWarnings("deprecation") + greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState result = greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState.valueOf( + (java.lang.Integer) roleState_); + return result == null ? greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState.UNRECOGNIZED : result; + } + return greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState.Writable; + } + /** + * .greptime.v1.meta.RegionLeaderState leader_state = 1; + * @param value The leaderState to set. + * @return This builder for chaining. + */ + public Builder setLeaderState(greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState value) { + if (value == null) { + throw new NullPointerException(); + } + roleStateCase_ = 1; + roleState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .greptime.v1.meta.RegionLeaderState leader_state = 1; + * @return This builder for chaining. + */ + public Builder clearLeaderState() { + if (roleStateCase_ == 1) { + roleStateCase_ = 0; + roleState_ = null; + onChanged(); + } return this; } + /** - * .greptime.v1.meta.NodeInfo info = 8; + * .greptime.v1.meta.RegionLeaderState follower_state = 2; + * @return Whether the followerState field is set. */ - public Builder clearInfo() { - if (infoBuilder_ == null) { - info_ = null; - onChanged(); - } else { - info_ = null; - infoBuilder_ = null; + @java.lang.Override + public boolean hasFollowerState() { + return roleStateCase_ == 2; + } + /** + * .greptime.v1.meta.RegionLeaderState follower_state = 2; + * @return The enum numeric value on the wire for followerState. + */ + @java.lang.Override + public int getFollowerStateValue() { + if (roleStateCase_ == 2) { + return ((java.lang.Integer) roleState_).intValue(); } - - return this; + return 0; } /** - * .greptime.v1.meta.NodeInfo info = 8; + * .greptime.v1.meta.RegionLeaderState follower_state = 2; + * @param value The enum numeric value on the wire for followerState to set. + * @return This builder for chaining. */ - public greptime.v1.meta.HeartbeatOuterClass.NodeInfo.Builder getInfoBuilder() { - + public Builder setFollowerStateValue(int value) { + roleStateCase_ = 2; + roleState_ = value; onChanged(); - return getInfoFieldBuilder().getBuilder(); + return this; } /** - * .greptime.v1.meta.NodeInfo info = 8; + * .greptime.v1.meta.RegionLeaderState follower_state = 2; + * @return The followerState. */ - public greptime.v1.meta.HeartbeatOuterClass.NodeInfoOrBuilder getInfoOrBuilder() { - if (infoBuilder_ != null) { - return infoBuilder_.getMessageOrBuilder(); - } else { - return info_ == null ? - greptime.v1.meta.HeartbeatOuterClass.NodeInfo.getDefaultInstance() : info_; + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState getFollowerState() { + if (roleStateCase_ == 2) { + @SuppressWarnings("deprecation") + greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState result = greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState.valueOf( + (java.lang.Integer) roleState_); + return result == null ? greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState.UNRECOGNIZED : result; } + return greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState.Writable; } /** - * .greptime.v1.meta.NodeInfo info = 8; + * .greptime.v1.meta.RegionLeaderState follower_state = 2; + * @param value The followerState to set. + * @return This builder for chaining. */ - private com.google.protobuf.SingleFieldBuilderV3< - greptime.v1.meta.HeartbeatOuterClass.NodeInfo, greptime.v1.meta.HeartbeatOuterClass.NodeInfo.Builder, greptime.v1.meta.HeartbeatOuterClass.NodeInfoOrBuilder> - getInfoFieldBuilder() { - if (infoBuilder_ == null) { - infoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - greptime.v1.meta.HeartbeatOuterClass.NodeInfo, greptime.v1.meta.HeartbeatOuterClass.NodeInfo.Builder, greptime.v1.meta.HeartbeatOuterClass.NodeInfoOrBuilder>( - getInfo(), - getParentForChildren(), - isClean()); - info_ = null; + public Builder setFollowerState(greptime.v1.meta.HeartbeatOuterClass.RegionLeaderState value) { + if (value == null) { + throw new NullPointerException(); } - return infoBuilder_; + roleStateCase_ = 2; + roleState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .greptime.v1.meta.RegionLeaderState follower_state = 2; + * @return This builder for chaining. + */ + public Builder clearFollowerState() { + if (roleStateCase_ == 2) { + roleStateCase_ = 0; + roleState_ = null; + onChanged(); + } + return this; } @java.lang.Override public final Builder setUnknownFields( @@ -2382,41 +3254,41 @@ public final Builder mergeUnknownFields( } - // @@protoc_insertion_point(builder_scope:greptime.v1.meta.HeartbeatRequest) + // @@protoc_insertion_point(builder_scope:greptime.v1.meta.RegionRoleState) } - // @@protoc_insertion_point(class_scope:greptime.v1.meta.HeartbeatRequest) - private static final greptime.v1.meta.HeartbeatOuterClass.HeartbeatRequest DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:greptime.v1.meta.RegionRoleState) + private static final greptime.v1.meta.HeartbeatOuterClass.RegionRoleState DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new greptime.v1.meta.HeartbeatOuterClass.HeartbeatRequest(); + DEFAULT_INSTANCE = new greptime.v1.meta.HeartbeatOuterClass.RegionRoleState(); } - public static greptime.v1.meta.HeartbeatOuterClass.HeartbeatRequest getDefaultInstance() { + public static greptime.v1.meta.HeartbeatOuterClass.RegionRoleState getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override - public HeartbeatRequest parsePartialFrom( + public RegionRoleState parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new HeartbeatRequest(input, extensionRegistry); + return new RegionRoleState(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public greptime.v1.meta.HeartbeatOuterClass.HeartbeatRequest getDefaultInstanceForType() { + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleState getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -3367,22 +4239,30 @@ public interface RegionStatOrBuilder extends /** *
-     * Region role
+     * Region role state
+     * 
+ * + * .greptime.v1.meta.RegionRoleState role_state = 7; + * @return Whether the roleState field is set. + */ + boolean hasRoleState(); + /** + *
+     * Region role state
      * 
* - * .greptime.v1.meta.RegionRole role = 7; - * @return The enum numeric value on the wire for role. + * .greptime.v1.meta.RegionRoleState role_state = 7; + * @return The roleState. */ - int getRoleValue(); + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState getRoleState(); /** *
-     * Region role
+     * Region role state
      * 
* - * .greptime.v1.meta.RegionRole role = 7; - * @return The role. + * .greptime.v1.meta.RegionRoleState role_state = 7; */ - greptime.v1.meta.HeartbeatOuterClass.RegionRole getRole(); + greptime.v1.meta.HeartbeatOuterClass.RegionRoleStateOrBuilder getRoleStateOrBuilder(); /** * map<string, bytes> extensions = 99; @@ -3434,7 +4314,6 @@ private RegionStat(com.google.protobuf.GeneratedMessageV3.Builder builder) { } private RegionStat() { engine_ = ""; - role_ = 0; } @java.lang.Override @@ -3494,10 +4373,17 @@ private RegionStat( engine_ = s; break; } - case 56: { - int rawValue = input.readEnum(); + case 58: { + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.Builder subBuilder = null; + if (roleState_ != null) { + subBuilder = roleState_.toBuilder(); + } + roleState_ = input.readMessage(greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(roleState_); + roleState_ = subBuilder.buildPartial(); + } - role_ = rawValue; break; } case 794: { @@ -3661,31 +4547,42 @@ public java.lang.String getEngine() { } } - public static final int ROLE_FIELD_NUMBER = 7; - private int role_; + public static final int ROLE_STATE_FIELD_NUMBER = 7; + private greptime.v1.meta.HeartbeatOuterClass.RegionRoleState roleState_; + /** + *
+     * Region role state
+     * 
+ * + * .greptime.v1.meta.RegionRoleState role_state = 7; + * @return Whether the roleState field is set. + */ + @java.lang.Override + public boolean hasRoleState() { + return roleState_ != null; + } /** *
-     * Region role
+     * Region role state
      * 
* - * .greptime.v1.meta.RegionRole role = 7; - * @return The enum numeric value on the wire for role. + * .greptime.v1.meta.RegionRoleState role_state = 7; + * @return The roleState. */ - @java.lang.Override public int getRoleValue() { - return role_; + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleState getRoleState() { + return roleState_ == null ? greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.getDefaultInstance() : roleState_; } /** *
-     * Region role
+     * Region role state
      * 
* - * .greptime.v1.meta.RegionRole role = 7; - * @return The role. + * .greptime.v1.meta.RegionRoleState role_state = 7; */ - @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; + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleStateOrBuilder getRoleStateOrBuilder() { + return getRoleState(); } public static final int EXTENSIONS_FIELD_NUMBER = 99; @@ -3798,8 +4695,8 @@ 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_); + if (roleState_ != null) { + output.writeMessage(7, getRoleState()); } com.google.protobuf.GeneratedMessageV3 .serializeStringMapTo( @@ -3835,9 +4732,9 @@ 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()) { + if (roleState_ != null) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(7, role_); + .computeMessageSize(7, getRoleState()); } for (java.util.Map.Entry entry : internalGetExtensions().getMap().entrySet()) { @@ -3874,7 +4771,11 @@ public boolean equals(final java.lang.Object obj) { != other.getApproximateBytes()) return false; if (!getEngine() .equals(other.getEngine())) return false; - if (role_ != other.role_) return false; + if (hasRoleState() != other.hasRoleState()) return false; + if (hasRoleState()) { + if (!getRoleState() + .equals(other.getRoleState())) return false; + } if (!internalGetExtensions().equals( other.internalGetExtensions())) return false; if (!unknownFields.equals(other.unknownFields)) return false; @@ -3902,8 +4803,10 @@ public int hashCode() { getApproximateBytes()); hash = (37 * hash) + ENGINE_FIELD_NUMBER; hash = (53 * hash) + getEngine().hashCode(); - hash = (37 * hash) + ROLE_FIELD_NUMBER; - hash = (53 * hash) + role_; + if (hasRoleState()) { + hash = (37 * hash) + ROLE_STATE_FIELD_NUMBER; + hash = (53 * hash) + getRoleState().hashCode(); + } if (!internalGetExtensions().getMap().isEmpty()) { hash = (37 * hash) + EXTENSIONS_FIELD_NUMBER; hash = (53 * hash) + internalGetExtensions().hashCode(); @@ -4073,8 +4976,12 @@ public Builder clear() { engine_ = ""; - role_ = 0; - + if (roleStateBuilder_ == null) { + roleState_ = null; + } else { + roleState_ = null; + roleStateBuilder_ = null; + } internalGetMutableExtensions().clear(); return this; } @@ -4108,7 +5015,11 @@ public greptime.v1.meta.HeartbeatOuterClass.RegionStat buildPartial() { result.wcus_ = wcus_; result.approximateBytes_ = approximateBytes_; result.engine_ = engine_; - result.role_ = role_; + if (roleStateBuilder_ == null) { + result.roleState_ = roleState_; + } else { + result.roleState_ = roleStateBuilder_.build(); + } result.extensions_ = internalGetExtensions(); result.extensions_.makeImmutable(); onBuilt(); @@ -4175,8 +5086,8 @@ public Builder mergeFrom(greptime.v1.meta.HeartbeatOuterClass.RegionStat other) engine_ = other.engine_; onChanged(); } - if (other.role_ != 0) { - setRoleValue(other.getRoleValue()); + if (other.hasRoleState()) { + mergeRoleState(other.getRoleState()); } internalGetMutableExtensions().mergeFrom( other.internalGetExtensions()); @@ -4466,78 +5377,159 @@ public Builder setEngineBytes( return this; } - private int role_ = 0; + private greptime.v1.meta.HeartbeatOuterClass.RegionRoleState roleState_; + private com.google.protobuf.SingleFieldBuilderV3< + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState, greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.Builder, greptime.v1.meta.HeartbeatOuterClass.RegionRoleStateOrBuilder> roleStateBuilder_; /** *
-       * Region role
+       * Region role state
        * 
* - * .greptime.v1.meta.RegionRole role = 7; - * @return The enum numeric value on the wire for role. + * .greptime.v1.meta.RegionRoleState role_state = 7; + * @return Whether the roleState field is set. */ - @java.lang.Override public int getRoleValue() { - return role_; + public boolean hasRoleState() { + return roleStateBuilder_ != null || roleState_ != null; } /** *
-       * Region role
+       * Region role state
        * 
* - * .greptime.v1.meta.RegionRole role = 7; - * @param value The enum numeric value on the wire for role to set. - * @return This builder for chaining. + * .greptime.v1.meta.RegionRoleState role_state = 7; + * @return The roleState. */ - public Builder setRoleValue(int value) { - - role_ = value; - onChanged(); + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleState getRoleState() { + if (roleStateBuilder_ == null) { + return roleState_ == null ? greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.getDefaultInstance() : roleState_; + } else { + return roleStateBuilder_.getMessage(); + } + } + /** + *
+       * Region role state
+       * 
+ * + * .greptime.v1.meta.RegionRoleState role_state = 7; + */ + public Builder setRoleState(greptime.v1.meta.HeartbeatOuterClass.RegionRoleState value) { + if (roleStateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + roleState_ = value; + onChanged(); + } else { + roleStateBuilder_.setMessage(value); + } + return this; } /** *
-       * Region role
+       * Region role state
        * 
* - * .greptime.v1.meta.RegionRole role = 7; - * @return The role. + * .greptime.v1.meta.RegionRoleState role_state = 7; */ - @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; + public Builder setRoleState( + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.Builder builderForValue) { + if (roleStateBuilder_ == null) { + roleState_ = builderForValue.build(); + onChanged(); + } else { + roleStateBuilder_.setMessage(builderForValue.build()); + } + + return this; } /** *
-       * Region role
+       * Region role state
        * 
* - * .greptime.v1.meta.RegionRole role = 7; - * @param value The role to set. - * @return This builder for chaining. + * .greptime.v1.meta.RegionRoleState role_state = 7; */ - public Builder setRole(greptime.v1.meta.HeartbeatOuterClass.RegionRole value) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeRoleState(greptime.v1.meta.HeartbeatOuterClass.RegionRoleState value) { + if (roleStateBuilder_ == null) { + if (roleState_ != null) { + roleState_ = + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.newBuilder(roleState_).mergeFrom(value).buildPartial(); + } else { + roleState_ = value; + } + onChanged(); + } else { + roleStateBuilder_.mergeFrom(value); } - - role_ = value.getNumber(); - onChanged(); + return this; } /** *
-       * Region role
+       * Region role state
        * 
* - * .greptime.v1.meta.RegionRole role = 7; - * @return This builder for chaining. + * .greptime.v1.meta.RegionRoleState role_state = 7; + */ + public Builder clearRoleState() { + if (roleStateBuilder_ == null) { + roleState_ = null; + onChanged(); + } else { + roleState_ = null; + roleStateBuilder_ = null; + } + + return this; + } + /** + *
+       * Region role state
+       * 
+ * + * .greptime.v1.meta.RegionRoleState role_state = 7; */ - public Builder clearRole() { + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.Builder getRoleStateBuilder() { - role_ = 0; onChanged(); - return this; + return getRoleStateFieldBuilder().getBuilder(); + } + /** + *
+       * Region role state
+       * 
+ * + * .greptime.v1.meta.RegionRoleState role_state = 7; + */ + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleStateOrBuilder getRoleStateOrBuilder() { + if (roleStateBuilder_ != null) { + return roleStateBuilder_.getMessageOrBuilder(); + } else { + return roleState_ == null ? + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.getDefaultInstance() : roleState_; + } + } + /** + *
+       * Region role state
+       * 
+ * + * .greptime.v1.meta.RegionRoleState role_state = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState, greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.Builder, greptime.v1.meta.HeartbeatOuterClass.RegionRoleStateOrBuilder> + getRoleStateFieldBuilder() { + if (roleStateBuilder_ == null) { + roleStateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState, greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.Builder, greptime.v1.meta.HeartbeatOuterClass.RegionRoleStateOrBuilder>( + getRoleState(), + getParentForChildren(), + isClean()); + roleState_ = null; + } + return roleStateBuilder_; } private com.google.protobuf.MapField< @@ -5763,15 +6755,19 @@ public interface GrantedRegionOrBuilder extends long getRegionId(); /** - * .greptime.v1.meta.RegionRole role = 2; - * @return The enum numeric value on the wire for role. + * .greptime.v1.meta.RegionRoleState role_state = 2; + * @return Whether the roleState field is set. */ - int getRoleValue(); + boolean hasRoleState(); /** - * .greptime.v1.meta.RegionRole role = 2; - * @return The role. + * .greptime.v1.meta.RegionRoleState role_state = 2; + * @return The roleState. */ - greptime.v1.meta.HeartbeatOuterClass.RegionRole getRole(); + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState getRoleState(); + /** + * .greptime.v1.meta.RegionRoleState role_state = 2; + */ + greptime.v1.meta.HeartbeatOuterClass.RegionRoleStateOrBuilder getRoleStateOrBuilder(); } /** * Protobuf type {@code greptime.v1.meta.GrantedRegion} @@ -5786,7 +6782,6 @@ private GrantedRegion(com.google.protobuf.GeneratedMessageV3.Builder builder) super(builder); } private GrantedRegion() { - role_ = 0; } @java.lang.Override @@ -5824,10 +6819,17 @@ private GrantedRegion( regionId_ = input.readUInt64(); break; } - case 16: { - int rawValue = input.readEnum(); + case 18: { + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.Builder subBuilder = null; + if (roleState_ != null) { + subBuilder = roleState_.toBuilder(); + } + roleState_ = input.readMessage(greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(roleState_); + roleState_ = subBuilder.buildPartial(); + } - role_ = rawValue; break; } default: { @@ -5875,23 +6877,30 @@ public long getRegionId() { return regionId_; } - public static final int ROLE_FIELD_NUMBER = 2; - private int role_; + public static final int ROLE_STATE_FIELD_NUMBER = 2; + private greptime.v1.meta.HeartbeatOuterClass.RegionRoleState roleState_; /** - * .greptime.v1.meta.RegionRole role = 2; - * @return The enum numeric value on the wire for role. + * .greptime.v1.meta.RegionRoleState role_state = 2; + * @return Whether the roleState field is set. */ - @java.lang.Override public int getRoleValue() { - return role_; + @java.lang.Override + public boolean hasRoleState() { + return roleState_ != null; + } + /** + * .greptime.v1.meta.RegionRoleState role_state = 2; + * @return The roleState. + */ + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleState getRoleState() { + return roleState_ == null ? greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.getDefaultInstance() : roleState_; } /** - * .greptime.v1.meta.RegionRole role = 2; - * @return The role. + * .greptime.v1.meta.RegionRoleState role_state = 2; */ - @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; + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleStateOrBuilder getRoleStateOrBuilder() { + return getRoleState(); } private byte memoizedIsInitialized = -1; @@ -5911,8 +6920,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (regionId_ != 0L) { output.writeUInt64(1, regionId_); } - if (role_ != greptime.v1.meta.HeartbeatOuterClass.RegionRole.Leader.getNumber()) { - output.writeEnum(2, role_); + if (roleState_ != null) { + output.writeMessage(2, getRoleState()); } unknownFields.writeTo(output); } @@ -5927,9 +6936,9 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeUInt64Size(1, regionId_); } - if (role_ != greptime.v1.meta.HeartbeatOuterClass.RegionRole.Leader.getNumber()) { + if (roleState_ != null) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, role_); + .computeMessageSize(2, getRoleState()); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -5948,7 +6957,11 @@ public boolean equals(final java.lang.Object obj) { if (getRegionId() != other.getRegionId()) return false; - if (role_ != other.role_) return false; + if (hasRoleState() != other.hasRoleState()) return false; + if (hasRoleState()) { + if (!getRoleState() + .equals(other.getRoleState())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -5963,8 +6976,10 @@ public int hashCode() { hash = (37 * hash) + REGION_ID_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getRegionId()); - hash = (37 * hash) + ROLE_FIELD_NUMBER; - hash = (53 * hash) + role_; + if (hasRoleState()) { + hash = (37 * hash) + ROLE_STATE_FIELD_NUMBER; + hash = (53 * hash) + getRoleState().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -6100,8 +7115,12 @@ public Builder clear() { super.clear(); regionId_ = 0L; - role_ = 0; - + if (roleStateBuilder_ == null) { + roleState_ = null; + } else { + roleState_ = null; + roleStateBuilder_ = null; + } return this; } @@ -6129,7 +7148,11 @@ public greptime.v1.meta.HeartbeatOuterClass.GrantedRegion build() { public greptime.v1.meta.HeartbeatOuterClass.GrantedRegion buildPartial() { greptime.v1.meta.HeartbeatOuterClass.GrantedRegion result = new greptime.v1.meta.HeartbeatOuterClass.GrantedRegion(this); result.regionId_ = regionId_; - result.role_ = role_; + if (roleStateBuilder_ == null) { + result.roleState_ = roleState_; + } else { + result.roleState_ = roleStateBuilder_.build(); + } onBuilt(); return result; } @@ -6181,8 +7204,8 @@ public Builder mergeFrom(greptime.v1.meta.HeartbeatOuterClass.GrantedRegion othe if (other.getRegionId() != 0L) { setRegionId(other.getRegionId()); } - if (other.role_ != 0) { - setRoleValue(other.getRoleValue()); + if (other.hasRoleState()) { + mergeRoleState(other.getRoleState()); } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -6244,58 +7267,123 @@ public Builder clearRegionId() { return this; } - private int role_ = 0; + private greptime.v1.meta.HeartbeatOuterClass.RegionRoleState roleState_; + private com.google.protobuf.SingleFieldBuilderV3< + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState, greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.Builder, greptime.v1.meta.HeartbeatOuterClass.RegionRoleStateOrBuilder> roleStateBuilder_; /** - * .greptime.v1.meta.RegionRole role = 2; - * @return The enum numeric value on the wire for role. + * .greptime.v1.meta.RegionRoleState role_state = 2; + * @return Whether the roleState field is set. */ - @java.lang.Override public int getRoleValue() { - return role_; + public boolean hasRoleState() { + return roleStateBuilder_ != null || roleState_ != null; } /** - * .greptime.v1.meta.RegionRole role = 2; - * @param value The enum numeric value on the wire for role to set. - * @return This builder for chaining. + * .greptime.v1.meta.RegionRoleState role_state = 2; + * @return The roleState. */ - public Builder setRoleValue(int value) { - - role_ = value; - onChanged(); + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleState getRoleState() { + if (roleStateBuilder_ == null) { + return roleState_ == null ? greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.getDefaultInstance() : roleState_; + } else { + return roleStateBuilder_.getMessage(); + } + } + /** + * .greptime.v1.meta.RegionRoleState role_state = 2; + */ + public Builder setRoleState(greptime.v1.meta.HeartbeatOuterClass.RegionRoleState value) { + if (roleStateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + roleState_ = value; + onChanged(); + } else { + roleStateBuilder_.setMessage(value); + } + return this; } /** - * .greptime.v1.meta.RegionRole role = 2; - * @return The role. + * .greptime.v1.meta.RegionRoleState role_state = 2; */ - @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; + public Builder setRoleState( + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.Builder builderForValue) { + if (roleStateBuilder_ == null) { + roleState_ = builderForValue.build(); + onChanged(); + } else { + roleStateBuilder_.setMessage(builderForValue.build()); + } + + return this; } /** - * .greptime.v1.meta.RegionRole role = 2; - * @param value The role to set. - * @return This builder for chaining. + * .greptime.v1.meta.RegionRoleState role_state = 2; */ - public Builder setRole(greptime.v1.meta.HeartbeatOuterClass.RegionRole value) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeRoleState(greptime.v1.meta.HeartbeatOuterClass.RegionRoleState value) { + if (roleStateBuilder_ == null) { + if (roleState_ != null) { + roleState_ = + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.newBuilder(roleState_).mergeFrom(value).buildPartial(); + } else { + roleState_ = value; + } + onChanged(); + } else { + roleStateBuilder_.mergeFrom(value); } - - role_ = value.getNumber(); - onChanged(); + return this; } /** - * .greptime.v1.meta.RegionRole role = 2; - * @return This builder for chaining. + * .greptime.v1.meta.RegionRoleState role_state = 2; + */ + public Builder clearRoleState() { + if (roleStateBuilder_ == null) { + roleState_ = null; + onChanged(); + } else { + roleState_ = null; + roleStateBuilder_ = null; + } + + return this; + } + /** + * .greptime.v1.meta.RegionRoleState role_state = 2; */ - public Builder clearRole() { + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.Builder getRoleStateBuilder() { - role_ = 0; onChanged(); - return this; + return getRoleStateFieldBuilder().getBuilder(); + } + /** + * .greptime.v1.meta.RegionRoleState role_state = 2; + */ + public greptime.v1.meta.HeartbeatOuterClass.RegionRoleStateOrBuilder getRoleStateOrBuilder() { + if (roleStateBuilder_ != null) { + return roleStateBuilder_.getMessageOrBuilder(); + } else { + return roleState_ == null ? + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.getDefaultInstance() : roleState_; + } + } + /** + * .greptime.v1.meta.RegionRoleState role_state = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState, greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.Builder, greptime.v1.meta.HeartbeatOuterClass.RegionRoleStateOrBuilder> + getRoleStateFieldBuilder() { + if (roleStateBuilder_ == null) { + roleStateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + greptime.v1.meta.HeartbeatOuterClass.RegionRoleState, greptime.v1.meta.HeartbeatOuterClass.RegionRoleState.Builder, greptime.v1.meta.HeartbeatOuterClass.RegionRoleStateOrBuilder>( + getRoleState(), + getParentForChildren(), + isClean()); + roleState_ = null; + } + return roleStateBuilder_; } @java.lang.Override public final Builder setUnknownFields( @@ -10300,6 +11388,11 @@ public greptime.v1.meta.HeartbeatOuterClass.MailboxMessage getDefaultInstanceFor private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_greptime_v1_meta_HeartbeatRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_greptime_v1_meta_RegionRoleState_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_greptime_v1_meta_RegionRoleState_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_greptime_v1_meta_NodeInfo_descriptor; private static final @@ -10365,41 +11458,47 @@ public greptime.v1.meta.HeartbeatOuterClass.MailboxMessage getDefaultInstanceFor "\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\022(\n\004info\030\010 \001(\0132\032.greptime.v1.me" + - "ta.NodeInfo\"F\n\010NodeInfo\022\017\n\007version\030\001 \001(\t" + - "\022\022\n\ngit_commit\030\002 \001(\t\022\025\n\rstart_time_ms\030\003 " + - "\001(\004\"\207\002\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\021approximate" + - "_bytes\030\004 \001(\003\022\016\n\006engine\030\006 \001(\t\022*\n\004role\030\007 \001" + - "(\0162\034.greptime.v1.meta.RegionRole\022@\n\nexte" + - "nsions\030c \003(\0132,.greptime.v1.meta.RegionSt" + - "at.ExtensionsEntry\0321\n\017ExtensionsEntry\022\013\n" + - "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\014:\0028\001\"\265\001\n\021Heartb" + - "eatResponse\0220\n\006header\030\001 \001(\0132 .greptime.v" + - "1.meta.ResponseHeader\0229\n\017mailbox_message" + - "\030\002 \001(\0132 .greptime.v1.meta.MailboxMessage" + - "\0223\n\014region_lease\030\003 \001(\0132\035.greptime.v1.met" + - "a.RegionLease\"N\n\rGrantedRegion\022\021\n\tregion" + - "_id\030\001 \001(\004\022*\n\004role\030\002 \001(\0162\034.greptime.v1.me" + - "ta.RegionRole\"\222\001\n\013RegionLease\0220\n\007regions" + - "\030\001 \003(\0132\037.greptime.v1.meta.GrantedRegion\022" + - "\034\n\024duration_since_epoch\030\002 \001(\004\022\025\n\rlease_s" + - "econds\030\003 \001(\004\022\034\n\024closeable_region_ids\030\004 \003" + - "(\004\"C\n\020AskLeaderRequest\022/\n\006header\030\001 \001(\0132\037" + - ".greptime.v1.meta.RequestHeader\"m\n\021AskLe" + - "aderResponse\0220\n\006header\030\001 \001(\0132 .greptime." + - "v1.meta.ResponseHeader\022&\n\006leader\030\002 \001(\0132\026" + - ".greptime.v1.meta.Peer\"|\n\016MailboxMessage" + - "\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_millis\030\005 \001(" + - "\003\022\016\n\004json\030\006 \001(\tH\000B\t\n\007payload*&\n\nRegionRo" + - "le\022\n\n\006Leader\020\000\022\014\n\010Follower\020\0012\277\001\n\tHeartbe" + - "at\022Z\n\tHeartbeat\022\".greptime.v1.meta.Heart" + - "beatRequest\032#.greptime.v1.meta.Heartbeat" + - "Response\"\000(\0010\001\022V\n\tAskLeader\022\".greptime.v" + - "1.meta.AskLeaderRequest\032#.greptime.v1.me" + - "ta.AskLeaderResponse\"\000B extensions = 99; } @@ -88,7 +97,7 @@ message HeartbeatResponse { message GrantedRegion { uint64 region_id = 1; - RegionRole role = 2; + RegionRoleState role_state = 2; } message RegionLease {