feat: introduce region role (#113)

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