feat: use GrantedRegion instead of region_ids (#117)

This commit is contained in:
Weny Xu
2023-11-03 23:40:32 +09:00
committed by GitHub
parent 9d82dddf75
commit 7eb2e78be7
5 changed files with 1688 additions and 382 deletions
+301 -65
View File
@@ -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<Z:"
"github.com/GreptimeTeam/greptime-proto/g"
"o/greptime/v1/metab\006proto3"
"ionLease\"N\n\rGrantedRegion\022\021\n\tregion_id\030\001"
" \001(\004\022*\n\004role\030\002 \001(\0162\034.greptime.v1.meta.Re"
"gionRole\"t\n\013RegionLease\0220\n\007regions\030\001 \003(\013"
"2\037.greptime.v1.meta.GrantedRegion\022\034\n\024dur"
"ation_since_epoch\030\002 \001(\004\022\025\n\rlease_seconds"
"\030\003 \001(\004\"C\n\020AskLeaderRequest\022/\n\006header\030\001 \001"
"(\0132\037.greptime.v1.meta.RequestHeader\"m\n\021A"
"skLeaderResponse\0220\n\006header\030\001 \001(\0132 .grept"
"ime.v1.meta.ResponseHeader\022&\n\006leader\030\002 \001"
"(\0132\026.greptime.v1.meta.Peer\"|\n\016MailboxMes"
"sage\022\n\n\002id\030\001 \001(\004\022\017\n\007subject\030\002 \001(\t\022\014\n\004fro"
"m\030\003 \001(\t\022\n\n\002to\030\004 \001(\t\022\030\n\020timestamp_millis\030"
"\005 \001(\003\022\016\n\004json\030\006 \001(\tH\000B\t\n\007payload*&\n\nRegi"
"onRole\022\n\n\006Leader\020\000\022\014\n\010Follower\020\0012\277\001\n\tHea"
"rtbeat\022Z\n\tHeartbeat\022\".greptime.v1.meta.H"
"eartbeatRequest\032#.greptime.v1.meta.Heart"
"beatResponse\"\000(\0010\001\022V\n\tAskLeader\022\".grepti"
"me.v1.meta.AskLeaderRequest\032#.greptime.v"
"1.meta.AskLeaderResponse\"\000B<Z:github.com"
"/GreptimeTeam/greptime-proto/go/greptime"
"/v1/metab\006proto3"
;
static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_deps[1] = {
&::descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto,
};
static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto = {
false, false, 1466, descriptor_table_protodef_greptime_2fv1_2fmeta_2fheartbeat_2eproto,
false, false, 1576, descriptor_table_protodef_greptime_2fv1_2fmeta_2fheartbeat_2eproto,
"greptime/v1/meta/heartbeat.proto",
&descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once, descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_deps, 1, 7,
&descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_once, descriptor_table_greptime_2fv1_2fmeta_2fheartbeat_2eproto_deps, 1, 8,
schemas, file_default_instances, TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto::offsets,
file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto, file_level_enum_descriptors_greptime_2fv1_2fmeta_2fheartbeat_2eproto,
file_level_service_descriptors_greptime_2fv1_2fmeta_2fheartbeat_2eproto,
@@ -1391,6 +1417,220 @@ void HeartbeatResponse::InternalSwap(HeartbeatResponse* other) {
// ===================================================================
class GrantedRegion::_Internal {
public:
};
GrantedRegion::GrantedRegion(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:greptime.v1.meta.GrantedRegion)
}
GrantedRegion::GrantedRegion(const GrantedRegion& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
GrantedRegion* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.region_id_){}
, decltype(_impl_.role_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
::memcpy(&_impl_.region_id_, &from._impl_.region_id_,
static_cast<size_t>(reinterpret_cast<char*>(&_impl_.role_) -
reinterpret_cast<char*>(&_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<size_t>(
reinterpret_cast<char*>(&_impl_.role_) -
reinterpret_cast<char*>(&_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<uint8_t>(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<uint8_t>(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<GrantedRegion*>(&to_msg);
auto& from = static_cast<const GrantedRegion&>(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<char*>(&_impl_.region_id_),
reinterpret_cast<char*>(&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<size_t>(
reinterpret_cast<char*>(&_impl_.lease_seconds_) -
reinterpret_cast<char*>(&_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<uint8_t>(tag) == 10)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_region_ids(), ptr, ctx);
CHK_(ptr);
} else if (static_cast<uint8_t>(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<unsigned>(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<int32_t>(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);
+257 -60
View File
@@ -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<const GrantedRegion*>(
&_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<GrantedRegion>(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 <typename T> 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();
void clear_regions();
::greptime::v1::meta::GrantedRegion* mutable_regions(int index);
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::greptime::v1::meta::GrantedRegion >*
mutable_regions();
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();
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<int> _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::
// -------------------------------------------------------------------
// 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)
}
// .greptime.v1.meta.RegionRole role = 2;
inline void GrantedRegion::clear_role() {
_impl_.role_ = 0;
}
inline ::greptime::v1::meta::RegionRole GrantedRegion::_internal_role() const {
return static_cast< ::greptime::v1::meta::RegionRole >(_impl_.role_);
}
inline ::greptime::v1::meta::RegionRole GrantedRegion::role() const {
// @@protoc_insertion_point(field_get:greptime.v1.meta.GrantedRegion.role)
return _internal_role();
}
inline void GrantedRegion::_internal_set_role(::greptime::v1::meta::RegionRole value) {
_impl_.role_ = value;
}
inline void GrantedRegion::set_role(::greptime::v1::meta::RegionRole value) {
_internal_set_role(value);
// @@protoc_insertion_point(field_set:greptime.v1.meta.GrantedRegion.role)
}
// -------------------------------------------------------------------
// RegionLease
// repeated uint64 region_ids = 1;
inline int RegionLease::_internal_region_ids_size() const {
return _impl_.region_ids_.size();
// repeated .greptime.v1.meta.GrantedRegion regions = 1;
inline int RegionLease::_internal_regions_size() const {
return _impl_.regions_.size();
}
inline int RegionLease::region_ids_size() const {
return _internal_region_ids_size();
inline int RegionLease::regions_size() const {
return _internal_regions_size();
}
inline void RegionLease::clear_region_ids() {
_impl_.region_ids_.Clear();
inline void RegionLease::clear_regions() {
_impl_.regions_.Clear();
}
inline uint64_t RegionLease::_internal_region_ids(int index) const {
return _impl_.region_ids_.Get(index);
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 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 ::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 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)
inline const ::greptime::v1::meta::GrantedRegion& RegionLease::_internal_regions(int index) const {
return _impl_.regions_.Get(index);
}
inline void RegionLease::_internal_add_region_ids(uint64_t value) {
_impl_.region_ids_.Add(value);
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 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::_internal_add_regions() {
return _impl_.regions_.Add();
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >&
RegionLease::_internal_region_ids() const {
return _impl_.region_ids_;
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::RepeatedField< uint64_t >&
RegionLease::region_ids() const {
// @@protoc_insertion_point(field_list:greptime.v1.meta.RegionLease.region_ids)
return _internal_region_ids();
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< uint64_t >*
RegionLease::_internal_mutable_region_ids() {
return &_impl_.region_ids_;
}
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 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)
+178 -100
View File
@@ -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,
},
File diff suppressed because it is too large Load Diff
+6 -1
View File
@@ -77,8 +77,13 @@ message HeartbeatResponse {
RegionLease region_lease = 3;
}
message GrantedRegion {
uint64 region_id = 1;
RegionRole role = 2;
}
message RegionLease {
repeated uint64 region_ids = 1;
repeated GrantedRegion regions = 1;
uint64 duration_since_epoch = 2;
uint64 lease_seconds = 3;
}