From 7eb2e78be7a104d2582fbea0bcb1e019407da702 Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Fri, 3 Nov 2023 23:40:32 +0900 Subject: [PATCH] feat: use GrantedRegion instead of region_ids (#117) --- c++/greptime/v1/meta/heartbeat.pb.cc | 366 +++++- c++/greptime/v1/meta/heartbeat.pb.h | 317 ++++- go/greptime/v1/meta/heartbeat.pb.go | 278 +++-- .../greptime/v1/meta/HeartbeatOuterClass.java | 1102 ++++++++++++++--- proto/greptime/v1/meta/heartbeat.proto | 7 +- 5 files changed, 1688 insertions(+), 382 deletions(-) diff --git a/c++/greptime/v1/meta/heartbeat.pb.cc b/c++/greptime/v1/meta/heartbeat.pb.cc index c308685b..437c1daa 100644 --- a/c++/greptime/v1/meta/heartbeat.pb.cc +++ b/c++/greptime/v1/meta/heartbeat.pb.cc @@ -76,10 +76,23 @@ 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_._cached_size_)*/{}} {} +struct GrantedRegionDefaultTypeInternal { + PROTOBUF_CONSTEXPR GrantedRegionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GrantedRegionDefaultTypeInternal() {} + union { + GrantedRegion _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GrantedRegionDefaultTypeInternal _GrantedRegion_default_instance_; PROTOBUF_CONSTEXPR RegionLease::RegionLease( ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.region_ids_)*/{} - , /*decltype(_impl_._region_ids_cached_byte_size_)*/{0} + /*decltype(_impl_.regions_)*/{} , /*decltype(_impl_.duration_since_epoch_)*/uint64_t{0u} , /*decltype(_impl_.lease_seconds_)*/uint64_t{0u} , /*decltype(_impl_._cached_size_)*/{}} {} @@ -141,7 +154,7 @@ 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[7]; +static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[8]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2fmeta_2fheartbeat_2eproto[1]; static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fmeta_2fheartbeat_2eproto = nullptr; @@ -182,12 +195,20 @@ const uint32_t TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto::offsets[] P PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatResponse, _impl_.mailbox_message_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::HeartbeatResponse, _impl_.region_lease_), ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::GrantedRegion, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~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_), + ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionLease, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionLease, _impl_.region_ids_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionLease, _impl_.regions_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionLease, _impl_.duration_since_epoch_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RegionLease, _impl_.lease_seconds_), ~0u, // no _has_bits_ @@ -223,16 +244,18 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode { 0, -1, -1, sizeof(::greptime::v1::meta::HeartbeatRequest)}, { 13, -1, -1, sizeof(::greptime::v1::meta::RegionStat)}, { 26, -1, -1, sizeof(::greptime::v1::meta::HeartbeatResponse)}, - { 35, -1, -1, sizeof(::greptime::v1::meta::RegionLease)}, - { 44, -1, -1, sizeof(::greptime::v1::meta::AskLeaderRequest)}, - { 51, -1, -1, sizeof(::greptime::v1::meta::AskLeaderResponse)}, - { 59, -1, -1, sizeof(::greptime::v1::meta::MailboxMessage)}, + { 35, -1, -1, sizeof(::greptime::v1::meta::GrantedRegion)}, + { 43, -1, -1, sizeof(::greptime::v1::meta::RegionLease)}, + { 52, -1, -1, sizeof(::greptime::v1::meta::AskLeaderRequest)}, + { 59, -1, -1, sizeof(::greptime::v1::meta::AskLeaderResponse)}, + { 67, -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::_RegionStat_default_instance_._instance, &::greptime::v1::meta::_HeartbeatResponse_default_instance_._instance, + &::greptime::v1::meta::_GrantedRegion_default_instance_._instance, &::greptime::v1::meta::_RegionLease_default_instance_._instance, &::greptime::v1::meta::_AskLeaderRequest_default_instance_._instance, &::greptime::v1::meta::_AskLeaderResponse_default_instance_._instance, @@ -259,33 +282,36 @@ const char descriptor_table_protodef_greptime_2fv1_2fmeta_2fheartbeat_2eproto[] "a.ResponseHeader\0229\n\017mailbox_message\030\002 \001(" "\0132 .greptime.v1.meta.MailboxMessage\0223\n\014r" "egion_lease\030\003 \001(\0132\035.greptime.v1.meta.Reg" - "ionLease\"V\n\013RegionLease\022\022\n\nregion_ids\030\001 " - "\003(\004\022\034\n\024duration_since_epoch\030\002 \001(\004\022\025\n\rlea" - "se_seconds\030\003 \001(\004\"C\n\020AskLeaderRequest\022/\n\006" - "header\030\001 \001(\0132\037.greptime.v1.meta.RequestH" - "eader\"m\n\021AskLeaderResponse\0220\n\006header\030\001 \001" - "(\0132 .greptime.v1.meta.ResponseHeader\022&\n\006" - "leader\030\002 \001(\0132\026.greptime.v1.meta.Peer\"|\n\016" - "MailboxMessage\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\020timesta" - "mp_millis\030\005 \001(\003\022\016\n\004json\030\006 \001(\tH\000B\t\n\007paylo" - "ad*&\n\nRegionRole\022\n\n\006Leader\020\000\022\014\n\010Follower" - "\020\0012\277\001\n\tHeartbeat\022Z\n\tHeartbeat\022\".greptime" - ".v1.meta.HeartbeatRequest\032#.greptime.v1." - "meta.HeartbeatResponse\"\000(\0010\001\022V\n\tAskLeade" - "r\022\".greptime.v1.meta.AskLeaderRequest\032#." - "greptime.v1.meta.AskLeaderResponse\"\000B(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_)); + // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.GrantedRegion) +} + +inline void GrantedRegion::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.region_id_){uint64_t{0u}} + , decltype(_impl_.role_){0} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +GrantedRegion::~GrantedRegion() { + // @@protoc_insertion_point(destructor:greptime.v1.meta.GrantedRegion) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void GrantedRegion::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void GrantedRegion::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void GrantedRegion::Clear() { +// @@protoc_insertion_point(message_clear_start:greptime.v1.meta.GrantedRegion) + uint32_t cached_has_bits = 0; + // 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_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* GrantedRegion::_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) { + // uint64 region_id = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.region_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .greptime.v1.meta.RegionRole role = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_role(static_cast<::greptime::v1::meta::RegionRole>(val)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + 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* GrantedRegion::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.GrantedRegion) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 region_id = 1; + if (this->_internal_region_id() != 0) { + target = stream->EnsureSpace(target); + 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); + } + + 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.GrantedRegion) + return target; +} + +size_t GrantedRegion::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.GrantedRegion) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // 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_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GrantedRegion::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + GrantedRegion::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GrantedRegion::GetClassData() const { return &_class_data_; } + + +void GrantedRegion::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.GrantedRegion) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + 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_); +} + +void GrantedRegion::CopyFrom(const GrantedRegion& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.meta.GrantedRegion) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GrantedRegion::IsInitialized() const { + return true; +} + +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_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[3]); +} + +// =================================================================== + class RegionLease::_Internal { public: }; @@ -1405,8 +1645,7 @@ RegionLease::RegionLease(const RegionLease& from) : ::PROTOBUF_NAMESPACE_ID::Message() { RegionLease* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.region_ids_){from._impl_.region_ids_} - , /*decltype(_impl_._region_ids_cached_byte_size_)*/{0} + decltype(_impl_.regions_){from._impl_.regions_} , decltype(_impl_.duration_since_epoch_){} , decltype(_impl_.lease_seconds_){} , /*decltype(_impl_._cached_size_)*/{}}; @@ -1423,8 +1662,7 @@ inline void RegionLease::SharedCtor( (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.region_ids_){arena} - , /*decltype(_impl_._region_ids_cached_byte_size_)*/{0} + decltype(_impl_.regions_){arena} , decltype(_impl_.duration_since_epoch_){uint64_t{0u}} , decltype(_impl_.lease_seconds_){uint64_t{0u}} , /*decltype(_impl_._cached_size_)*/{} @@ -1442,7 +1680,7 @@ RegionLease::~RegionLease() { inline void RegionLease::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.region_ids_.~RepeatedField(); + _impl_.regions_.~RepeatedPtrField(); } void RegionLease::SetCachedSize(int size) const { @@ -1455,7 +1693,7 @@ void RegionLease::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.region_ids_.Clear(); + _impl_.regions_.Clear(); ::memset(&_impl_.duration_since_epoch_, 0, static_cast( reinterpret_cast(&_impl_.lease_seconds_) - reinterpret_cast(&_impl_.duration_since_epoch_)) + sizeof(_impl_.lease_seconds_)); @@ -1468,14 +1706,16 @@ const char* RegionLease::_InternalParse(const char* ptr, ::_pbi::ParseContext* c uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // repeated uint64 region_ids = 1; + // repeated .greptime.v1.meta.GrantedRegion regions = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_region_ids(), ptr, ctx); - CHK_(ptr); - } else if (static_cast(tag) == 8) { - _internal_add_region_ids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr)); - CHK_(ptr); + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_regions(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); } else goto handle_unusual; continue; @@ -1524,13 +1764,12 @@ uint8_t* RegionLease::_InternalSerialize( uint32_t cached_has_bits = 0; (void) cached_has_bits; - // repeated uint64 region_ids = 1; - { - int byte_size = _impl_._region_ids_cached_byte_size_.load(std::memory_order_relaxed); - if (byte_size > 0) { - target = stream->WriteUInt64Packed( - 1, _internal_region_ids(), byte_size, target); - } + // repeated .greptime.v1.meta.GrantedRegion regions = 1; + for (unsigned i = 0, + n = static_cast(this->_internal_regions_size()); i < n; i++) { + const auto& repfield = this->_internal_regions(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); } // uint64 duration_since_epoch = 2; @@ -1561,18 +1800,11 @@ size_t RegionLease::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated uint64 region_ids = 1; - { - size_t data_size = ::_pbi::WireFormatLite:: - UInt64Size(this->_impl_.region_ids_); - if (data_size > 0) { - total_size += 1 + - ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); - } - int cached_size = ::_pbi::ToCachedSize(data_size); - _impl_._region_ids_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; + // repeated .greptime.v1.meta.GrantedRegion regions = 1; + total_size += 1UL * this->_internal_regions_size(); + for (const auto& msg : this->_impl_.regions_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } // uint64 duration_since_epoch = 2; @@ -1603,7 +1835,7 @@ void RegionLease::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PR uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.region_ids_.MergeFrom(from._impl_.region_ids_); + _this->_impl_.regions_.MergeFrom(from._impl_.regions_); if (from._internal_duration_since_epoch() != 0) { _this->_internal_set_duration_since_epoch(from._internal_duration_since_epoch()); } @@ -1627,7 +1859,7 @@ bool RegionLease::IsInitialized() const { void RegionLease::InternalSwap(RegionLease* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.region_ids_.InternalSwap(&other->_impl_.region_ids_); + _impl_.regions_.InternalSwap(&other->_impl_.regions_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< PROTOBUF_FIELD_OFFSET(RegionLease, _impl_.lease_seconds_) + sizeof(RegionLease::_impl_.lease_seconds_) @@ -1639,7 +1871,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[3]); + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[4]); } // =================================================================== @@ -1838,7 +2070,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[4]); + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[5]); } // =================================================================== @@ -2089,7 +2321,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[5]); + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[6]); } // =================================================================== @@ -2529,7 +2761,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[6]); + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[7]); } // @@protoc_insertion_point(namespace_scope) @@ -2549,6 +2781,10 @@ template<> PROTOBUF_NOINLINE ::greptime::v1::meta::HeartbeatResponse* Arena::CreateMaybeMessage< ::greptime::v1::meta::HeartbeatResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::greptime::v1::meta::HeartbeatResponse >(arena); } +template<> PROTOBUF_NOINLINE ::greptime::v1::meta::GrantedRegion* +Arena::CreateMaybeMessage< ::greptime::v1::meta::GrantedRegion >(Arena* arena) { + return Arena::CreateMessageInternal< ::greptime::v1::meta::GrantedRegion >(arena); +} template<> PROTOBUF_NOINLINE ::greptime::v1::meta::RegionLease* Arena::CreateMaybeMessage< ::greptime::v1::meta::RegionLease >(Arena* arena) { return Arena::CreateMessageInternal< ::greptime::v1::meta::RegionLease >(arena); diff --git a/c++/greptime/v1/meta/heartbeat.pb.h b/c++/greptime/v1/meta/heartbeat.pb.h index d096bd45..6036e778 100644 --- a/c++/greptime/v1/meta/heartbeat.pb.h +++ b/c++/greptime/v1/meta/heartbeat.pb.h @@ -55,6 +55,9 @@ extern AskLeaderRequestDefaultTypeInternal _AskLeaderRequest_default_instance_; class AskLeaderResponse; struct AskLeaderResponseDefaultTypeInternal; extern AskLeaderResponseDefaultTypeInternal _AskLeaderResponse_default_instance_; +class GrantedRegion; +struct GrantedRegionDefaultTypeInternal; +extern GrantedRegionDefaultTypeInternal _GrantedRegion_default_instance_; class HeartbeatRequest; struct HeartbeatRequestDefaultTypeInternal; extern HeartbeatRequestDefaultTypeInternal _HeartbeatRequest_default_instance_; @@ -76,6 +79,7 @@ extern RegionStatDefaultTypeInternal _RegionStat_default_instance_; PROTOBUF_NAMESPACE_OPEN template<> ::greptime::v1::meta::AskLeaderRequest* Arena::CreateMaybeMessage<::greptime::v1::meta::AskLeaderRequest>(Arena*); template<> ::greptime::v1::meta::AskLeaderResponse* Arena::CreateMaybeMessage<::greptime::v1::meta::AskLeaderResponse>(Arena*); +template<> ::greptime::v1::meta::GrantedRegion* Arena::CreateMaybeMessage<::greptime::v1::meta::GrantedRegion>(Arena*); template<> ::greptime::v1::meta::HeartbeatRequest* Arena::CreateMaybeMessage<::greptime::v1::meta::HeartbeatRequest>(Arena*); template<> ::greptime::v1::meta::HeartbeatResponse* Arena::CreateMaybeMessage<::greptime::v1::meta::HeartbeatResponse>(Arena*); template<> ::greptime::v1::meta::MailboxMessage* Arena::CreateMaybeMessage<::greptime::v1::meta::MailboxMessage>(Arena*); @@ -788,6 +792,165 @@ class HeartbeatResponse final : }; // ------------------------------------------------------------------- +class GrantedRegion final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.meta.GrantedRegion) */ { + public: + inline GrantedRegion() : GrantedRegion(nullptr) {} + ~GrantedRegion() override; + explicit PROTOBUF_CONSTEXPR GrantedRegion(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + GrantedRegion(const GrantedRegion& from); + GrantedRegion(GrantedRegion&& from) noexcept + : GrantedRegion() { + *this = ::std::move(from); + } + + inline GrantedRegion& operator=(const GrantedRegion& from) { + CopyFrom(from); + return *this; + } + inline GrantedRegion& operator=(GrantedRegion&& 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 GrantedRegion& default_instance() { + return *internal_default_instance(); + } + static inline const GrantedRegion* internal_default_instance() { + return reinterpret_cast( + &_GrantedRegion_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + friend void swap(GrantedRegion& a, GrantedRegion& b) { + a.Swap(&b); + } + inline void Swap(GrantedRegion* 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(GrantedRegion* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + GrantedRegion* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const GrantedRegion& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const GrantedRegion& from) { + GrantedRegion::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(GrantedRegion* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "greptime.v1.meta.GrantedRegion"; + } + protected: + explicit GrantedRegion(::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 { + kRegionIdFieldNumber = 1, + kRoleFieldNumber = 2, + }; + // uint64 region_id = 1; + void clear_region_id(); + uint64_t region_id() const; + void set_region_id(uint64_t value); + private: + uint64_t _internal_region_id() const; + 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; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + uint64_t region_id_; + int role_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto; +}; +// ------------------------------------------------------------------- + class RegionLease final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.meta.RegionLease) */ { public: @@ -836,7 +999,7 @@ class RegionLease final : &_RegionLease_default_instance_); } static constexpr int kIndexInFileMessages = - 3; + 4; friend void swap(RegionLease& a, RegionLease& b) { a.Swap(&b); @@ -909,31 +1072,27 @@ class RegionLease final : // accessors ------------------------------------------------------- enum : int { - kRegionIdsFieldNumber = 1, + kRegionsFieldNumber = 1, kDurationSinceEpochFieldNumber = 2, kLeaseSecondsFieldNumber = 3, }; - // repeated uint64 region_ids = 1; - int region_ids_size() const; + // repeated .greptime.v1.meta.GrantedRegion regions = 1; + int regions_size() const; private: - int _internal_region_ids_size() const; + int _internal_regions_size() const; public: - void clear_region_ids(); - private: - uint64_t _internal_region_ids(int index) const; - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& - _internal_region_ids() const; - void _internal_add_region_ids(uint64_t value); - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* - _internal_mutable_region_ids(); + void clear_regions(); + ::greptime::v1::meta::GrantedRegion* mutable_regions(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::greptime::v1::meta::GrantedRegion >* + mutable_regions(); + private: + const ::greptime::v1::meta::GrantedRegion& _internal_regions(int index) const; + ::greptime::v1::meta::GrantedRegion* _internal_add_regions(); public: - uint64_t region_ids(int index) const; - void set_region_ids(int index, uint64_t value); - void add_region_ids(uint64_t value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& - region_ids() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* - mutable_region_ids(); + const ::greptime::v1::meta::GrantedRegion& regions(int index) const; + ::greptime::v1::meta::GrantedRegion* add_regions(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::greptime::v1::meta::GrantedRegion >& + regions() const; // uint64 duration_since_epoch = 2; void clear_duration_since_epoch(); @@ -961,8 +1120,7 @@ class RegionLease final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t > region_ids_; - mutable std::atomic _region_ids_cached_byte_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::greptime::v1::meta::GrantedRegion > regions_; uint64_t duration_since_epoch_; uint64_t lease_seconds_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; @@ -1020,7 +1178,7 @@ class AskLeaderRequest final : &_AskLeaderRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 4; + 5; friend void swap(AskLeaderRequest& a, AskLeaderRequest& b) { a.Swap(&b); @@ -1177,7 +1335,7 @@ class AskLeaderResponse final : &_AskLeaderResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 5; + 6; friend void swap(AskLeaderResponse& a, AskLeaderResponse& b) { a.Swap(&b); @@ -1359,7 +1517,7 @@ class MailboxMessage final : &_MailboxMessage_default_instance_); } static constexpr int kIndexInFileMessages = - 6; + 7; friend void swap(MailboxMessage& a, MailboxMessage& b) { a.Swap(&b); @@ -2429,53 +2587,90 @@ inline void HeartbeatResponse::set_allocated_region_lease(::greptime::v1::meta:: // ------------------------------------------------------------------- -// RegionLease +// GrantedRegion + +// uint64 region_id = 1; +inline void GrantedRegion::clear_region_id() { + _impl_.region_id_ = uint64_t{0u}; +} +inline uint64_t GrantedRegion::_internal_region_id() const { + return _impl_.region_id_; +} +inline uint64_t GrantedRegion::region_id() const { + // @@protoc_insertion_point(field_get:greptime.v1.meta.GrantedRegion.region_id) + return _internal_region_id(); +} +inline void GrantedRegion::_internal_set_region_id(uint64_t value) { + + _impl_.region_id_ = value; +} +inline void GrantedRegion::set_region_id(uint64_t value) { + _internal_set_region_id(value); + // @@protoc_insertion_point(field_set:greptime.v1.meta.GrantedRegion.region_id) +} -// repeated uint64 region_ids = 1; -inline int RegionLease::_internal_region_ids_size() const { - return _impl_.region_ids_.size(); +// .greptime.v1.meta.RegionRole role = 2; +inline void GrantedRegion::clear_role() { + _impl_.role_ = 0; } -inline int RegionLease::region_ids_size() const { - return _internal_region_ids_size(); +inline ::greptime::v1::meta::RegionRole GrantedRegion::_internal_role() const { + return static_cast< ::greptime::v1::meta::RegionRole >(_impl_.role_); } -inline void RegionLease::clear_region_ids() { - _impl_.region_ids_.Clear(); +inline ::greptime::v1::meta::RegionRole GrantedRegion::role() const { + // @@protoc_insertion_point(field_get:greptime.v1.meta.GrantedRegion.role) + return _internal_role(); } -inline uint64_t RegionLease::_internal_region_ids(int index) const { - return _impl_.region_ids_.Get(index); +inline void GrantedRegion::_internal_set_role(::greptime::v1::meta::RegionRole value) { + + _impl_.role_ = value; } -inline uint64_t RegionLease::region_ids(int index) const { - // @@protoc_insertion_point(field_get:greptime.v1.meta.RegionLease.region_ids) - return _internal_region_ids(index); +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 void RegionLease::set_region_ids(int index, uint64_t value) { - _impl_.region_ids_.Set(index, value); - // @@protoc_insertion_point(field_set:greptime.v1.meta.RegionLease.region_ids) + +// ------------------------------------------------------------------- + +// RegionLease + +// repeated .greptime.v1.meta.GrantedRegion regions = 1; +inline int RegionLease::_internal_regions_size() const { + return _impl_.regions_.size(); +} +inline int RegionLease::regions_size() const { + return _internal_regions_size(); } -inline void RegionLease::_internal_add_region_ids(uint64_t value) { - _impl_.region_ids_.Add(value); +inline void RegionLease::clear_regions() { + _impl_.regions_.Clear(); } -inline void RegionLease::add_region_ids(uint64_t value) { - _internal_add_region_ids(value); - // @@protoc_insertion_point(field_add:greptime.v1.meta.RegionLease.region_ids) +inline ::greptime::v1::meta::GrantedRegion* RegionLease::mutable_regions(int index) { + // @@protoc_insertion_point(field_mutable:greptime.v1.meta.RegionLease.regions) + return _impl_.regions_.Mutable(index); } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& -RegionLease::_internal_region_ids() const { - return _impl_.region_ids_; +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::greptime::v1::meta::GrantedRegion >* +RegionLease::mutable_regions() { + // @@protoc_insertion_point(field_mutable_list:greptime.v1.meta.RegionLease.regions) + return &_impl_.regions_; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >& -RegionLease::region_ids() const { - // @@protoc_insertion_point(field_list:greptime.v1.meta.RegionLease.region_ids) - return _internal_region_ids(); +inline const ::greptime::v1::meta::GrantedRegion& RegionLease::_internal_regions(int index) const { + return _impl_.regions_.Get(index); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* -RegionLease::_internal_mutable_region_ids() { - return &_impl_.region_ids_; +inline const ::greptime::v1::meta::GrantedRegion& RegionLease::regions(int index) const { + // @@protoc_insertion_point(field_get:greptime.v1.meta.RegionLease.regions) + return _internal_regions(index); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >* -RegionLease::mutable_region_ids() { - // @@protoc_insertion_point(field_mutable_list:greptime.v1.meta.RegionLease.region_ids) - return _internal_mutable_region_ids(); +inline ::greptime::v1::meta::GrantedRegion* RegionLease::_internal_add_regions() { + return _impl_.regions_.Add(); +} +inline ::greptime::v1::meta::GrantedRegion* RegionLease::add_regions() { + ::greptime::v1::meta::GrantedRegion* _add = _internal_add_regions(); + // @@protoc_insertion_point(field_add:greptime.v1.meta.RegionLease.regions) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::greptime::v1::meta::GrantedRegion >& +RegionLease::regions() const { + // @@protoc_insertion_point(field_list:greptime.v1.meta.RegionLease.regions) + return _impl_.regions_; } // uint64 duration_since_epoch = 2; @@ -3076,6 +3271,8 @@ inline MailboxMessage::PayloadCase MailboxMessage::payload_case() const { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/go/greptime/v1/meta/heartbeat.pb.go b/go/greptime/v1/meta/heartbeat.pb.go index dee4b10e..a9a9b6d6 100644 --- a/go/greptime/v1/meta/heartbeat.pb.go +++ b/go/greptime/v1/meta/heartbeat.pb.go @@ -347,20 +347,75 @@ func (x *HeartbeatResponse) GetRegionLease() *RegionLease { return nil } +type GrantedRegion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RegionId uint64 `protobuf:"varint,1,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` + Role RegionRole `protobuf:"varint,2,opt,name=role,proto3,enum=greptime.v1.meta.RegionRole" json:"role,omitempty"` +} + +func (x *GrantedRegion) Reset() { + *x = GrantedRegion{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GrantedRegion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrantedRegion) ProtoMessage() {} + +func (x *GrantedRegion) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GrantedRegion.ProtoReflect.Descriptor instead. +func (*GrantedRegion) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{3} +} + +func (x *GrantedRegion) GetRegionId() uint64 { + if x != nil { + return x.RegionId + } + return 0 +} + +func (x *GrantedRegion) GetRole() RegionRole { + if x != nil { + return x.Role + } + return RegionRole_Leader +} + type RegionLease struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - RegionIds []uint64 `protobuf:"varint,1,rep,packed,name=region_ids,json=regionIds,proto3" json:"region_ids,omitempty"` - DurationSinceEpoch uint64 `protobuf:"varint,2,opt,name=duration_since_epoch,json=durationSinceEpoch,proto3" json:"duration_since_epoch,omitempty"` - LeaseSeconds uint64 `protobuf:"varint,3,opt,name=lease_seconds,json=leaseSeconds,proto3" json:"lease_seconds,omitempty"` + Regions []*GrantedRegion `protobuf:"bytes,1,rep,name=regions,proto3" json:"regions,omitempty"` + DurationSinceEpoch uint64 `protobuf:"varint,2,opt,name=duration_since_epoch,json=durationSinceEpoch,proto3" json:"duration_since_epoch,omitempty"` + LeaseSeconds uint64 `protobuf:"varint,3,opt,name=lease_seconds,json=leaseSeconds,proto3" json:"lease_seconds,omitempty"` } func (x *RegionLease) Reset() { *x = RegionLease{} if protoimpl.UnsafeEnabled { - mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[3] + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -373,7 +428,7 @@ func (x *RegionLease) String() string { func (*RegionLease) ProtoMessage() {} func (x *RegionLease) 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 { @@ -386,12 +441,12 @@ 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{3} + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{4} } -func (x *RegionLease) GetRegionIds() []uint64 { +func (x *RegionLease) GetRegions() []*GrantedRegion { if x != nil { - return x.RegionIds + return x.Regions } return nil } @@ -421,7 +476,7 @@ type AskLeaderRequest struct { func (x *AskLeaderRequest) Reset() { *x = AskLeaderRequest{} 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) } @@ -434,7 +489,7 @@ func (x *AskLeaderRequest) String() string { func (*AskLeaderRequest) ProtoMessage() {} func (x *AskLeaderRequest) 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 { @@ -447,7 +502,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{4} + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{5} } func (x *AskLeaderRequest) GetHeader() *RequestHeader { @@ -469,7 +524,7 @@ type AskLeaderResponse struct { func (x *AskLeaderResponse) Reset() { *x = AskLeaderResponse{} 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) } @@ -482,7 +537,7 @@ func (x *AskLeaderResponse) String() string { func (*AskLeaderResponse) ProtoMessage() {} func (x *AskLeaderResponse) 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 { @@ -495,7 +550,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{5} + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{6} } func (x *AskLeaderResponse) GetHeader() *ResponseHeader { @@ -537,7 +592,7 @@ type MailboxMessage struct { func (x *MailboxMessage) Reset() { *x = MailboxMessage{} 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) } @@ -550,7 +605,7 @@ func (x *MailboxMessage) String() string { func (*MailboxMessage) ProtoMessage() {} func (x *MailboxMessage) 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 { @@ -563,7 +618,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{6} + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{7} } func (x *MailboxMessage) GetId() uint64 { @@ -688,58 +743,66 @@ var file_greptime_v1_meta_heartbeat_proto_rawDesc = []byte{ 0x65, 0x61, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x0b, 0x72, 0x65, 0x67, 0x69, 0x6f, - 0x6e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x83, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x69, 0x6f, - 0x6e, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x09, 0x72, 0x65, 0x67, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x12, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x6e, - 0x63, 0x65, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0x4b, 0x0a, 0x10, - 0x41, 0x73, 0x6b, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, - 0x65, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x7d, 0x0a, 0x11, 0x41, 0x73, 0x6b, - 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, - 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, - 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, - 0x61, 0x2e, 0x52, 0x65, 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, + 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, 0x9f, 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, 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, - 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, + 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, 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, 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, + 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 ( @@ -755,43 +818,46 @@ func file_greptime_v1_meta_heartbeat_proto_rawDescGZIP() []byte { } var file_greptime_v1_meta_heartbeat_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_greptime_v1_meta_heartbeat_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_greptime_v1_meta_heartbeat_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_greptime_v1_meta_heartbeat_proto_goTypes = []interface{}{ (RegionRole)(0), // 0: greptime.v1.meta.RegionRole (*HeartbeatRequest)(nil), // 1: greptime.v1.meta.HeartbeatRequest (*RegionStat)(nil), // 2: greptime.v1.meta.RegionStat (*HeartbeatResponse)(nil), // 3: greptime.v1.meta.HeartbeatResponse - (*RegionLease)(nil), // 4: greptime.v1.meta.RegionLease - (*AskLeaderRequest)(nil), // 5: greptime.v1.meta.AskLeaderRequest - (*AskLeaderResponse)(nil), // 6: greptime.v1.meta.AskLeaderResponse - (*MailboxMessage)(nil), // 7: greptime.v1.meta.MailboxMessage - (*RequestHeader)(nil), // 8: greptime.v1.meta.RequestHeader - (*Peer)(nil), // 9: greptime.v1.meta.Peer - (*TimeInterval)(nil), // 10: greptime.v1.meta.TimeInterval - (*ResponseHeader)(nil), // 11: greptime.v1.meta.ResponseHeader + (*GrantedRegion)(nil), // 4: greptime.v1.meta.GrantedRegion + (*RegionLease)(nil), // 5: greptime.v1.meta.RegionLease + (*AskLeaderRequest)(nil), // 6: greptime.v1.meta.AskLeaderRequest + (*AskLeaderResponse)(nil), // 7: greptime.v1.meta.AskLeaderResponse + (*MailboxMessage)(nil), // 8: greptime.v1.meta.MailboxMessage + (*RequestHeader)(nil), // 9: greptime.v1.meta.RequestHeader + (*Peer)(nil), // 10: greptime.v1.meta.Peer + (*TimeInterval)(nil), // 11: greptime.v1.meta.TimeInterval + (*ResponseHeader)(nil), // 12: greptime.v1.meta.ResponseHeader } var file_greptime_v1_meta_heartbeat_proto_depIdxs = []int32{ - 8, // 0: greptime.v1.meta.HeartbeatRequest.header:type_name -> greptime.v1.meta.RequestHeader - 9, // 1: greptime.v1.meta.HeartbeatRequest.peer:type_name -> greptime.v1.meta.Peer - 10, // 2: greptime.v1.meta.HeartbeatRequest.report_interval:type_name -> greptime.v1.meta.TimeInterval + 9, // 0: greptime.v1.meta.HeartbeatRequest.header:type_name -> greptime.v1.meta.RequestHeader + 10, // 1: greptime.v1.meta.HeartbeatRequest.peer:type_name -> greptime.v1.meta.Peer + 11, // 2: greptime.v1.meta.HeartbeatRequest.report_interval:type_name -> greptime.v1.meta.TimeInterval 2, // 3: greptime.v1.meta.HeartbeatRequest.region_stats:type_name -> greptime.v1.meta.RegionStat - 7, // 4: greptime.v1.meta.HeartbeatRequest.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage + 8, // 4: greptime.v1.meta.HeartbeatRequest.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage 0, // 5: greptime.v1.meta.RegionStat.role:type_name -> greptime.v1.meta.RegionRole - 11, // 6: greptime.v1.meta.HeartbeatResponse.header:type_name -> greptime.v1.meta.ResponseHeader - 7, // 7: greptime.v1.meta.HeartbeatResponse.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage - 4, // 8: greptime.v1.meta.HeartbeatResponse.region_lease:type_name -> greptime.v1.meta.RegionLease - 8, // 9: greptime.v1.meta.AskLeaderRequest.header:type_name -> greptime.v1.meta.RequestHeader - 11, // 10: greptime.v1.meta.AskLeaderResponse.header:type_name -> greptime.v1.meta.ResponseHeader - 9, // 11: greptime.v1.meta.AskLeaderResponse.leader:type_name -> greptime.v1.meta.Peer - 1, // 12: greptime.v1.meta.Heartbeat.Heartbeat:input_type -> greptime.v1.meta.HeartbeatRequest - 5, // 13: greptime.v1.meta.Heartbeat.AskLeader:input_type -> greptime.v1.meta.AskLeaderRequest - 3, // 14: greptime.v1.meta.Heartbeat.Heartbeat:output_type -> greptime.v1.meta.HeartbeatResponse - 6, // 15: greptime.v1.meta.Heartbeat.AskLeader:output_type -> greptime.v1.meta.AskLeaderResponse - 14, // [14:16] is the sub-list for method output_type - 12, // [12:14] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 12, // 6: greptime.v1.meta.HeartbeatResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 8, // 7: greptime.v1.meta.HeartbeatResponse.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage + 5, // 8: greptime.v1.meta.HeartbeatResponse.region_lease:type_name -> greptime.v1.meta.RegionLease + 0, // 9: greptime.v1.meta.GrantedRegion.role:type_name -> greptime.v1.meta.RegionRole + 4, // 10: greptime.v1.meta.RegionLease.regions:type_name -> greptime.v1.meta.GrantedRegion + 9, // 11: greptime.v1.meta.AskLeaderRequest.header:type_name -> greptime.v1.meta.RequestHeader + 12, // 12: greptime.v1.meta.AskLeaderResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 10, // 13: greptime.v1.meta.AskLeaderResponse.leader:type_name -> greptime.v1.meta.Peer + 1, // 14: greptime.v1.meta.Heartbeat.Heartbeat:input_type -> greptime.v1.meta.HeartbeatRequest + 6, // 15: greptime.v1.meta.Heartbeat.AskLeader:input_type -> greptime.v1.meta.AskLeaderRequest + 3, // 16: greptime.v1.meta.Heartbeat.Heartbeat:output_type -> greptime.v1.meta.HeartbeatResponse + 7, // 17: greptime.v1.meta.Heartbeat.AskLeader:output_type -> greptime.v1.meta.AskLeaderResponse + 16, // [16:18] is the sub-list for method output_type + 14, // [14:16] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_greptime_v1_meta_heartbeat_proto_init() } @@ -838,7 +904,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.(*RegionLease); i { + switch v := v.(*GrantedRegion); i { case 0: return &v.state case 1: @@ -850,7 +916,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.(*AskLeaderRequest); i { + switch v := v.(*RegionLease); i { case 0: return &v.state case 1: @@ -862,7 +928,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.(*AskLeaderResponse); i { + switch v := v.(*AskLeaderRequest); i { case 0: return &v.state case 1: @@ -874,6 +940,18 @@ 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.(*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[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MailboxMessage); i { case 0: return &v.state @@ -886,7 +964,7 @@ func file_greptime_v1_meta_heartbeat_proto_init() { } } } - file_greptime_v1_meta_heartbeat_proto_msgTypes[6].OneofWrappers = []interface{}{ + file_greptime_v1_meta_heartbeat_proto_msgTypes[7].OneofWrappers = []interface{}{ (*MailboxMessage_Json)(nil), } type x struct{} @@ -895,7 +973,7 @@ func file_greptime_v1_meta_heartbeat_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_greptime_v1_meta_heartbeat_proto_rawDesc, NumEnums: 1, - NumMessages: 7, + NumMessages: 8, 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 89384123..64eb7588 100644 --- a/java/src/main/java/greptime/v1/meta/HeartbeatOuterClass.java +++ b/java/src/main/java/greptime/v1/meta/HeartbeatOuterClass.java @@ -4432,26 +4432,631 @@ public greptime.v1.meta.HeartbeatOuterClass.HeartbeatResponse getDefaultInstance } + public interface GrantedRegionOrBuilder extends + // @@protoc_insertion_point(interface_extends:greptime.v1.meta.GrantedRegion) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 region_id = 1; + * @return The regionId. + */ + long getRegionId(); + + /** + * .greptime.v1.meta.RegionRole role = 2; + * @return The enum numeric value on the wire for role. + */ + int getRoleValue(); + /** + * .greptime.v1.meta.RegionRole role = 2; + * @return The role. + */ + greptime.v1.meta.HeartbeatOuterClass.RegionRole getRole(); + } + /** + * Protobuf type {@code greptime.v1.meta.GrantedRegion} + */ + public static final class GrantedRegion extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:greptime.v1.meta.GrantedRegion) + GrantedRegionOrBuilder { + private static final long serialVersionUID = 0L; + // Use GrantedRegion.newBuilder() to construct. + private GrantedRegion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GrantedRegion() { + role_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GrantedRegion(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GrantedRegion( + 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: { + + regionId_ = input.readUInt64(); + break; + } + case 16: { + int rawValue = input.readEnum(); + + role_ = 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_GrantedRegion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_GrantedRegion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.class, greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.Builder.class); + } + + public static final int REGION_ID_FIELD_NUMBER = 1; + private long regionId_; + /** + * uint64 region_id = 1; + * @return The regionId. + */ + @java.lang.Override + public long getRegionId() { + return regionId_; + } + + public static final int ROLE_FIELD_NUMBER = 2; + private int role_; + /** + * .greptime.v1.meta.RegionRole role = 2; + * @return The enum numeric value on the wire for role. + */ + @java.lang.Override public int getRoleValue() { + return role_; + } + /** + * .greptime.v1.meta.RegionRole role = 2; + * @return The role. + */ + @java.lang.Override public greptime.v1.meta.HeartbeatOuterClass.RegionRole getRole() { + @SuppressWarnings("deprecation") + greptime.v1.meta.HeartbeatOuterClass.RegionRole result = greptime.v1.meta.HeartbeatOuterClass.RegionRole.valueOf(role_); + return result == null ? greptime.v1.meta.HeartbeatOuterClass.RegionRole.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + 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 (regionId_ != 0L) { + output.writeUInt64(1, regionId_); + } + if (role_ != greptime.v1.meta.HeartbeatOuterClass.RegionRole.Leader.getNumber()) { + output.writeEnum(2, role_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (regionId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, regionId_); + } + if (role_ != greptime.v1.meta.HeartbeatOuterClass.RegionRole.Leader.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, role_); + } + 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.GrantedRegion)) { + return super.equals(obj); + } + greptime.v1.meta.HeartbeatOuterClass.GrantedRegion other = (greptime.v1.meta.HeartbeatOuterClass.GrantedRegion) obj; + + if (getRegionId() + != other.getRegionId()) return false; + if (role_ != other.role_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + 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_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static greptime.v1.meta.HeartbeatOuterClass.GrantedRegion parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static greptime.v1.meta.HeartbeatOuterClass.GrantedRegion 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.GrantedRegion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static greptime.v1.meta.HeartbeatOuterClass.GrantedRegion 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.GrantedRegion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static greptime.v1.meta.HeartbeatOuterClass.GrantedRegion parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static greptime.v1.meta.HeartbeatOuterClass.GrantedRegion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static greptime.v1.meta.HeartbeatOuterClass.GrantedRegion 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.GrantedRegion parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static greptime.v1.meta.HeartbeatOuterClass.GrantedRegion 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.GrantedRegion parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static greptime.v1.meta.HeartbeatOuterClass.GrantedRegion 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.GrantedRegion 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.GrantedRegion} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:greptime.v1.meta.GrantedRegion) + greptime.v1.meta.HeartbeatOuterClass.GrantedRegionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_GrantedRegion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_GrantedRegion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.class, greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.Builder.class); + } + + // Construct using greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.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(); + regionId_ = 0L; + + role_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_GrantedRegion_descriptor; + } + + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.GrantedRegion getDefaultInstanceForType() { + return greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.getDefaultInstance(); + } + + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.GrantedRegion build() { + greptime.v1.meta.HeartbeatOuterClass.GrantedRegion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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_; + 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.GrantedRegion) { + return mergeFrom((greptime.v1.meta.HeartbeatOuterClass.GrantedRegion)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(greptime.v1.meta.HeartbeatOuterClass.GrantedRegion other) { + if (other == greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.getDefaultInstance()) return this; + if (other.getRegionId() != 0L) { + setRegionId(other.getRegionId()); + } + if (other.role_ != 0) { + setRoleValue(other.getRoleValue()); + } + 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.GrantedRegion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (greptime.v1.meta.HeartbeatOuterClass.GrantedRegion) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long regionId_ ; + /** + * uint64 region_id = 1; + * @return The regionId. + */ + @java.lang.Override + public long getRegionId() { + return regionId_; + } + /** + * uint64 region_id = 1; + * @param value The regionId to set. + * @return This builder for chaining. + */ + public Builder setRegionId(long value) { + + regionId_ = value; + onChanged(); + return this; + } + /** + * uint64 region_id = 1; + * @return This builder for chaining. + */ + public Builder clearRegionId() { + + regionId_ = 0L; + onChanged(); + return this; + } + + private int role_ = 0; + /** + * .greptime.v1.meta.RegionRole role = 2; + * @return The enum numeric value on the wire for role. + */ + @java.lang.Override public int getRoleValue() { + return role_; + } + /** + * .greptime.v1.meta.RegionRole role = 2; + * @param value The enum numeric value on the wire for role to set. + * @return This builder for chaining. + */ + public Builder setRoleValue(int value) { + + role_ = value; + onChanged(); + return this; + } + /** + * .greptime.v1.meta.RegionRole role = 2; + * @return The role. + */ + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.RegionRole getRole() { + @SuppressWarnings("deprecation") + greptime.v1.meta.HeartbeatOuterClass.RegionRole result = greptime.v1.meta.HeartbeatOuterClass.RegionRole.valueOf(role_); + return result == null ? greptime.v1.meta.HeartbeatOuterClass.RegionRole.UNRECOGNIZED : result; + } + /** + * .greptime.v1.meta.RegionRole role = 2; + * @param value The role to set. + * @return This builder for chaining. + */ + public Builder setRole(greptime.v1.meta.HeartbeatOuterClass.RegionRole value) { + if (value == null) { + throw new NullPointerException(); + } + + role_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .greptime.v1.meta.RegionRole role = 2; + * @return This builder for chaining. + */ + public Builder clearRole() { + + role_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + 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.GrantedRegion) + } + + // @@protoc_insertion_point(class_scope:greptime.v1.meta.GrantedRegion) + private static final greptime.v1.meta.HeartbeatOuterClass.GrantedRegion DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new greptime.v1.meta.HeartbeatOuterClass.GrantedRegion(); + } + + public static greptime.v1.meta.HeartbeatOuterClass.GrantedRegion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GrantedRegion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GrantedRegion(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.GrantedRegion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + public interface RegionLeaseOrBuilder extends // @@protoc_insertion_point(interface_extends:greptime.v1.meta.RegionLease) com.google.protobuf.MessageOrBuilder { /** - * repeated uint64 region_ids = 1; - * @return A list containing the regionIds. + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + java.util.List + getRegionsList(); + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + greptime.v1.meta.HeartbeatOuterClass.GrantedRegion getRegions(int index); + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; */ - java.util.List getRegionIdsList(); + int getRegionsCount(); /** - * repeated uint64 region_ids = 1; - * @return The count of regionIds. + * repeated .greptime.v1.meta.GrantedRegion regions = 1; */ - int getRegionIdsCount(); + java.util.List + getRegionsOrBuilderList(); /** - * repeated uint64 region_ids = 1; - * @param index The index of the element to return. - * @return The regionIds at the given index. + * repeated .greptime.v1.meta.GrantedRegion regions = 1; */ - long getRegionIds(int index); + greptime.v1.meta.HeartbeatOuterClass.GrantedRegionOrBuilder getRegionsOrBuilder( + int index); /** * uint64 duration_since_epoch = 2; @@ -4478,7 +5083,7 @@ private RegionLease(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private RegionLease() { - regionIds_ = emptyLongList(); + regions_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -4512,25 +5117,13 @@ private RegionLease( case 0: done = true; break; - case 8: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - regionIds_ = newLongList(); - mutable_bitField0_ |= 0x00000001; - } - regionIds_.addLong(input.readUInt64()); - break; - } case 10: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - regionIds_ = newLongList(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + regions_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - while (input.getBytesUntilLimit() > 0) { - regionIds_.addLong(input.readUInt64()); - } - input.popLimit(limit); + regions_.add( + input.readMessage(greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.parser(), extensionRegistry)); break; } case 16: { @@ -4561,7 +5154,7 @@ private RegionLease( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { - regionIds_.makeImmutable(); // C + regions_ = java.util.Collections.unmodifiableList(regions_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -4580,33 +5173,45 @@ private RegionLease( greptime.v1.meta.HeartbeatOuterClass.RegionLease.class, greptime.v1.meta.HeartbeatOuterClass.RegionLease.Builder.class); } - public static final int REGION_IDS_FIELD_NUMBER = 1; - private com.google.protobuf.Internal.LongList regionIds_; + public static final int REGIONS_FIELD_NUMBER = 1; + private java.util.List regions_; + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + @java.lang.Override + public java.util.List getRegionsList() { + return regions_; + } + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + @java.lang.Override + public java.util.List + getRegionsOrBuilderList() { + return regions_; + } /** - * repeated uint64 region_ids = 1; - * @return A list containing the regionIds. + * repeated .greptime.v1.meta.GrantedRegion regions = 1; */ @java.lang.Override - public java.util.List - getRegionIdsList() { - return regionIds_; + public int getRegionsCount() { + return regions_.size(); } /** - * repeated uint64 region_ids = 1; - * @return The count of regionIds. + * repeated .greptime.v1.meta.GrantedRegion regions = 1; */ - public int getRegionIdsCount() { - return regionIds_.size(); + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.GrantedRegion getRegions(int index) { + return regions_.get(index); } /** - * repeated uint64 region_ids = 1; - * @param index The index of the element to return. - * @return The regionIds at the given index. + * repeated .greptime.v1.meta.GrantedRegion regions = 1; */ - public long getRegionIds(int index) { - return regionIds_.getLong(index); + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.GrantedRegionOrBuilder getRegionsOrBuilder( + int index) { + return regions_.get(index); } - private int regionIdsMemoizedSerializedSize = -1; public static final int DURATION_SINCE_EPOCH_FIELD_NUMBER = 2; private long durationSinceEpoch_; @@ -4644,13 +5249,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - getSerializedSize(); - if (getRegionIdsList().size() > 0) { - output.writeUInt32NoTag(10); - output.writeUInt32NoTag(regionIdsMemoizedSerializedSize); - } - for (int i = 0; i < regionIds_.size(); i++) { - output.writeUInt64NoTag(regionIds_.getLong(i)); + for (int i = 0; i < regions_.size(); i++) { + output.writeMessage(1, regions_.get(i)); } if (durationSinceEpoch_ != 0L) { output.writeUInt64(2, durationSinceEpoch_); @@ -4667,19 +5267,9 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - { - int dataSize = 0; - for (int i = 0; i < regionIds_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeUInt64SizeNoTag(regionIds_.getLong(i)); - } - size += dataSize; - if (!getRegionIdsList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - regionIdsMemoizedSerializedSize = dataSize; + for (int i = 0; i < regions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, regions_.get(i)); } if (durationSinceEpoch_ != 0L) { size += com.google.protobuf.CodedOutputStream @@ -4704,8 +5294,8 @@ public boolean equals(final java.lang.Object obj) { } greptime.v1.meta.HeartbeatOuterClass.RegionLease other = (greptime.v1.meta.HeartbeatOuterClass.RegionLease) obj; - if (!getRegionIdsList() - .equals(other.getRegionIdsList())) return false; + if (!getRegionsList() + .equals(other.getRegionsList())) return false; if (getDurationSinceEpoch() != other.getDurationSinceEpoch()) return false; if (getLeaseSeconds() @@ -4721,9 +5311,9 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getRegionIdsCount() > 0) { - hash = (37 * hash) + REGION_IDS_FIELD_NUMBER; - hash = (53 * hash) + getRegionIdsList().hashCode(); + if (getRegionsCount() > 0) { + hash = (37 * hash) + REGIONS_FIELD_NUMBER; + hash = (53 * hash) + getRegionsList().hashCode(); } hash = (37 * hash) + DURATION_SINCE_EPOCH_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( @@ -4859,13 +5449,18 @@ private Builder( private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { + getRegionsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); - regionIds_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); + if (regionsBuilder_ == null) { + regions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + regionsBuilder_.clear(); + } durationSinceEpoch_ = 0L; leaseSeconds_ = 0L; @@ -4897,11 +5492,15 @@ public greptime.v1.meta.HeartbeatOuterClass.RegionLease build() { public greptime.v1.meta.HeartbeatOuterClass.RegionLease buildPartial() { greptime.v1.meta.HeartbeatOuterClass.RegionLease result = new greptime.v1.meta.HeartbeatOuterClass.RegionLease(this); int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - regionIds_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); + if (regionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + regions_ = java.util.Collections.unmodifiableList(regions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.regions_ = regions_; + } else { + result.regions_ = regionsBuilder_.build(); } - result.regionIds_ = regionIds_; result.durationSinceEpoch_ = durationSinceEpoch_; result.leaseSeconds_ = leaseSeconds_; onBuilt(); @@ -4952,15 +5551,31 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(greptime.v1.meta.HeartbeatOuterClass.RegionLease other) { if (other == greptime.v1.meta.HeartbeatOuterClass.RegionLease.getDefaultInstance()) return this; - if (!other.regionIds_.isEmpty()) { - if (regionIds_.isEmpty()) { - regionIds_ = other.regionIds_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureRegionIdsIsMutable(); - regionIds_.addAll(other.regionIds_); + if (regionsBuilder_ == null) { + if (!other.regions_.isEmpty()) { + if (regions_.isEmpty()) { + regions_ = other.regions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRegionsIsMutable(); + regions_.addAll(other.regions_); + } + onChanged(); + } + } else { + if (!other.regions_.isEmpty()) { + if (regionsBuilder_.isEmpty()) { + regionsBuilder_.dispose(); + regionsBuilder_ = null; + regions_ = other.regions_; + bitField0_ = (bitField0_ & ~0x00000001); + regionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getRegionsFieldBuilder() : null; + } else { + regionsBuilder_.addAllMessages(other.regions_); + } } - onChanged(); } if (other.getDurationSinceEpoch() != 0L) { setDurationSinceEpoch(other.getDurationSinceEpoch()); @@ -4998,84 +5613,245 @@ public Builder mergeFrom( } private int bitField0_; - private com.google.protobuf.Internal.LongList regionIds_ = emptyLongList(); - private void ensureRegionIdsIsMutable() { + private java.util.List regions_ = + java.util.Collections.emptyList(); + private void ensureRegionsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - regionIds_ = mutableCopy(regionIds_); + regions_ = new java.util.ArrayList(regions_); bitField0_ |= 0x00000001; } } + + private com.google.protobuf.RepeatedFieldBuilderV3< + greptime.v1.meta.HeartbeatOuterClass.GrantedRegion, greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.Builder, greptime.v1.meta.HeartbeatOuterClass.GrantedRegionOrBuilder> regionsBuilder_; + /** - * repeated uint64 region_ids = 1; - * @return A list containing the regionIds. + * repeated .greptime.v1.meta.GrantedRegion regions = 1; */ - public java.util.List - getRegionIdsList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(regionIds_) : regionIds_; + public java.util.List getRegionsList() { + if (regionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(regions_); + } else { + return regionsBuilder_.getMessageList(); + } } /** - * repeated uint64 region_ids = 1; - * @return The count of regionIds. + * repeated .greptime.v1.meta.GrantedRegion regions = 1; */ - public int getRegionIdsCount() { - return regionIds_.size(); + public int getRegionsCount() { + if (regionsBuilder_ == null) { + return regions_.size(); + } else { + return regionsBuilder_.getCount(); + } } /** - * repeated uint64 region_ids = 1; - * @param index The index of the element to return. - * @return The regionIds at the given index. + * repeated .greptime.v1.meta.GrantedRegion regions = 1; */ - public long getRegionIds(int index) { - return regionIds_.getLong(index); + public greptime.v1.meta.HeartbeatOuterClass.GrantedRegion getRegions(int index) { + if (regionsBuilder_ == null) { + return regions_.get(index); + } else { + return regionsBuilder_.getMessage(index); + } } /** - * repeated uint64 region_ids = 1; - * @param index The index to set the value at. - * @param value The regionIds to set. - * @return This builder for chaining. + * repeated .greptime.v1.meta.GrantedRegion regions = 1; */ - public Builder setRegionIds( - int index, long value) { - ensureRegionIdsIsMutable(); - regionIds_.setLong(index, value); - onChanged(); + public Builder setRegions( + int index, greptime.v1.meta.HeartbeatOuterClass.GrantedRegion value) { + if (regionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegionsIsMutable(); + regions_.set(index, value); + onChanged(); + } else { + regionsBuilder_.setMessage(index, value); + } return this; } /** - * repeated uint64 region_ids = 1; - * @param value The regionIds to add. - * @return This builder for chaining. + * repeated .greptime.v1.meta.GrantedRegion regions = 1; */ - public Builder addRegionIds(long value) { - ensureRegionIdsIsMutable(); - regionIds_.addLong(value); - onChanged(); + public Builder setRegions( + int index, greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.Builder builderForValue) { + if (regionsBuilder_ == null) { + ensureRegionsIsMutable(); + regions_.set(index, builderForValue.build()); + onChanged(); + } else { + regionsBuilder_.setMessage(index, builderForValue.build()); + } return this; } /** - * repeated uint64 region_ids = 1; - * @param values The regionIds to add. - * @return This builder for chaining. + * repeated .greptime.v1.meta.GrantedRegion regions = 1; */ - public Builder addAllRegionIds( - java.lang.Iterable values) { - ensureRegionIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, regionIds_); - onChanged(); + public Builder addRegions(greptime.v1.meta.HeartbeatOuterClass.GrantedRegion value) { + if (regionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegionsIsMutable(); + regions_.add(value); + onChanged(); + } else { + regionsBuilder_.addMessage(value); + } return this; } /** - * repeated uint64 region_ids = 1; - * @return This builder for chaining. + * repeated .greptime.v1.meta.GrantedRegion regions = 1; */ - public Builder clearRegionIds() { - regionIds_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); + public Builder addRegions( + int index, greptime.v1.meta.HeartbeatOuterClass.GrantedRegion value) { + if (regionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegionsIsMutable(); + regions_.add(index, value); + onChanged(); + } else { + regionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + public Builder addRegions( + greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.Builder builderForValue) { + if (regionsBuilder_ == null) { + ensureRegionsIsMutable(); + regions_.add(builderForValue.build()); + onChanged(); + } else { + regionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + public Builder addRegions( + int index, greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.Builder builderForValue) { + if (regionsBuilder_ == null) { + ensureRegionsIsMutable(); + regions_.add(index, builderForValue.build()); + onChanged(); + } else { + regionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + public Builder addAllRegions( + java.lang.Iterable values) { + if (regionsBuilder_ == null) { + ensureRegionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, regions_); + onChanged(); + } else { + regionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + public Builder clearRegions() { + if (regionsBuilder_ == null) { + regions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + regionsBuilder_.clear(); + } + return this; + } + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + public Builder removeRegions(int index) { + if (regionsBuilder_ == null) { + ensureRegionsIsMutable(); + regions_.remove(index); + onChanged(); + } else { + regionsBuilder_.remove(index); + } return this; } + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + public greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.Builder getRegionsBuilder( + int index) { + return getRegionsFieldBuilder().getBuilder(index); + } + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + public greptime.v1.meta.HeartbeatOuterClass.GrantedRegionOrBuilder getRegionsOrBuilder( + int index) { + if (regionsBuilder_ == null) { + return regions_.get(index); } else { + return regionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + public java.util.List + getRegionsOrBuilderList() { + if (regionsBuilder_ != null) { + return regionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(regions_); + } + } + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + public greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.Builder addRegionsBuilder() { + return getRegionsFieldBuilder().addBuilder( + greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.getDefaultInstance()); + } + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + public greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.Builder addRegionsBuilder( + int index) { + return getRegionsFieldBuilder().addBuilder( + index, greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.getDefaultInstance()); + } + /** + * repeated .greptime.v1.meta.GrantedRegion regions = 1; + */ + public java.util.List + getRegionsBuilderList() { + return getRegionsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + greptime.v1.meta.HeartbeatOuterClass.GrantedRegion, greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.Builder, greptime.v1.meta.HeartbeatOuterClass.GrantedRegionOrBuilder> + getRegionsFieldBuilder() { + if (regionsBuilder_ == null) { + regionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + greptime.v1.meta.HeartbeatOuterClass.GrantedRegion, greptime.v1.meta.HeartbeatOuterClass.GrantedRegion.Builder, greptime.v1.meta.HeartbeatOuterClass.GrantedRegionOrBuilder>( + regions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + regions_ = null; + } + return regionsBuilder_; + } private long durationSinceEpoch_ ; /** @@ -8020,6 +8796,11 @@ public greptime.v1.meta.HeartbeatOuterClass.MailboxMessage getDefaultInstanceFor private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_greptime_v1_meta_HeartbeatResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_greptime_v1_meta_GrantedRegion_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_greptime_v1_meta_GrantedRegion_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_greptime_v1_meta_RegionLease_descriptor; private static final @@ -8068,24 +8849,27 @@ public greptime.v1.meta.HeartbeatOuterClass.MailboxMessage getDefaultInstanceFor "a.ResponseHeader\0229\n\017mailbox_message\030\002 \001(" + "\0132 .greptime.v1.meta.MailboxMessage\0223\n\014r" + "egion_lease\030\003 \001(\0132\035.greptime.v1.meta.Reg" + - "ionLease\"V\n\013RegionLease\022\022\n\nregion_ids\030\001 " + - "\003(\004\022\034\n\024duration_since_epoch\030\002 \001(\004\022\025\n\rlea" + - "se_seconds\030\003 \001(\004\"C\n\020AskLeaderRequest\022/\n\006" + - "header\030\001 \001(\0132\037.greptime.v1.meta.RequestH" + - "eader\"m\n\021AskLeaderResponse\0220\n\006header\030\001 \001" + - "(\0132 .greptime.v1.meta.ResponseHeader\022&\n\006" + - "leader\030\002 \001(\0132\026.greptime.v1.meta.Peer\"|\n\016" + - "MailboxMessage\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\020timesta" + - "mp_millis\030\005 \001(\003\022\016\n\004json\030\006 \001(\tH\000B\t\n\007paylo" + - "ad*&\n\nRegionRole\022\n\n\006Leader\020\000\022\014\n\010Follower" + - "\020\0012\277\001\n\tHeartbeat\022Z\n\tHeartbeat\022\".greptime" + - ".v1.meta.HeartbeatRequest\032#.greptime.v1." + - "meta.HeartbeatResponse\"\000(\0010\001\022V\n\tAskLeade" + - "r\022\".greptime.v1.meta.AskLeaderRequest\032#." + - "greptime.v1.meta.AskLeaderResponse\"\000B