From 19a5104851a86a27b92a5e00e69c60465c7e5d83 Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Thu, 26 Feb 2026 18:58:21 +0800 Subject: [PATCH] feat: add mailbox message header (#310) Signed-off-by: WenyXu --- c++/greptime/v1/meta/heartbeat.pb.cc | 378 +++++- c++/greptime/v1/meta/heartbeat.pb.h | 350 ++++- go/greptime/v1/meta/heartbeat.pb.go | 262 ++-- .../greptime/v1/meta/HeartbeatOuterClass.java | 1145 ++++++++++++++++- proto/greptime/v1/meta/heartbeat.proto | 8 + src/v1/meta/mailbox.rs | 12 +- 6 files changed, 2029 insertions(+), 126 deletions(-) diff --git a/c++/greptime/v1/meta/heartbeat.pb.cc b/c++/greptime/v1/meta/heartbeat.pb.cc index 6fc4622..5483817 100644 --- a/c++/greptime/v1/meta/heartbeat.pb.cc +++ b/c++/greptime/v1/meta/heartbeat.pb.cc @@ -305,11 +305,36 @@ struct AskLeaderResponseDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AskLeaderResponseDefaultTypeInternal _AskLeaderResponse_default_instance_; +PROTOBUF_CONSTEXPR MailboxMessageHeader_TracingContextEntry_DoNotUse::MailboxMessageHeader_TracingContextEntry_DoNotUse( + ::_pbi::ConstantInitialized) {} +struct MailboxMessageHeader_TracingContextEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR MailboxMessageHeader_TracingContextEntry_DoNotUseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~MailboxMessageHeader_TracingContextEntry_DoNotUseDefaultTypeInternal() {} + union { + MailboxMessageHeader_TracingContextEntry_DoNotUse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MailboxMessageHeader_TracingContextEntry_DoNotUseDefaultTypeInternal _MailboxMessageHeader_TracingContextEntry_DoNotUse_default_instance_; +PROTOBUF_CONSTEXPR MailboxMessageHeader::MailboxMessageHeader( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.tracing_context_)*/{::_pbi::ConstantInitialized()} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct MailboxMessageHeaderDefaultTypeInternal { + PROTOBUF_CONSTEXPR MailboxMessageHeaderDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~MailboxMessageHeaderDefaultTypeInternal() {} + union { + MailboxMessageHeader _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MailboxMessageHeaderDefaultTypeInternal _MailboxMessageHeader_default_instance_; PROTOBUF_CONSTEXPR MailboxMessage::MailboxMessage( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.subject_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.from_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.to_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.header_)*/nullptr , /*decltype(_impl_.id_)*/uint64_t{0u} , /*decltype(_impl_.timestamp_millis_)*/int64_t{0} , /*decltype(_impl_.payload_)*/{} @@ -327,7 +352,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[20]; +static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[22]; 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; @@ -523,12 +548,30 @@ const uint32_t TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto::offsets[] P ~0u, // no _inlined_string_donated_ PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::AskLeaderResponse, _impl_.header_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::AskLeaderResponse, _impl_.leader_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessageHeader_TracingContextEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessageHeader_TracingContextEntry_DoNotUse, _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::MailboxMessageHeader_TracingContextEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessageHeader_TracingContextEntry_DoNotUse, value_), + 0, + 1, + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessageHeader, _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::MailboxMessageHeader, _impl_.tracing_context_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessage, _internal_metadata_), ~0u, // no _extensions_ PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessage, _impl_._oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessage, _impl_.header_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessage, _impl_.id_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessage, _impl_.subject_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::MailboxMessage, _impl_.from_), @@ -557,7 +600,9 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode { 166, -1, -1, sizeof(::greptime::v1::meta::RegionLease)}, { 176, -1, -1, sizeof(::greptime::v1::meta::AskLeaderRequest)}, { 183, -1, -1, sizeof(::greptime::v1::meta::AskLeaderResponse)}, - { 191, -1, -1, sizeof(::greptime::v1::meta::MailboxMessage)}, + { 191, 199, -1, sizeof(::greptime::v1::meta::MailboxMessageHeader_TracingContextEntry_DoNotUse)}, + { 201, -1, -1, sizeof(::greptime::v1::meta::MailboxMessageHeader)}, + { 208, -1, -1, sizeof(::greptime::v1::meta::MailboxMessage)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -580,6 +625,8 @@ static const ::_pb::Message* const file_default_instances[] = { &::greptime::v1::meta::_RegionLease_default_instance_._instance, &::greptime::v1::meta::_AskLeaderRequest_default_instance_._instance, &::greptime::v1::meta::_AskLeaderResponse_default_instance_._instance, + &::greptime::v1::meta::_MailboxMessageHeader_TracingContextEntry_DoNotUse_default_instance_._instance, + &::greptime::v1::meta::_MailboxMessageHeader_default_instance_._instance, &::greptime::v1::meta::_MailboxMessage_default_instance_._instance, }; @@ -651,28 +698,33 @@ const char descriptor_table_protodef_greptime_2fv1_2fmeta_2fheartbeat_2eproto[] "\n\006header\030\001 \001(\0132\037.greptime.v1.meta.Reques" "tHeader\"m\n\021AskLeaderResponse\0220\n\006header\030\001" " \001(\0132 .greptime.v1.meta.ResponseHeader\022&" - "\n\006leader\030\002 \001(\0132\026.greptime.v1.meta.Peer\"|" - "\n\016MailboxMessage\022\n\n\002id\030\001 \001(\004\022\017\n\007subject\030" - "\002 \001(\t\022\014\n\004from\030\003 \001(\t\022\n\n\002to\030\004 \001(\t\022\030\n\020times" - "tamp_millis\030\005 \001(\003\022\016\n\004json\030\006 \001(\tH\000B\t\n\007pay" - "load*=\n\nRegionRole\022\n\n\006Leader\020\000\022\014\n\010Follow" - "er\020\001\022\025\n\021DowngradingLeader\020\0022\277\001\n\tHeartbea" - "t\022Z\n\tHeartbeat\022\".greptime.v1.meta.Heartb" - "eatRequest\032#.greptime.v1.meta.HeartbeatR" - "esponse\"\000(\0010\001\022V\n\tAskLeader\022\".greptime.v1" - ".meta.AskLeaderRequest\032#.greptime.v1.met" - "a.AskLeaderResponse\"\000BOwnCustomDestructor(this, &MailboxMessageHeader::ArenaDtor); + } + // @@protoc_insertion_point(arena_constructor:greptime.v1.meta.MailboxMessageHeader) +} +MailboxMessageHeader::MailboxMessageHeader(const MailboxMessageHeader& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + MailboxMessageHeader* const _this = this; (void)_this; + new (&_impl_) Impl_{ + /*decltype(_impl_.tracing_context_)*/{} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.tracing_context_.MergeFrom(from._impl_.tracing_context_); + // @@protoc_insertion_point(copy_constructor:greptime.v1.meta.MailboxMessageHeader) +} + +inline void MailboxMessageHeader::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + /*decltype(_impl_.tracing_context_)*/{::_pbi::ArenaInitialized(), arena} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +MailboxMessageHeader::~MailboxMessageHeader() { + // @@protoc_insertion_point(destructor:greptime.v1.meta.MailboxMessageHeader) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + ArenaDtor(this); + return; + } + SharedDtor(); +} + +inline void MailboxMessageHeader::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.tracing_context_.Destruct(); + _impl_.tracing_context_.~MapField(); +} + +void MailboxMessageHeader::ArenaDtor(void* object) { + MailboxMessageHeader* _this = reinterpret_cast< MailboxMessageHeader* >(object); + _this->_impl_.tracing_context_.Destruct(); +} +void MailboxMessageHeader::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void MailboxMessageHeader::Clear() { +// @@protoc_insertion_point(message_clear_start:greptime.v1.meta.MailboxMessageHeader) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.tracing_context_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* MailboxMessageHeader::_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) { + // map tracing_context = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(&_impl_.tracing_context_, ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); + } 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* MailboxMessageHeader::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:greptime.v1.meta.MailboxMessageHeader) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // map tracing_context = 1; + if (!this->_internal_tracing_context().empty()) { + using MapType = ::_pb::Map; + using WireHelper = MailboxMessageHeader_TracingContextEntry_DoNotUse::Funcs; + const auto& map_field = this->_internal_tracing_context(); + auto check_utf8 = [](const MapType::value_type& entry) { + (void)entry; + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "greptime.v1.meta.MailboxMessageHeader.TracingContextEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + entry.second.data(), static_cast(entry.second.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "greptime.v1.meta.MailboxMessageHeader.TracingContextEntry.value"); + }; + + if (stream->IsSerializationDeterministic() && map_field.size() > 1) { + for (const auto& entry : ::_pbi::MapSorterPtr(map_field)) { + target = WireHelper::InternalSerialize(1, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } else { + for (const auto& entry : map_field) { + target = WireHelper::InternalSerialize(1, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } + } + + 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.MailboxMessageHeader) + return target; +} + +size_t MailboxMessageHeader::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:greptime.v1.meta.MailboxMessageHeader) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // map tracing_context = 1; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_tracing_context_size()); + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->_internal_tracing_context().begin(); + it != this->_internal_tracing_context().end(); ++it) { + total_size += MailboxMessageHeader_TracingContextEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MailboxMessageHeader::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + MailboxMessageHeader::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MailboxMessageHeader::GetClassData() const { return &_class_data_; } + + +void MailboxMessageHeader::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.meta.MailboxMessageHeader) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.tracing_context_.MergeFrom(from._impl_.tracing_context_); + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void MailboxMessageHeader::CopyFrom(const MailboxMessageHeader& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.meta.MailboxMessageHeader) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MailboxMessageHeader::IsInitialized() const { + return true; +} + +void MailboxMessageHeader::InternalSwap(MailboxMessageHeader* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.tracing_context_.InternalSwap(&other->_impl_.tracing_context_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata MailboxMessageHeader::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[20]); +} + +// =================================================================== + +class MailboxMessage::_Internal { + public: + static const ::greptime::v1::meta::MailboxMessageHeader& header(const MailboxMessage* msg); +}; + +const ::greptime::v1::meta::MailboxMessageHeader& +MailboxMessage::_Internal::header(const MailboxMessage* msg) { + return *msg->_impl_.header_; +} MailboxMessage::MailboxMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { @@ -5168,6 +5458,7 @@ MailboxMessage::MailboxMessage(const MailboxMessage& from) decltype(_impl_.subject_){} , decltype(_impl_.from_){} , decltype(_impl_.to_){} + , decltype(_impl_.header_){nullptr} , decltype(_impl_.id_){} , decltype(_impl_.timestamp_millis_){} , decltype(_impl_.payload_){} @@ -5199,6 +5490,9 @@ MailboxMessage::MailboxMessage(const MailboxMessage& from) _this->_impl_.to_.Set(from._internal_to(), _this->GetArenaForAllocation()); } + if (from._internal_has_header()) { + _this->_impl_.header_ = new ::greptime::v1::meta::MailboxMessageHeader(*from._impl_.header_); + } ::memcpy(&_impl_.id_, &from._impl_.id_, static_cast(reinterpret_cast(&_impl_.timestamp_millis_) - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.timestamp_millis_)); @@ -5223,6 +5517,7 @@ inline void MailboxMessage::SharedCtor( decltype(_impl_.subject_){} , decltype(_impl_.from_){} , decltype(_impl_.to_){} + , decltype(_impl_.header_){nullptr} , decltype(_impl_.id_){uint64_t{0u}} , decltype(_impl_.timestamp_millis_){int64_t{0}} , decltype(_impl_.payload_){} @@ -5258,6 +5553,7 @@ inline void MailboxMessage::SharedDtor() { _impl_.subject_.Destroy(); _impl_.from_.Destroy(); _impl_.to_.Destroy(); + if (this != internal_default_instance()) delete _impl_.header_; if (has_payload()) { clear_payload(); } @@ -5291,6 +5587,10 @@ void MailboxMessage::Clear() { _impl_.subject_.ClearToEmpty(); _impl_.from_.ClearToEmpty(); _impl_.to_.ClearToEmpty(); + if (GetArenaForAllocation() == nullptr && _impl_.header_ != nullptr) { + delete _impl_.header_; + } + _impl_.header_ = nullptr; ::memset(&_impl_.id_, 0, static_cast( reinterpret_cast(&_impl_.timestamp_millis_) - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.timestamp_millis_)); @@ -5360,6 +5660,14 @@ const char* MailboxMessage::_InternalParse(const char* ptr, ::_pbi::ParseContext } else goto handle_unusual; continue; + // .greptime.v1.meta.MailboxMessageHeader header = 64; + case 64: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 2)) { + ptr = ctx->ParseMessage(_internal_mutable_header(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -5441,6 +5749,13 @@ uint8_t* MailboxMessage::_InternalSerialize( 6, this->_internal_json(), target); } + // .greptime.v1.meta.MailboxMessageHeader header = 64; + if (this->_internal_has_header()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(64, _Internal::header(this), + _Internal::header(this).GetCachedSize(), target, stream); + } + 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); @@ -5478,6 +5793,13 @@ size_t MailboxMessage::ByteSizeLong() const { this->_internal_to()); } + // .greptime.v1.meta.MailboxMessageHeader header = 64; + if (this->_internal_has_header()) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.header_); + } + // uint64 id = 1; if (this->_internal_id() != 0) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_id()); @@ -5527,6 +5849,10 @@ void MailboxMessage::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const : if (!from._internal_to().empty()) { _this->_internal_set_to(from._internal_to()); } + if (from._internal_has_header()) { + _this->_internal_mutable_header()->::greptime::v1::meta::MailboxMessageHeader::MergeFrom( + from._internal_header()); + } if (from._internal_id() != 0) { _this->_internal_set_id(from._internal_id()); } @@ -5576,9 +5902,9 @@ void MailboxMessage::InternalSwap(MailboxMessage* other) { ::PROTOBUF_NAMESPACE_ID::internal::memswap< PROTOBUF_FIELD_OFFSET(MailboxMessage, _impl_.timestamp_millis_) + sizeof(MailboxMessage::_impl_.timestamp_millis_) - - PROTOBUF_FIELD_OFFSET(MailboxMessage, _impl_.id_)>( - reinterpret_cast(&_impl_.id_), - reinterpret_cast(&other->_impl_.id_)); + - PROTOBUF_FIELD_OFFSET(MailboxMessage, _impl_.header_)>( + reinterpret_cast(&_impl_.header_), + reinterpret_cast(&other->_impl_.header_)); swap(_impl_.payload_, other->_impl_.payload_); swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } @@ -5586,7 +5912,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[19]); + file_level_metadata_greptime_2fv1_2fmeta_2fheartbeat_2eproto[21]); } // @@protoc_insertion_point(namespace_scope) @@ -5670,6 +5996,14 @@ template<> PROTOBUF_NOINLINE ::greptime::v1::meta::AskLeaderResponse* Arena::CreateMaybeMessage< ::greptime::v1::meta::AskLeaderResponse >(Arena* arena) { return Arena::CreateMessageInternal< ::greptime::v1::meta::AskLeaderResponse >(arena); } +template<> PROTOBUF_NOINLINE ::greptime::v1::meta::MailboxMessageHeader_TracingContextEntry_DoNotUse* +Arena::CreateMaybeMessage< ::greptime::v1::meta::MailboxMessageHeader_TracingContextEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::greptime::v1::meta::MailboxMessageHeader_TracingContextEntry_DoNotUse >(arena); +} +template<> PROTOBUF_NOINLINE ::greptime::v1::meta::MailboxMessageHeader* +Arena::CreateMaybeMessage< ::greptime::v1::meta::MailboxMessageHeader >(Arena* arena) { + return Arena::CreateMessageInternal< ::greptime::v1::meta::MailboxMessageHeader >(arena); +} template<> PROTOBUF_NOINLINE ::greptime::v1::meta::MailboxMessage* Arena::CreateMaybeMessage< ::greptime::v1::meta::MailboxMessage >(Arena* arena) { return Arena::CreateMessageInternal< ::greptime::v1::meta::MailboxMessage >(arena); diff --git a/c++/greptime/v1/meta/heartbeat.pb.h b/c++/greptime/v1/meta/heartbeat.pb.h index 5941491..95d967c 100644 --- a/c++/greptime/v1/meta/heartbeat.pb.h +++ b/c++/greptime/v1/meta/heartbeat.pb.h @@ -97,6 +97,12 @@ extern HeartbeatResponseDefaultTypeInternal _HeartbeatResponse_default_instance_ class MailboxMessage; struct MailboxMessageDefaultTypeInternal; extern MailboxMessageDefaultTypeInternal _MailboxMessage_default_instance_; +class MailboxMessageHeader; +struct MailboxMessageHeaderDefaultTypeInternal; +extern MailboxMessageHeaderDefaultTypeInternal _MailboxMessageHeader_default_instance_; +class MailboxMessageHeader_TracingContextEntry_DoNotUse; +struct MailboxMessageHeader_TracingContextEntry_DoNotUseDefaultTypeInternal; +extern MailboxMessageHeader_TracingContextEntry_DoNotUseDefaultTypeInternal _MailboxMessageHeader_TracingContextEntry_DoNotUse_default_instance_; class NodeInfo; struct NodeInfoDefaultTypeInternal; extern NodeInfoDefaultTypeInternal _NodeInfo_default_instance_; @@ -131,6 +137,8 @@ template<> ::greptime::v1::meta::HeartbeatRequest* Arena::CreateMaybeMessage<::g template<> ::greptime::v1::meta::HeartbeatRequest_ExtensionsEntry_DoNotUse* Arena::CreateMaybeMessage<::greptime::v1::meta::HeartbeatRequest_ExtensionsEntry_DoNotUse>(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*); +template<> ::greptime::v1::meta::MailboxMessageHeader* Arena::CreateMaybeMessage<::greptime::v1::meta::MailboxMessageHeader>(Arena*); +template<> ::greptime::v1::meta::MailboxMessageHeader_TracingContextEntry_DoNotUse* Arena::CreateMaybeMessage<::greptime::v1::meta::MailboxMessageHeader_TracingContextEntry_DoNotUse>(Arena*); template<> ::greptime::v1::meta::NodeInfo* Arena::CreateMaybeMessage<::greptime::v1::meta::NodeInfo>(Arena*); template<> ::greptime::v1::meta::RegionLease* Arena::CreateMaybeMessage<::greptime::v1::meta::RegionLease>(Arena*); template<> ::greptime::v1::meta::RegionStat* Arena::CreateMaybeMessage<::greptime::v1::meta::RegionStat>(Arena*); @@ -3174,6 +3182,197 @@ class AskLeaderResponse final : }; // ------------------------------------------------------------------- +class MailboxMessageHeader_TracingContextEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + MailboxMessageHeader_TracingContextEntry_DoNotUse(); + explicit PROTOBUF_CONSTEXPR MailboxMessageHeader_TracingContextEntry_DoNotUse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit MailboxMessageHeader_TracingContextEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const MailboxMessageHeader_TracingContextEntry_DoNotUse& other); + static const MailboxMessageHeader_TracingContextEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_MailboxMessageHeader_TracingContextEntry_DoNotUse_default_instance_); } + static bool ValidateKey(std::string* s) { + return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "greptime.v1.meta.MailboxMessageHeader.TracingContextEntry.key"); + } + static bool ValidateValue(std::string* s) { + return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "greptime.v1.meta.MailboxMessageHeader.TracingContextEntry.value"); + } + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + friend struct ::TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto; +}; + +// ------------------------------------------------------------------- + +class MailboxMessageHeader final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.meta.MailboxMessageHeader) */ { + public: + inline MailboxMessageHeader() : MailboxMessageHeader(nullptr) {} + ~MailboxMessageHeader() override; + explicit PROTOBUF_CONSTEXPR MailboxMessageHeader(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + MailboxMessageHeader(const MailboxMessageHeader& from); + MailboxMessageHeader(MailboxMessageHeader&& from) noexcept + : MailboxMessageHeader() { + *this = ::std::move(from); + } + + inline MailboxMessageHeader& operator=(const MailboxMessageHeader& from) { + CopyFrom(from); + return *this; + } + inline MailboxMessageHeader& operator=(MailboxMessageHeader&& 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 MailboxMessageHeader& default_instance() { + return *internal_default_instance(); + } + static inline const MailboxMessageHeader* internal_default_instance() { + return reinterpret_cast( + &_MailboxMessageHeader_default_instance_); + } + static constexpr int kIndexInFileMessages = + 20; + + friend void swap(MailboxMessageHeader& a, MailboxMessageHeader& b) { + a.Swap(&b); + } + inline void Swap(MailboxMessageHeader* 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(MailboxMessageHeader* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + MailboxMessageHeader* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const MailboxMessageHeader& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const MailboxMessageHeader& from) { + MailboxMessageHeader::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(MailboxMessageHeader* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "greptime.v1.meta.MailboxMessageHeader"; + } + protected: + explicit MailboxMessageHeader(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + private: + static void ArenaDtor(void* object); + 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 { + kTracingContextFieldNumber = 1, + }; + // map tracing_context = 1; + int tracing_context_size() const; + private: + int _internal_tracing_context_size() const; + public: + void clear_tracing_context(); + private: + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& + _internal_tracing_context() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* + _internal_mutable_tracing_context(); + public: + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& + tracing_context() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* + mutable_tracing_context(); + + // @@protoc_insertion_point(class_scope:greptime.v1.meta.MailboxMessageHeader) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + MailboxMessageHeader_TracingContextEntry_DoNotUse, + std::string, std::string, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING> tracing_context_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_greptime_2fv1_2fmeta_2fheartbeat_2eproto; +}; +// ------------------------------------------------------------------- + class MailboxMessage final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.meta.MailboxMessage) */ { public: @@ -3227,7 +3426,7 @@ class MailboxMessage final : &_MailboxMessage_default_instance_); } static constexpr int kIndexInFileMessages = - 19; + 21; friend void swap(MailboxMessage& a, MailboxMessage& b) { a.Swap(&b); @@ -3303,6 +3502,7 @@ class MailboxMessage final : kSubjectFieldNumber = 2, kFromFieldNumber = 3, kToFieldNumber = 4, + kHeaderFieldNumber = 64, kIdFieldNumber = 1, kTimestampMillisFieldNumber = 5, kJsonFieldNumber = 6, @@ -3349,6 +3549,24 @@ class MailboxMessage final : std::string* _internal_mutable_to(); public: + // .greptime.v1.meta.MailboxMessageHeader header = 64; + bool has_header() const; + private: + bool _internal_has_header() const; + public: + void clear_header(); + const ::greptime::v1::meta::MailboxMessageHeader& header() const; + PROTOBUF_NODISCARD ::greptime::v1::meta::MailboxMessageHeader* release_header(); + ::greptime::v1::meta::MailboxMessageHeader* mutable_header(); + void set_allocated_header(::greptime::v1::meta::MailboxMessageHeader* header); + private: + const ::greptime::v1::meta::MailboxMessageHeader& _internal_header() const; + ::greptime::v1::meta::MailboxMessageHeader* _internal_mutable_header(); + public: + void unsafe_arena_set_allocated_header( + ::greptime::v1::meta::MailboxMessageHeader* header); + ::greptime::v1::meta::MailboxMessageHeader* unsafe_arena_release_header(); + // uint64 id = 1; void clear_id(); uint64_t id() const; @@ -3402,6 +3620,7 @@ class MailboxMessage final : ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr subject_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr from_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr to_; + ::greptime::v1::meta::MailboxMessageHeader* header_; uint64_t id_; int64_t timestamp_millis_; union PayloadUnion { @@ -6020,8 +6239,133 @@ inline void AskLeaderResponse::set_allocated_leader(::greptime::v1::meta::Peer* // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + +// MailboxMessageHeader + +// map tracing_context = 1; +inline int MailboxMessageHeader::_internal_tracing_context_size() const { + return _impl_.tracing_context_.size(); +} +inline int MailboxMessageHeader::tracing_context_size() const { + return _internal_tracing_context_size(); +} +inline void MailboxMessageHeader::clear_tracing_context() { + _impl_.tracing_context_.Clear(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& +MailboxMessageHeader::_internal_tracing_context() const { + return _impl_.tracing_context_.GetMap(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& +MailboxMessageHeader::tracing_context() const { + // @@protoc_insertion_point(field_map:greptime.v1.meta.MailboxMessageHeader.tracing_context) + return _internal_tracing_context(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* +MailboxMessageHeader::_internal_mutable_tracing_context() { + return _impl_.tracing_context_.MutableMap(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* +MailboxMessageHeader::mutable_tracing_context() { + // @@protoc_insertion_point(field_mutable_map:greptime.v1.meta.MailboxMessageHeader.tracing_context) + return _internal_mutable_tracing_context(); +} + +// ------------------------------------------------------------------- + // MailboxMessage +// .greptime.v1.meta.MailboxMessageHeader header = 64; +inline bool MailboxMessage::_internal_has_header() const { + return this != internal_default_instance() && _impl_.header_ != nullptr; +} +inline bool MailboxMessage::has_header() const { + return _internal_has_header(); +} +inline void MailboxMessage::clear_header() { + if (GetArenaForAllocation() == nullptr && _impl_.header_ != nullptr) { + delete _impl_.header_; + } + _impl_.header_ = nullptr; +} +inline const ::greptime::v1::meta::MailboxMessageHeader& MailboxMessage::_internal_header() const { + const ::greptime::v1::meta::MailboxMessageHeader* p = _impl_.header_; + return p != nullptr ? *p : reinterpret_cast( + ::greptime::v1::meta::_MailboxMessageHeader_default_instance_); +} +inline const ::greptime::v1::meta::MailboxMessageHeader& MailboxMessage::header() const { + // @@protoc_insertion_point(field_get:greptime.v1.meta.MailboxMessage.header) + return _internal_header(); +} +inline void MailboxMessage::unsafe_arena_set_allocated_header( + ::greptime::v1::meta::MailboxMessageHeader* header) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.header_); + } + _impl_.header_ = header; + if (header) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:greptime.v1.meta.MailboxMessage.header) +} +inline ::greptime::v1::meta::MailboxMessageHeader* MailboxMessage::release_header() { + + ::greptime::v1::meta::MailboxMessageHeader* temp = _impl_.header_; + _impl_.header_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::greptime::v1::meta::MailboxMessageHeader* MailboxMessage::unsafe_arena_release_header() { + // @@protoc_insertion_point(field_release:greptime.v1.meta.MailboxMessage.header) + + ::greptime::v1::meta::MailboxMessageHeader* temp = _impl_.header_; + _impl_.header_ = nullptr; + return temp; +} +inline ::greptime::v1::meta::MailboxMessageHeader* MailboxMessage::_internal_mutable_header() { + + if (_impl_.header_ == nullptr) { + auto* p = CreateMaybeMessage<::greptime::v1::meta::MailboxMessageHeader>(GetArenaForAllocation()); + _impl_.header_ = p; + } + return _impl_.header_; +} +inline ::greptime::v1::meta::MailboxMessageHeader* MailboxMessage::mutable_header() { + ::greptime::v1::meta::MailboxMessageHeader* _msg = _internal_mutable_header(); + // @@protoc_insertion_point(field_mutable:greptime.v1.meta.MailboxMessage.header) + return _msg; +} +inline void MailboxMessage::set_allocated_header(::greptime::v1::meta::MailboxMessageHeader* header) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.header_; + } + if (header) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(header); + if (message_arena != submessage_arena) { + header = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, header, submessage_arena); + } + + } else { + + } + _impl_.header_ = header; + // @@protoc_insertion_point(field_set_allocated:greptime.v1.meta.MailboxMessage.header) +} + // uint64 id = 1; inline void MailboxMessage::clear_id() { _impl_.id_ = uint64_t{0u}; @@ -6339,6 +6683,10 @@ inline MailboxMessage::PayloadCase MailboxMessage::payload_case() const { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/go/greptime/v1/meta/heartbeat.pb.go b/go/greptime/v1/meta/heartbeat.pb.go index 8122295..aad4d05 100644 --- a/go/greptime/v1/meta/heartbeat.pb.go +++ b/go/greptime/v1/meta/heartbeat.pb.go @@ -1159,11 +1159,62 @@ func (x *AskLeaderResponse) GetLeader() *Peer { return nil } +type MailboxMessageHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Encoded trace_id & span_id, follow the w3c Trace Context + // https://www.w3.org/TR/trace-context/#header-name + TracingContext map[string]string `protobuf:"bytes,1,rep,name=tracing_context,json=tracingContext,proto3" json:"tracing_context,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *MailboxMessageHeader) Reset() { + *x = MailboxMessageHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MailboxMessageHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MailboxMessageHeader) ProtoMessage() {} + +func (x *MailboxMessageHeader) ProtoReflect() protoreflect.Message { + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[14] + 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 MailboxMessageHeader.ProtoReflect.Descriptor instead. +func (*MailboxMessageHeader) Descriptor() ([]byte, []int) { + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{14} +} + +func (x *MailboxMessageHeader) GetTracingContext() map[string]string { + if x != nil { + return x.TracingContext + } + return nil +} + type MailboxMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // / The header of the mailbox message. + Header *MailboxMessageHeader `protobuf:"bytes,64,opt,name=header,proto3" json:"header,omitempty"` // The id is used to associate request and response. Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // The following information plays a bigger role in making messages traceable @@ -1184,7 +1235,7 @@ type MailboxMessage struct { func (x *MailboxMessage) Reset() { *x = MailboxMessage{} if protoimpl.UnsafeEnabled { - mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[14] + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1197,7 +1248,7 @@ func (x *MailboxMessage) String() string { func (*MailboxMessage) ProtoMessage() {} func (x *MailboxMessage) ProtoReflect() protoreflect.Message { - mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[14] + mi := &file_greptime_v1_meta_heartbeat_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1210,7 +1261,14 @@ 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{14} + return file_greptime_v1_meta_heartbeat_proto_rawDescGZIP(), []int{15} +} + +func (x *MailboxMessage) GetHeader() *MailboxMessageHeader { + if x != nil { + return x.Header + } + return nil } func (x *MailboxMessage) GetId() uint64 { @@ -1491,38 +1549,54 @@ var file_greptime_v1_meta_heartbeat_proto_rawDesc = []byte{ 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, 0x3d, 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, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x6f, 0x77, 0x6e, 0x67, 0x72, 0x61, 0x64, - 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x10, 0x02, 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, + 0xbe, 0x01, 0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6c, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x63, 0x0a, 0x0f, 0x74, 0x72, 0x61, 0x63, + 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x3a, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4d, 0x61, 0x69, 0x6c, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e, + 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x74, + 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x1a, 0x41, 0x0a, + 0x13, 0x54, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0xea, 0x01, 0x0a, 0x0e, 0x4d, 0x61, 0x69, 0x6c, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x40, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x4d, 0x61, 0x69, 0x6c, 0x62, 0x6f, 0x78, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 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, 0x3d, 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, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x6f, 0x77, 0x6e, 0x67, 0x72, 0x61, + 0x64, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x10, 0x02, 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 ( @@ -1538,70 +1612,74 @@ 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, 20) +var file_greptime_v1_meta_heartbeat_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_greptime_v1_meta_heartbeat_proto_goTypes = []interface{}{ - (RegionRole)(0), // 0: greptime.v1.meta.RegionRole - (*HeartbeatRequest)(nil), // 1: greptime.v1.meta.HeartbeatRequest - (*DatanodeWorkloads)(nil), // 2: greptime.v1.meta.DatanodeWorkloads - (*FrontendWorkloads)(nil), // 3: greptime.v1.meta.FrontendWorkloads - (*FlownodeWorkloads)(nil), // 4: greptime.v1.meta.FlownodeWorkloads - (*NodeInfo)(nil), // 5: greptime.v1.meta.NodeInfo - (*RegionStat)(nil), // 6: greptime.v1.meta.RegionStat - (*TopicStat)(nil), // 7: greptime.v1.meta.TopicStat - (*FlowStat)(nil), // 8: greptime.v1.meta.FlowStat - (*HeartbeatResponse)(nil), // 9: greptime.v1.meta.HeartbeatResponse - (*HeartbeatConfig)(nil), // 10: greptime.v1.meta.HeartbeatConfig - (*GrantedRegion)(nil), // 11: greptime.v1.meta.GrantedRegion - (*RegionLease)(nil), // 12: greptime.v1.meta.RegionLease - (*AskLeaderRequest)(nil), // 13: greptime.v1.meta.AskLeaderRequest - (*AskLeaderResponse)(nil), // 14: greptime.v1.meta.AskLeaderResponse - (*MailboxMessage)(nil), // 15: greptime.v1.meta.MailboxMessage - nil, // 16: greptime.v1.meta.HeartbeatRequest.ExtensionsEntry - nil, // 17: greptime.v1.meta.RegionStat.ExtensionsEntry - nil, // 18: greptime.v1.meta.FlowStat.FlowStatSizeEntry - nil, // 19: greptime.v1.meta.FlowStat.FlowLastExecTimeMapEntry - nil, // 20: greptime.v1.meta.GrantedRegion.ExtensionsEntry - (*RequestHeader)(nil), // 21: greptime.v1.meta.RequestHeader - (*Peer)(nil), // 22: greptime.v1.meta.Peer - (*TimeInterval)(nil), // 23: greptime.v1.meta.TimeInterval - (*ResponseHeader)(nil), // 24: greptime.v1.meta.ResponseHeader + (RegionRole)(0), // 0: greptime.v1.meta.RegionRole + (*HeartbeatRequest)(nil), // 1: greptime.v1.meta.HeartbeatRequest + (*DatanodeWorkloads)(nil), // 2: greptime.v1.meta.DatanodeWorkloads + (*FrontendWorkloads)(nil), // 3: greptime.v1.meta.FrontendWorkloads + (*FlownodeWorkloads)(nil), // 4: greptime.v1.meta.FlownodeWorkloads + (*NodeInfo)(nil), // 5: greptime.v1.meta.NodeInfo + (*RegionStat)(nil), // 6: greptime.v1.meta.RegionStat + (*TopicStat)(nil), // 7: greptime.v1.meta.TopicStat + (*FlowStat)(nil), // 8: greptime.v1.meta.FlowStat + (*HeartbeatResponse)(nil), // 9: greptime.v1.meta.HeartbeatResponse + (*HeartbeatConfig)(nil), // 10: greptime.v1.meta.HeartbeatConfig + (*GrantedRegion)(nil), // 11: greptime.v1.meta.GrantedRegion + (*RegionLease)(nil), // 12: greptime.v1.meta.RegionLease + (*AskLeaderRequest)(nil), // 13: greptime.v1.meta.AskLeaderRequest + (*AskLeaderResponse)(nil), // 14: greptime.v1.meta.AskLeaderResponse + (*MailboxMessageHeader)(nil), // 15: greptime.v1.meta.MailboxMessageHeader + (*MailboxMessage)(nil), // 16: greptime.v1.meta.MailboxMessage + nil, // 17: greptime.v1.meta.HeartbeatRequest.ExtensionsEntry + nil, // 18: greptime.v1.meta.RegionStat.ExtensionsEntry + nil, // 19: greptime.v1.meta.FlowStat.FlowStatSizeEntry + nil, // 20: greptime.v1.meta.FlowStat.FlowLastExecTimeMapEntry + nil, // 21: greptime.v1.meta.GrantedRegion.ExtensionsEntry + nil, // 22: greptime.v1.meta.MailboxMessageHeader.TracingContextEntry + (*RequestHeader)(nil), // 23: greptime.v1.meta.RequestHeader + (*Peer)(nil), // 24: greptime.v1.meta.Peer + (*TimeInterval)(nil), // 25: greptime.v1.meta.TimeInterval + (*ResponseHeader)(nil), // 26: greptime.v1.meta.ResponseHeader } var file_greptime_v1_meta_heartbeat_proto_depIdxs = []int32{ - 21, // 0: greptime.v1.meta.HeartbeatRequest.header:type_name -> greptime.v1.meta.RequestHeader - 22, // 1: greptime.v1.meta.HeartbeatRequest.peer:type_name -> greptime.v1.meta.Peer - 23, // 2: greptime.v1.meta.HeartbeatRequest.report_interval:type_name -> greptime.v1.meta.TimeInterval + 23, // 0: greptime.v1.meta.HeartbeatRequest.header:type_name -> greptime.v1.meta.RequestHeader + 24, // 1: greptime.v1.meta.HeartbeatRequest.peer:type_name -> greptime.v1.meta.Peer + 25, // 2: greptime.v1.meta.HeartbeatRequest.report_interval:type_name -> greptime.v1.meta.TimeInterval 6, // 3: greptime.v1.meta.HeartbeatRequest.region_stats:type_name -> greptime.v1.meta.RegionStat - 15, // 4: greptime.v1.meta.HeartbeatRequest.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage + 16, // 4: greptime.v1.meta.HeartbeatRequest.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage 5, // 5: greptime.v1.meta.HeartbeatRequest.info:type_name -> greptime.v1.meta.NodeInfo 8, // 6: greptime.v1.meta.HeartbeatRequest.flow_stat:type_name -> greptime.v1.meta.FlowStat 2, // 7: greptime.v1.meta.HeartbeatRequest.datanode:type_name -> greptime.v1.meta.DatanodeWorkloads 3, // 8: greptime.v1.meta.HeartbeatRequest.frontend:type_name -> greptime.v1.meta.FrontendWorkloads 4, // 9: greptime.v1.meta.HeartbeatRequest.flownode:type_name -> greptime.v1.meta.FlownodeWorkloads 7, // 10: greptime.v1.meta.HeartbeatRequest.topic_stats:type_name -> greptime.v1.meta.TopicStat - 16, // 11: greptime.v1.meta.HeartbeatRequest.extensions:type_name -> greptime.v1.meta.HeartbeatRequest.ExtensionsEntry + 17, // 11: greptime.v1.meta.HeartbeatRequest.extensions:type_name -> greptime.v1.meta.HeartbeatRequest.ExtensionsEntry 0, // 12: greptime.v1.meta.RegionStat.role:type_name -> greptime.v1.meta.RegionRole - 17, // 13: greptime.v1.meta.RegionStat.extensions:type_name -> greptime.v1.meta.RegionStat.ExtensionsEntry - 18, // 14: greptime.v1.meta.FlowStat.flow_stat_size:type_name -> greptime.v1.meta.FlowStat.FlowStatSizeEntry - 19, // 15: greptime.v1.meta.FlowStat.flow_last_exec_time_map:type_name -> greptime.v1.meta.FlowStat.FlowLastExecTimeMapEntry - 24, // 16: greptime.v1.meta.HeartbeatResponse.header:type_name -> greptime.v1.meta.ResponseHeader - 15, // 17: greptime.v1.meta.HeartbeatResponse.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage + 18, // 13: greptime.v1.meta.RegionStat.extensions:type_name -> greptime.v1.meta.RegionStat.ExtensionsEntry + 19, // 14: greptime.v1.meta.FlowStat.flow_stat_size:type_name -> greptime.v1.meta.FlowStat.FlowStatSizeEntry + 20, // 15: greptime.v1.meta.FlowStat.flow_last_exec_time_map:type_name -> greptime.v1.meta.FlowStat.FlowLastExecTimeMapEntry + 26, // 16: greptime.v1.meta.HeartbeatResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 16, // 17: greptime.v1.meta.HeartbeatResponse.mailbox_message:type_name -> greptime.v1.meta.MailboxMessage 12, // 18: greptime.v1.meta.HeartbeatResponse.region_lease:type_name -> greptime.v1.meta.RegionLease 10, // 19: greptime.v1.meta.HeartbeatResponse.heartbeat_config:type_name -> greptime.v1.meta.HeartbeatConfig 0, // 20: greptime.v1.meta.GrantedRegion.role:type_name -> greptime.v1.meta.RegionRole - 20, // 21: greptime.v1.meta.GrantedRegion.extensions:type_name -> greptime.v1.meta.GrantedRegion.ExtensionsEntry + 21, // 21: greptime.v1.meta.GrantedRegion.extensions:type_name -> greptime.v1.meta.GrantedRegion.ExtensionsEntry 11, // 22: greptime.v1.meta.RegionLease.regions:type_name -> greptime.v1.meta.GrantedRegion - 21, // 23: greptime.v1.meta.AskLeaderRequest.header:type_name -> greptime.v1.meta.RequestHeader - 24, // 24: greptime.v1.meta.AskLeaderResponse.header:type_name -> greptime.v1.meta.ResponseHeader - 22, // 25: greptime.v1.meta.AskLeaderResponse.leader:type_name -> greptime.v1.meta.Peer - 1, // 26: greptime.v1.meta.Heartbeat.Heartbeat:input_type -> greptime.v1.meta.HeartbeatRequest - 13, // 27: greptime.v1.meta.Heartbeat.AskLeader:input_type -> greptime.v1.meta.AskLeaderRequest - 9, // 28: greptime.v1.meta.Heartbeat.Heartbeat:output_type -> greptime.v1.meta.HeartbeatResponse - 14, // 29: greptime.v1.meta.Heartbeat.AskLeader:output_type -> greptime.v1.meta.AskLeaderResponse - 28, // [28:30] is the sub-list for method output_type - 26, // [26:28] is the sub-list for method input_type - 26, // [26:26] is the sub-list for extension type_name - 26, // [26:26] is the sub-list for extension extendee - 0, // [0:26] is the sub-list for field type_name + 23, // 23: greptime.v1.meta.AskLeaderRequest.header:type_name -> greptime.v1.meta.RequestHeader + 26, // 24: greptime.v1.meta.AskLeaderResponse.header:type_name -> greptime.v1.meta.ResponseHeader + 24, // 25: greptime.v1.meta.AskLeaderResponse.leader:type_name -> greptime.v1.meta.Peer + 22, // 26: greptime.v1.meta.MailboxMessageHeader.tracing_context:type_name -> greptime.v1.meta.MailboxMessageHeader.TracingContextEntry + 15, // 27: greptime.v1.meta.MailboxMessage.header:type_name -> greptime.v1.meta.MailboxMessageHeader + 1, // 28: greptime.v1.meta.Heartbeat.Heartbeat:input_type -> greptime.v1.meta.HeartbeatRequest + 13, // 29: greptime.v1.meta.Heartbeat.AskLeader:input_type -> greptime.v1.meta.AskLeaderRequest + 9, // 30: greptime.v1.meta.Heartbeat.Heartbeat:output_type -> greptime.v1.meta.HeartbeatResponse + 14, // 31: greptime.v1.meta.Heartbeat.AskLeader:output_type -> greptime.v1.meta.AskLeaderResponse + 30, // [30:32] is the sub-list for method output_type + 28, // [28:30] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name } func init() { file_greptime_v1_meta_heartbeat_proto_init() } @@ -1780,6 +1858,18 @@ func file_greptime_v1_meta_heartbeat_proto_init() { } } file_greptime_v1_meta_heartbeat_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MailboxMessageHeader); 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[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MailboxMessage); i { case 0: return &v.state @@ -1797,7 +1887,7 @@ func file_greptime_v1_meta_heartbeat_proto_init() { (*HeartbeatRequest_Frontend)(nil), (*HeartbeatRequest_Flownode)(nil), } - file_greptime_v1_meta_heartbeat_proto_msgTypes[14].OneofWrappers = []interface{}{ + file_greptime_v1_meta_heartbeat_proto_msgTypes[15].OneofWrappers = []interface{}{ (*MailboxMessage_Json)(nil), } type x struct{} @@ -1806,7 +1896,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: 20, + NumMessages: 22, NumExtensions: 0, NumServices: 1, }, diff --git a/java/src/main/java/greptime/v1/meta/HeartbeatOuterClass.java b/java/src/main/java/greptime/v1/meta/HeartbeatOuterClass.java index ee1b76a..02adee9 100644 --- a/java/src/main/java/greptime/v1/meta/HeartbeatOuterClass.java +++ b/java/src/main/java/greptime/v1/meta/HeartbeatOuterClass.java @@ -16526,10 +16526,862 @@ com.google.protobuf.ByteString defaultValue); } + public interface MailboxMessageHeaderOrBuilder extends + // @@protoc_insertion_point(interface_extends:greptime.v1.meta.MailboxMessageHeader) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Encoded trace_id & span_id, follow the w3c Trace Context
+     * https://www.w3.org/TR/trace-context/#header-name
+     * 
+ * + * map<string, string> tracing_context = 1; + */ + int getTracingContextCount(); + /** + *
+     * Encoded trace_id & span_id, follow the w3c Trace Context
+     * https://www.w3.org/TR/trace-context/#header-name
+     * 
+ * + * map<string, string> tracing_context = 1; + */ + boolean containsTracingContext( + java.lang.String key); + /** + * Use {@link #getTracingContextMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getTracingContext(); + /** + *
+     * Encoded trace_id & span_id, follow the w3c Trace Context
+     * https://www.w3.org/TR/trace-context/#header-name
+     * 
+ * + * map<string, string> tracing_context = 1; + */ + java.util.Map + getTracingContextMap(); + /** + *
+     * Encoded trace_id & span_id, follow the w3c Trace Context
+     * https://www.w3.org/TR/trace-context/#header-name
+     * 
+ * + * map<string, string> tracing_context = 1; + */ + + /* nullable */ +java.lang.String getTracingContextOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + *
+     * Encoded trace_id & span_id, follow the w3c Trace Context
+     * https://www.w3.org/TR/trace-context/#header-name
+     * 
+ * + * map<string, string> tracing_context = 1; + */ + + java.lang.String getTracingContextOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code greptime.v1.meta.MailboxMessageHeader} + */ + public static final class MailboxMessageHeader extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:greptime.v1.meta.MailboxMessageHeader) + MailboxMessageHeaderOrBuilder { + private static final long serialVersionUID = 0L; + // Use MailboxMessageHeader.newBuilder() to construct. + private MailboxMessageHeader(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private MailboxMessageHeader() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new MailboxMessageHeader(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private MailboxMessageHeader( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + tracingContext_ = com.google.protobuf.MapField.newMapField( + TracingContextDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + tracingContext__ = input.readMessage( + TracingContextDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + tracingContext_.getMutableMap().put( + tracingContext__.getKey(), tracingContext__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_MailboxMessageHeader_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetTracingContext(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_MailboxMessageHeader_fieldAccessorTable + .ensureFieldAccessorsInitialized( + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.class, greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.Builder.class); + } + + public static final int TRACING_CONTEXT_FIELD_NUMBER = 1; + private static final class TracingContextDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_MailboxMessageHeader_TracingContextEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> tracingContext_; + private com.google.protobuf.MapField + internalGetTracingContext() { + if (tracingContext_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TracingContextDefaultEntryHolder.defaultEntry); + } + return tracingContext_; + } + + public int getTracingContextCount() { + return internalGetTracingContext().getMap().size(); + } + /** + *
+     * Encoded trace_id & span_id, follow the w3c Trace Context
+     * https://www.w3.org/TR/trace-context/#header-name
+     * 
+ * + * map<string, string> tracing_context = 1; + */ + + @java.lang.Override + public boolean containsTracingContext( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetTracingContext().getMap().containsKey(key); + } + /** + * Use {@link #getTracingContextMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTracingContext() { + return getTracingContextMap(); + } + /** + *
+     * Encoded trace_id & span_id, follow the w3c Trace Context
+     * https://www.w3.org/TR/trace-context/#header-name
+     * 
+ * + * map<string, string> tracing_context = 1; + */ + @java.lang.Override + + public java.util.Map getTracingContextMap() { + return internalGetTracingContext().getMap(); + } + /** + *
+     * Encoded trace_id & span_id, follow the w3c Trace Context
+     * https://www.w3.org/TR/trace-context/#header-name
+     * 
+ * + * map<string, string> tracing_context = 1; + */ + @java.lang.Override + + public java.lang.String getTracingContextOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetTracingContext().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * Encoded trace_id & span_id, follow the w3c Trace Context
+     * https://www.w3.org/TR/trace-context/#header-name
+     * 
+ * + * map<string, string> tracing_context = 1; + */ + @java.lang.Override + + public java.lang.String getTracingContextOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetTracingContext().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetTracingContext(), + TracingContextDefaultEntryHolder.defaultEntry, + 1); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetTracingContext().getMap().entrySet()) { + com.google.protobuf.MapEntry + tracingContext__ = TracingContextDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, tracingContext__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader)) { + return super.equals(obj); + } + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader other = (greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader) obj; + + if (!internalGetTracingContext().equals( + other.internalGetTracingContext())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetTracingContext().getMap().isEmpty()) { + hash = (37 * hash) + TRACING_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + internalGetTracingContext().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code greptime.v1.meta.MailboxMessageHeader} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:greptime.v1.meta.MailboxMessageHeader) + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeaderOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_MailboxMessageHeader_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetTracingContext(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableTracingContext(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_MailboxMessageHeader_fieldAccessorTable + .ensureFieldAccessorsInitialized( + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.class, greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.Builder.class); + } + + // Construct using greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableTracingContext().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return greptime.v1.meta.HeartbeatOuterClass.internal_static_greptime_v1_meta_MailboxMessageHeader_descriptor; + } + + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader getDefaultInstanceForType() { + return greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.getDefaultInstance(); + } + + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader build() { + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader buildPartial() { + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader result = new greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader(this); + int from_bitField0_ = bitField0_; + result.tracingContext_ = internalGetTracingContext(); + result.tracingContext_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader) { + return mergeFrom((greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader other) { + if (other == greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.getDefaultInstance()) return this; + internalGetMutableTracingContext().mergeFrom( + other.internalGetTracingContext()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> tracingContext_; + private com.google.protobuf.MapField + internalGetTracingContext() { + if (tracingContext_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TracingContextDefaultEntryHolder.defaultEntry); + } + return tracingContext_; + } + private com.google.protobuf.MapField + internalGetMutableTracingContext() { + onChanged();; + if (tracingContext_ == null) { + tracingContext_ = com.google.protobuf.MapField.newMapField( + TracingContextDefaultEntryHolder.defaultEntry); + } + if (!tracingContext_.isMutable()) { + tracingContext_ = tracingContext_.copy(); + } + return tracingContext_; + } + + public int getTracingContextCount() { + return internalGetTracingContext().getMap().size(); + } + /** + *
+       * Encoded trace_id & span_id, follow the w3c Trace Context
+       * https://www.w3.org/TR/trace-context/#header-name
+       * 
+ * + * map<string, string> tracing_context = 1; + */ + + @java.lang.Override + public boolean containsTracingContext( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetTracingContext().getMap().containsKey(key); + } + /** + * Use {@link #getTracingContextMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTracingContext() { + return getTracingContextMap(); + } + /** + *
+       * Encoded trace_id & span_id, follow the w3c Trace Context
+       * https://www.w3.org/TR/trace-context/#header-name
+       * 
+ * + * map<string, string> tracing_context = 1; + */ + @java.lang.Override + + public java.util.Map getTracingContextMap() { + return internalGetTracingContext().getMap(); + } + /** + *
+       * Encoded trace_id & span_id, follow the w3c Trace Context
+       * https://www.w3.org/TR/trace-context/#header-name
+       * 
+ * + * map<string, string> tracing_context = 1; + */ + @java.lang.Override + + public java.lang.String getTracingContextOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetTracingContext().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * Encoded trace_id & span_id, follow the w3c Trace Context
+       * https://www.w3.org/TR/trace-context/#header-name
+       * 
+ * + * map<string, string> tracing_context = 1; + */ + @java.lang.Override + + public java.lang.String getTracingContextOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetTracingContext().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearTracingContext() { + internalGetMutableTracingContext().getMutableMap() + .clear(); + return this; + } + /** + *
+       * Encoded trace_id & span_id, follow the w3c Trace Context
+       * https://www.w3.org/TR/trace-context/#header-name
+       * 
+ * + * map<string, string> tracing_context = 1; + */ + + public Builder removeTracingContext( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableTracingContext().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableTracingContext() { + return internalGetMutableTracingContext().getMutableMap(); + } + /** + *
+       * Encoded trace_id & span_id, follow the w3c Trace Context
+       * https://www.w3.org/TR/trace-context/#header-name
+       * 
+ * + * map<string, string> tracing_context = 1; + */ + public Builder putTracingContext( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { + throw new NullPointerException("map value"); +} + + internalGetMutableTracingContext().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * Encoded trace_id & span_id, follow the w3c Trace Context
+       * https://www.w3.org/TR/trace-context/#header-name
+       * 
+ * + * map<string, string> tracing_context = 1; + */ + + public Builder putAllTracingContext( + java.util.Map values) { + internalGetMutableTracingContext().getMutableMap() + .putAll(values); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:greptime.v1.meta.MailboxMessageHeader) + } + + // @@protoc_insertion_point(class_scope:greptime.v1.meta.MailboxMessageHeader) + private static final greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader(); + } + + public static greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MailboxMessageHeader parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MailboxMessageHeader(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + public interface MailboxMessageOrBuilder extends // @@protoc_insertion_point(interface_extends:greptime.v1.meta.MailboxMessage) com.google.protobuf.MessageOrBuilder { + /** + *
+     */ The header of the mailbox message.
+     * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + * @return Whether the header field is set. + */ + boolean hasHeader(); + /** + *
+     */ The header of the mailbox message.
+     * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + * @return The header. + */ + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader getHeader(); + /** + *
+     */ The header of the mailbox message.
+     * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + */ + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeaderOrBuilder getHeaderOrBuilder(); + /** *
      * The id is used to associate request and response.
@@ -16697,6 +17549,19 @@ com.google.protobuf.ByteString defaultValue);
               payload_ = s;
               break;
             }
+            case 514: {
+              greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.Builder subBuilder = null;
+              if (header_ != null) {
+                subBuilder = header_.toBuilder();
+              }
+              header_ = input.readMessage(greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.parser(), extensionRegistry);
+              if (subBuilder != null) {
+                subBuilder.mergeFrom(header_);
+                header_ = subBuilder.buildPartial();
+              }
+
+              break;
+            }
             default: {
               if (!parseUnknownField(
                   input, unknownFields, extensionRegistry, tag)) {
@@ -16770,6 +17635,44 @@ com.google.protobuf.ByteString defaultValue);
           payloadCase_);
     }
 
+    public static final int HEADER_FIELD_NUMBER = 64;
+    private greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader header_;
+    /**
+     * 
+     */ The header of the mailbox message.
+     * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + * @return Whether the header field is set. + */ + @java.lang.Override + public boolean hasHeader() { + return header_ != null; + } + /** + *
+     */ The header of the mailbox message.
+     * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + * @return The header. + */ + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader getHeader() { + return header_ == null ? greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.getDefaultInstance() : header_; + } + /** + *
+     */ The header of the mailbox message.
+     * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + */ + @java.lang.Override + public greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeaderOrBuilder getHeaderOrBuilder() { + return getHeader(); + } + public static final int ID_FIELD_NUMBER = 1; private long id_; /** @@ -17008,6 +17911,9 @@ com.google.protobuf.ByteString defaultValue); if (payloadCase_ == 6) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, payload_); } + if (header_ != null) { + output.writeMessage(64, getHeader()); + } unknownFields.writeTo(output); } @@ -17037,6 +17943,10 @@ com.google.protobuf.ByteString defaultValue); if (payloadCase_ == 6) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, payload_); } + if (header_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(64, getHeader()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -17052,6 +17962,11 @@ com.google.protobuf.ByteString defaultValue); } greptime.v1.meta.HeartbeatOuterClass.MailboxMessage other = (greptime.v1.meta.HeartbeatOuterClass.MailboxMessage) obj; + if (hasHeader() != other.hasHeader()) return false; + if (hasHeader()) { + if (!getHeader() + .equals(other.getHeader())) return false; + } if (getId() != other.getId()) return false; if (!getSubject() @@ -17082,6 +17997,10 @@ com.google.protobuf.ByteString defaultValue); } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + if (hasHeader()) { + hash = (37 * hash) + HEADER_FIELD_NUMBER; + hash = (53 * hash) + getHeader().hashCode(); + } hash = (37 * hash) + ID_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getId()); @@ -17235,6 +18154,12 @@ com.google.protobuf.ByteString defaultValue); @java.lang.Override public Builder clear() { super.clear(); + if (headerBuilder_ == null) { + header_ = null; + } else { + header_ = null; + headerBuilder_ = null; + } id_ = 0L; subject_ = ""; @@ -17273,6 +18198,11 @@ com.google.protobuf.ByteString defaultValue); @java.lang.Override public greptime.v1.meta.HeartbeatOuterClass.MailboxMessage buildPartial() { greptime.v1.meta.HeartbeatOuterClass.MailboxMessage result = new greptime.v1.meta.HeartbeatOuterClass.MailboxMessage(this); + if (headerBuilder_ == null) { + result.header_ = header_; + } else { + result.header_ = headerBuilder_.build(); + } result.id_ = id_; result.subject_ = subject_; result.from_ = from_; @@ -17330,6 +18260,9 @@ com.google.protobuf.ByteString defaultValue); public Builder mergeFrom(greptime.v1.meta.HeartbeatOuterClass.MailboxMessage other) { if (other == greptime.v1.meta.HeartbeatOuterClass.MailboxMessage.getDefaultInstance()) return this; + if (other.hasHeader()) { + mergeHeader(other.getHeader()); + } if (other.getId() != 0L) { setId(other.getId()); } @@ -17403,6 +18336,161 @@ com.google.protobuf.ByteString defaultValue); } + private greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader header_; + private com.google.protobuf.SingleFieldBuilderV3< + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader, greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.Builder, greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeaderOrBuilder> headerBuilder_; + /** + *
+       */ The header of the mailbox message.
+       * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + * @return Whether the header field is set. + */ + public boolean hasHeader() { + return headerBuilder_ != null || header_ != null; + } + /** + *
+       */ The header of the mailbox message.
+       * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + * @return The header. + */ + public greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader getHeader() { + if (headerBuilder_ == null) { + return header_ == null ? greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.getDefaultInstance() : header_; + } else { + return headerBuilder_.getMessage(); + } + } + /** + *
+       */ The header of the mailbox message.
+       * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + */ + public Builder setHeader(greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader value) { + if (headerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + header_ = value; + onChanged(); + } else { + headerBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       */ The header of the mailbox message.
+       * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + */ + public Builder setHeader( + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.Builder builderForValue) { + if (headerBuilder_ == null) { + header_ = builderForValue.build(); + onChanged(); + } else { + headerBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       */ The header of the mailbox message.
+       * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + */ + public Builder mergeHeader(greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader value) { + if (headerBuilder_ == null) { + if (header_ != null) { + header_ = + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.newBuilder(header_).mergeFrom(value).buildPartial(); + } else { + header_ = value; + } + onChanged(); + } else { + headerBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       */ The header of the mailbox message.
+       * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + */ + public Builder clearHeader() { + if (headerBuilder_ == null) { + header_ = null; + onChanged(); + } else { + header_ = null; + headerBuilder_ = null; + } + + return this; + } + /** + *
+       */ The header of the mailbox message.
+       * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + */ + public greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.Builder getHeaderBuilder() { + + onChanged(); + return getHeaderFieldBuilder().getBuilder(); + } + /** + *
+       */ The header of the mailbox message.
+       * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + */ + public greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeaderOrBuilder getHeaderOrBuilder() { + if (headerBuilder_ != null) { + return headerBuilder_.getMessageOrBuilder(); + } else { + return header_ == null ? + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.getDefaultInstance() : header_; + } + } + /** + *
+       */ The header of the mailbox message.
+       * 
+ * + * .greptime.v1.meta.MailboxMessageHeader header = 64; + */ + private com.google.protobuf.SingleFieldBuilderV3< + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader, greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.Builder, greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeaderOrBuilder> + getHeaderFieldBuilder() { + if (headerBuilder_ == null) { + headerBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader, greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeader.Builder, greptime.v1.meta.HeartbeatOuterClass.MailboxMessageHeaderOrBuilder>( + getHeader(), + getParentForChildren(), + isClean()); + header_ = null; + } + return headerBuilder_; + } + private long id_ ; /** *
@@ -17986,6 +19074,16 @@ com.google.protobuf.ByteString defaultValue);
   private static final 
     com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
       internal_static_greptime_v1_meta_AskLeaderResponse_fieldAccessorTable;
+  private static final com.google.protobuf.Descriptors.Descriptor
+    internal_static_greptime_v1_meta_MailboxMessageHeader_descriptor;
+  private static final 
+    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+      internal_static_greptime_v1_meta_MailboxMessageHeader_fieldAccessorTable;
+  private static final com.google.protobuf.Descriptors.Descriptor
+    internal_static_greptime_v1_meta_MailboxMessageHeader_TracingContextEntry_descriptor;
+  private static final 
+    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+      internal_static_greptime_v1_meta_MailboxMessageHeader_TracingContextEntry_fieldAccessorTable;
   private static final com.google.protobuf.Descriptors.Descriptor
     internal_static_greptime_v1_meta_MailboxMessage_descriptor;
   private static final 
@@ -18067,19 +19165,24 @@ com.google.protobuf.ByteString defaultValue);
       "\n\006header\030\001 \001(\0132\037.greptime.v1.meta.Reques" +
       "tHeader\"m\n\021AskLeaderResponse\0220\n\006header\030\001" +
       " \001(\0132 .greptime.v1.meta.ResponseHeader\022&" +
-      "\n\006leader\030\002 \001(\0132\026.greptime.v1.meta.Peer\"|" +
-      "\n\016MailboxMessage\022\n\n\002id\030\001 \001(\004\022\017\n\007subject\030" +
-      "\002 \001(\t\022\014\n\004from\030\003 \001(\t\022\n\n\002to\030\004 \001(\t\022\030\n\020times" +
-      "tamp_millis\030\005 \001(\003\022\016\n\004json\030\006 \001(\tH\000B\t\n\007pay" +
-      "load*=\n\nRegionRole\022\n\n\006Leader\020\000\022\014\n\010Follow" +
-      "er\020\001\022\025\n\021DowngradingLeader\020\0022\277\001\n\tHeartbea" +
-      "t\022Z\n\tHeartbeat\022\".greptime.v1.meta.Heartb" +
-      "eatRequest\032#.greptime.v1.meta.HeartbeatR" +
-      "esponse\"\000(\0010\001\022V\n\tAskLeader\022\".greptime.v1" +
-      ".meta.AskLeaderRequest\032#.greptime.v1.met" +
-      "a.AskLeaderResponse\"\000B tracing_context = 1;
+}
+
 message MailboxMessage {
+  /// The header of the mailbox message.
+  MailboxMessageHeader header = 64;
   // The id is used to associate request and response.
   uint64 id = 1;
   // The following information plays a bigger role in making messages traceable
diff --git a/src/v1/meta/mailbox.rs b/src/v1/meta/mailbox.rs
index e66db79..cc3b19b 100644
--- a/src/v1/meta/mailbox.rs
+++ b/src/v1/meta/mailbox.rs
@@ -12,11 +12,14 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-use crate::v1::meta::mailbox_message::Payload;
 use crate::v1::meta::MailboxMessage;
+use crate::v1::meta::{mailbox_message::Payload, MailboxMessageHeader};
 use serde::Serialize;
 use serde_json::Result;
-use std::fmt::{Display, Formatter};
+use std::{
+    collections::HashMap,
+    fmt::{Display, Formatter},
+};
 
 impl MailboxMessage {
     pub fn json_message(
@@ -25,12 +28,17 @@ impl MailboxMessage {
         to: &str,
         timestamp_millis: i64,
         payload: &T,
+        tracing_context: Option>,
     ) -> Result
     where
         T: ?Sized + Serialize + Display,
     {
         let payload = serde_json::to_string(payload)?;
+        let header = MailboxMessageHeader {
+            tracing_context: tracing_context.unwrap_or_default(),
+        };
         Ok(MailboxMessage {
+            header: Some(header),
             id: 0, // "id" will be set by the mailbox.
             subject: subject.to_string(),
             from: from.to_string(),