diff --git a/c++/greptime/v1/common.pb.cc b/c++/greptime/v1/common.pb.cc index c4e68fee..3f580603 100644 --- a/c++/greptime/v1/common.pb.cc +++ b/c++/greptime/v1/common.pb.cc @@ -22,14 +22,24 @@ namespace _pbi = _pb::internal; namespace greptime { namespace v1 { +PROTOBUF_CONSTEXPR RequestHeader_TracingContextEntry_DoNotUse::RequestHeader_TracingContextEntry_DoNotUse( + ::_pbi::ConstantInitialized) {} +struct RequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR RequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~RequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal() {} + union { + RequestHeader_TracingContextEntry_DoNotUse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal _RequestHeader_TracingContextEntry_DoNotUse_default_instance_; PROTOBUF_CONSTEXPR RequestHeader::RequestHeader( ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.catalog_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + /*decltype(_impl_.tracing_context_)*/{::_pbi::ConstantInitialized()} + , /*decltype(_impl_.catalog_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.schema_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.dbname_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.authorization_)*/nullptr - , /*decltype(_impl_.trace_id_)*/uint64_t{0u} - , /*decltype(_impl_.span_id_)*/uint64_t{0u} , /*decltype(_impl_._cached_size_)*/{}} {} struct RequestHeaderDefaultTypeInternal { PROTOBUF_CONSTEXPR RequestHeaderDefaultTypeInternal() @@ -151,11 +161,21 @@ struct IntervalMonthDayNanoDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 IntervalMonthDayNanoDefaultTypeInternal _IntervalMonthDayNano_default_instance_; } // namespace v1 } // namespace greptime -static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fcommon_2eproto[9]; +static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fcommon_2eproto[10]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2fcommon_2eproto[2]; static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fcommon_2eproto = nullptr; const uint32_t TableStruct_greptime_2fv1_2fcommon_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::greptime::v1::RequestHeader_TracingContextEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::RequestHeader_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::RequestHeader_TracingContextEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::RequestHeader_TracingContextEntry_DoNotUse, value_), + 0, + 1, ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::RequestHeader, _internal_metadata_), ~0u, // no _extensions_ @@ -166,8 +186,7 @@ const uint32_t TableStruct_greptime_2fv1_2fcommon_2eproto::offsets[] PROTOBUF_SE PROTOBUF_FIELD_OFFSET(::greptime::v1::RequestHeader, _impl_.schema_), PROTOBUF_FIELD_OFFSET(::greptime::v1::RequestHeader, _impl_.authorization_), PROTOBUF_FIELD_OFFSET(::greptime::v1::RequestHeader, _impl_.dbname_), - PROTOBUF_FIELD_OFFSET(::greptime::v1::RequestHeader, _impl_.trace_id_), - PROTOBUF_FIELD_OFFSET(::greptime::v1::RequestHeader, _impl_.span_id_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::RequestHeader, _impl_.tracing_context_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::ResponseHeader, _internal_metadata_), ~0u, // no _extensions_ @@ -232,18 +251,20 @@ const uint32_t TableStruct_greptime_2fv1_2fcommon_2eproto::offsets[] PROTOBUF_SE PROTOBUF_FIELD_OFFSET(::greptime::v1::IntervalMonthDayNano, _impl_.nanoseconds_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, -1, sizeof(::greptime::v1::RequestHeader)}, - { 12, -1, -1, sizeof(::greptime::v1::ResponseHeader)}, - { 19, -1, -1, sizeof(::greptime::v1::Status)}, - { 27, -1, -1, sizeof(::greptime::v1::AuthHeader)}, - { 36, -1, -1, sizeof(::greptime::v1::Basic)}, - { 44, -1, -1, sizeof(::greptime::v1::Token)}, - { 51, -1, -1, sizeof(::greptime::v1::AffectedRows)}, - { 58, -1, -1, sizeof(::greptime::v1::FlightMetadata)}, - { 65, -1, -1, sizeof(::greptime::v1::IntervalMonthDayNano)}, + { 0, 8, -1, sizeof(::greptime::v1::RequestHeader_TracingContextEntry_DoNotUse)}, + { 10, -1, -1, sizeof(::greptime::v1::RequestHeader)}, + { 21, -1, -1, sizeof(::greptime::v1::ResponseHeader)}, + { 28, -1, -1, sizeof(::greptime::v1::Status)}, + { 36, -1, -1, sizeof(::greptime::v1::AuthHeader)}, + { 45, -1, -1, sizeof(::greptime::v1::Basic)}, + { 53, -1, -1, sizeof(::greptime::v1::Token)}, + { 60, -1, -1, sizeof(::greptime::v1::AffectedRows)}, + { 67, -1, -1, sizeof(::greptime::v1::FlightMetadata)}, + { 74, -1, -1, sizeof(::greptime::v1::IntervalMonthDayNano)}, }; static const ::_pb::Message* const file_default_instances[] = { + &::greptime::v1::_RequestHeader_TracingContextEntry_DoNotUse_default_instance_._instance, &::greptime::v1::_RequestHeader_default_instance_._instance, &::greptime::v1::_ResponseHeader_default_instance_._instance, &::greptime::v1::_Status_default_instance_._instance, @@ -257,45 +278,47 @@ static const ::_pb::Message* const file_default_instances[] = { const char descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = "\n\030greptime/v1/common.proto\022\013greptime.v1\"" - "\223\001\n\rRequestHeader\022\017\n\007catalog\030\001 \001(\t\022\016\n\006sc" + "\360\001\n\rRequestHeader\022\017\n\007catalog\030\001 \001(\t\022\016\n\006sc" "hema\030\002 \001(\t\022.\n\rauthorization\030\003 \001(\0132\027.grep" - "time.v1.AuthHeader\022\016\n\006dbname\030\004 \001(\t\022\020\n\010tr" - "ace_id\030\005 \001(\004\022\017\n\007span_id\030\006 \001(\004\"5\n\016Respons" - "eHeader\022#\n\006status\030\001 \001(\0132\023.greptime.v1.St" - "atus\".\n\006Status\022\023\n\013status_code\030\001 \001(\r\022\017\n\007e" - "rr_msg\030\002 \001(\t\"e\n\nAuthHeader\022#\n\005basic\030\001 \001(" - "\0132\022.greptime.v1.BasicH\000\022#\n\005token\030\002 \001(\0132\022" - ".greptime.v1.TokenH\000B\r\n\013auth_scheme\"+\n\005B" - "asic\022\020\n\010username\030\001 \001(\t\022\020\n\010password\030\002 \001(\t" - "\"\026\n\005Token\022\r\n\005token\030\001 \001(\t\"\035\n\014AffectedRows" - "\022\r\n\005value\030\001 \001(\r\"B\n\016FlightMetadata\0220\n\raff" - "ected_rows\030\001 \001(\0132\031.greptime.v1.AffectedR" - "ows\"I\n\024IntervalMonthDayNano\022\016\n\006months\030\001 " - "\001(\005\022\014\n\004days\030\002 \001(\005\022\023\n\013nanoseconds\030\003 \001(\003*1" - "\n\014SemanticType\022\007\n\003TAG\020\000\022\t\n\005FIELD\020\001\022\r\n\tTI" - "MESTAMP\020\002*\250\004\n\016ColumnDataType\022\013\n\007BOOLEAN\020" - "\000\022\010\n\004INT8\020\001\022\t\n\005INT16\020\002\022\t\n\005INT32\020\003\022\t\n\005INT" - "64\020\004\022\t\n\005UINT8\020\005\022\n\n\006UINT16\020\006\022\n\n\006UINT32\020\007\022" - "\n\n\006UINT64\020\010\022\013\n\007FLOAT32\020\t\022\013\n\007FLOAT64\020\n\022\n\n" - "\006BINARY\020\013\022\n\n\006STRING\020\014\022\010\n\004DATE\020\r\022\014\n\010DATET" - "IME\020\016\022\024\n\020TIMESTAMP_SECOND\020\017\022\031\n\025TIMESTAMP" - "_MILLISECOND\020\020\022\031\n\025TIMESTAMP_MICROSECOND\020" - "\021\022\030\n\024TIMESTAMP_NANOSECOND\020\022\022\017\n\013TIME_SECO" - "ND\020\023\022\024\n\020TIME_MILLISECOND\020\024\022\024\n\020TIME_MICRO" - "SECOND\020\025\022\023\n\017TIME_NANOSECOND\020\026\022\027\n\023INTERVA" - "L_YEAR_MONTH\020\027\022\025\n\021INTERVAL_DAY_TIME\020\030\022\033\n" - "\027INTERVAL_MONTH_DAY_NANO\020\031\022\023\n\017DURATION_S" - "ECOND\020\032\022\030\n\024DURATION_MILLISECOND\020\033\022\030\n\024DUR" - "ATION_MICROSECOND\020\034\022\027\n\023DURATION_NANOSECO" - "ND\020\035BO\n\016io.greptime.v1B\006CommonZ5github.c" - "om/GreptimeTeam/greptime-proto/go/grepti" - "me/v1b\006proto3" + "time.v1.AuthHeader\022\016\n\006dbname\030\004 \001(\t\022G\n\017tr" + "acing_context\030\005 \003(\0132..greptime.v1.Reques" + "tHeader.TracingContextEntry\0325\n\023TracingCo" + "ntextEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\002" + "8\001\"5\n\016ResponseHeader\022#\n\006status\030\001 \001(\0132\023.g" + "reptime.v1.Status\".\n\006Status\022\023\n\013status_co" + "de\030\001 \001(\r\022\017\n\007err_msg\030\002 \001(\t\"e\n\nAuthHeader\022" + "#\n\005basic\030\001 \001(\0132\022.greptime.v1.BasicH\000\022#\n\005" + "token\030\002 \001(\0132\022.greptime.v1.TokenH\000B\r\n\013aut" + "h_scheme\"+\n\005Basic\022\020\n\010username\030\001 \001(\t\022\020\n\010p" + "assword\030\002 \001(\t\"\026\n\005Token\022\r\n\005token\030\001 \001(\t\"\035\n" + "\014AffectedRows\022\r\n\005value\030\001 \001(\r\"B\n\016FlightMe" + "tadata\0220\n\raffected_rows\030\001 \001(\0132\031.greptime" + ".v1.AffectedRows\"I\n\024IntervalMonthDayNano" + "\022\016\n\006months\030\001 \001(\005\022\014\n\004days\030\002 \001(\005\022\023\n\013nanose" + "conds\030\003 \001(\003*1\n\014SemanticType\022\007\n\003TAG\020\000\022\t\n\005" + "FIELD\020\001\022\r\n\tTIMESTAMP\020\002*\250\004\n\016ColumnDataTyp" + "e\022\013\n\007BOOLEAN\020\000\022\010\n\004INT8\020\001\022\t\n\005INT16\020\002\022\t\n\005I" + "NT32\020\003\022\t\n\005INT64\020\004\022\t\n\005UINT8\020\005\022\n\n\006UINT16\020\006" + "\022\n\n\006UINT32\020\007\022\n\n\006UINT64\020\010\022\013\n\007FLOAT32\020\t\022\013\n" + "\007FLOAT64\020\n\022\n\n\006BINARY\020\013\022\n\n\006STRING\020\014\022\010\n\004DA" + "TE\020\r\022\014\n\010DATETIME\020\016\022\024\n\020TIMESTAMP_SECOND\020\017" + "\022\031\n\025TIMESTAMP_MILLISECOND\020\020\022\031\n\025TIMESTAMP" + "_MICROSECOND\020\021\022\030\n\024TIMESTAMP_NANOSECOND\020\022" + "\022\017\n\013TIME_SECOND\020\023\022\024\n\020TIME_MILLISECOND\020\024\022" + "\024\n\020TIME_MICROSECOND\020\025\022\023\n\017TIME_NANOSECOND" + "\020\026\022\027\n\023INTERVAL_YEAR_MONTH\020\027\022\025\n\021INTERVAL_" + "DAY_TIME\020\030\022\033\n\027INTERVAL_MONTH_DAY_NANO\020\031\022" + "\023\n\017DURATION_SECOND\020\032\022\030\n\024DURATION_MILLISE" + "COND\020\033\022\030\n\024DURATION_MICROSECOND\020\034\022\027\n\023DURA" + "TION_NANOSECOND\020\035BO\n\016io.greptime.v1B\006Com" + "monZ5github.com/GreptimeTeam/greptime-pr" + "oto/go/greptime/v1b\006proto3" ; static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fcommon_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fcommon_2eproto = { - false, false, 1333, descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto, + false, false, 1426, descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto, "greptime/v1/common.proto", - &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, nullptr, 0, 9, + &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, nullptr, 0, 10, schemas, file_default_instances, TableStruct_greptime_2fv1_2fcommon_2eproto::offsets, file_level_metadata_greptime_2fv1_2fcommon_2eproto, file_level_enum_descriptors_greptime_2fv1_2fcommon_2eproto, file_level_service_descriptors_greptime_2fv1_2fcommon_2eproto, @@ -366,6 +389,20 @@ bool ColumnDataType_IsValid(int value) { } +// =================================================================== + +RequestHeader_TracingContextEntry_DoNotUse::RequestHeader_TracingContextEntry_DoNotUse() {} +RequestHeader_TracingContextEntry_DoNotUse::RequestHeader_TracingContextEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : SuperType(arena) {} +void RequestHeader_TracingContextEntry_DoNotUse::MergeFrom(const RequestHeader_TracingContextEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::PROTOBUF_NAMESPACE_ID::Metadata RequestHeader_TracingContextEntry_DoNotUse::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_greptime_2fv1_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, + file_level_metadata_greptime_2fv1_2fcommon_2eproto[0]); +} + // =================================================================== class RequestHeader::_Internal { @@ -381,21 +418,24 @@ RequestHeader::RequestHeader(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); + if (arena != nullptr && !is_message_owned) { + arena->OwnCustomDestructor(this, &RequestHeader::ArenaDtor); + } // @@protoc_insertion_point(arena_constructor:greptime.v1.RequestHeader) } RequestHeader::RequestHeader(const RequestHeader& from) : ::PROTOBUF_NAMESPACE_ID::Message() { RequestHeader* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.catalog_){} + /*decltype(_impl_.tracing_context_)*/{} + , decltype(_impl_.catalog_){} , decltype(_impl_.schema_){} , decltype(_impl_.dbname_){} , decltype(_impl_.authorization_){nullptr} - , decltype(_impl_.trace_id_){} - , decltype(_impl_.span_id_){} , /*decltype(_impl_._cached_size_)*/{}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.tracing_context_.MergeFrom(from._impl_.tracing_context_); _impl_.catalog_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.catalog_.Set("", GetArenaForAllocation()); @@ -423,9 +463,6 @@ RequestHeader::RequestHeader(const RequestHeader& from) if (from._internal_has_authorization()) { _this->_impl_.authorization_ = new ::greptime::v1::AuthHeader(*from._impl_.authorization_); } - ::memcpy(&_impl_.trace_id_, &from._impl_.trace_id_, - static_cast(reinterpret_cast(&_impl_.span_id_) - - reinterpret_cast(&_impl_.trace_id_)) + sizeof(_impl_.span_id_)); // @@protoc_insertion_point(copy_constructor:greptime.v1.RequestHeader) } @@ -434,12 +471,11 @@ inline void RequestHeader::SharedCtor( (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.catalog_){} + /*decltype(_impl_.tracing_context_)*/{::_pbi::ArenaInitialized(), arena} + , decltype(_impl_.catalog_){} , decltype(_impl_.schema_){} , decltype(_impl_.dbname_){} , decltype(_impl_.authorization_){nullptr} - , decltype(_impl_.trace_id_){uint64_t{0u}} - , decltype(_impl_.span_id_){uint64_t{0u}} , /*decltype(_impl_._cached_size_)*/{} }; _impl_.catalog_.InitDefault(); @@ -460,6 +496,7 @@ RequestHeader::~RequestHeader() { // @@protoc_insertion_point(destructor:greptime.v1.RequestHeader) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; + ArenaDtor(this); return; } SharedDtor(); @@ -467,12 +504,18 @@ RequestHeader::~RequestHeader() { inline void RequestHeader::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.tracing_context_.Destruct(); + _impl_.tracing_context_.~MapField(); _impl_.catalog_.Destroy(); _impl_.schema_.Destroy(); _impl_.dbname_.Destroy(); if (this != internal_default_instance()) delete _impl_.authorization_; } +void RequestHeader::ArenaDtor(void* object) { + RequestHeader* _this = reinterpret_cast< RequestHeader* >(object); + _this->_impl_.tracing_context_.Destruct(); +} void RequestHeader::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } @@ -483,6 +526,7 @@ void RequestHeader::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + _impl_.tracing_context_.Clear(); _impl_.catalog_.ClearToEmpty(); _impl_.schema_.ClearToEmpty(); _impl_.dbname_.ClearToEmpty(); @@ -490,9 +534,6 @@ void RequestHeader::Clear() { delete _impl_.authorization_; } _impl_.authorization_ = nullptr; - ::memset(&_impl_.trace_id_, 0, static_cast( - reinterpret_cast(&_impl_.span_id_) - - reinterpret_cast(&_impl_.trace_id_)) + sizeof(_impl_.span_id_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -540,19 +581,16 @@ const char* RequestHeader::_InternalParse(const char* ptr, ::_pbi::ParseContext* } else goto handle_unusual; continue; - // uint64 trace_id = 5; + // map tracing_context = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - _impl_.trace_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // uint64 span_id = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { - _impl_.span_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + 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<42>(ptr)); } else goto handle_unusual; continue; @@ -622,16 +660,34 @@ uint8_t* RequestHeader::_InternalSerialize( 4, this->_internal_dbname(), target); } - // uint64 trace_id = 5; - if (this->_internal_trace_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(5, this->_internal_trace_id(), target); - } - - // uint64 span_id = 6; - if (this->_internal_span_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(6, this->_internal_span_id(), target); + // map tracing_context = 5; + if (!this->_internal_tracing_context().empty()) { + using MapType = ::_pb::Map; + using WireHelper = RequestHeader_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.RequestHeader.TracingContextEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + entry.second.data(), static_cast(entry.second.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "greptime.v1.RequestHeader.TracingContextEntry.value"); + }; + + if (stream->IsSerializationDeterministic() && map_field.size() > 1) { + for (const auto& entry : ::_pbi::MapSorterPtr(map_field)) { + target = WireHelper::InternalSerialize(5, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } else { + for (const auto& entry : map_field) { + target = WireHelper::InternalSerialize(5, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { @@ -650,6 +706,15 @@ size_t RequestHeader::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + // map tracing_context = 5; + 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 += RequestHeader_TracingContextEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + // string catalog = 1; if (!this->_internal_catalog().empty()) { total_size += 1 + @@ -678,16 +743,6 @@ size_t RequestHeader::ByteSizeLong() const { *_impl_.authorization_); } - // uint64 trace_id = 5; - if (this->_internal_trace_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_trace_id()); - } - - // uint64 span_id = 6; - if (this->_internal_span_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_span_id()); - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -706,6 +761,7 @@ void RequestHeader::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const :: uint32_t cached_has_bits = 0; (void) cached_has_bits; + _this->_impl_.tracing_context_.MergeFrom(from._impl_.tracing_context_); if (!from._internal_catalog().empty()) { _this->_internal_set_catalog(from._internal_catalog()); } @@ -719,12 +775,6 @@ void RequestHeader::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const :: _this->_internal_mutable_authorization()->::greptime::v1::AuthHeader::MergeFrom( from._internal_authorization()); } - if (from._internal_trace_id() != 0) { - _this->_internal_set_trace_id(from._internal_trace_id()); - } - if (from._internal_span_id() != 0) { - _this->_internal_set_span_id(from._internal_span_id()); - } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -744,6 +794,7 @@ void RequestHeader::InternalSwap(RequestHeader* other) { auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.tracing_context_.InternalSwap(&other->_impl_.tracing_context_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( &_impl_.catalog_, lhs_arena, &other->_impl_.catalog_, rhs_arena @@ -756,18 +807,13 @@ void RequestHeader::InternalSwap(RequestHeader* other) { &_impl_.dbname_, lhs_arena, &other->_impl_.dbname_, rhs_arena ); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(RequestHeader, _impl_.span_id_) - + sizeof(RequestHeader::_impl_.span_id_) - - PROTOBUF_FIELD_OFFSET(RequestHeader, _impl_.authorization_)>( - reinterpret_cast(&_impl_.authorization_), - reinterpret_cast(&other->_impl_.authorization_)); + swap(_impl_.authorization_, other->_impl_.authorization_); } ::PROTOBUF_NAMESPACE_ID::Metadata RequestHeader::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fcommon_2eproto[0]); + file_level_metadata_greptime_2fv1_2fcommon_2eproto[1]); } // =================================================================== @@ -960,7 +1006,7 @@ void ResponseHeader::InternalSwap(ResponseHeader* other) { ::PROTOBUF_NAMESPACE_ID::Metadata ResponseHeader::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fcommon_2eproto[1]); + file_level_metadata_greptime_2fv1_2fcommon_2eproto[2]); } // =================================================================== @@ -1190,7 +1236,7 @@ void Status::InternalSwap(Status* other) { ::PROTOBUF_NAMESPACE_ID::Metadata Status::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fcommon_2eproto[2]); + file_level_metadata_greptime_2fv1_2fcommon_2eproto[3]); } // =================================================================== @@ -1495,7 +1541,7 @@ void AuthHeader::InternalSwap(AuthHeader* other) { ::PROTOBUF_NAMESPACE_ID::Metadata AuthHeader::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fcommon_2eproto[3]); + file_level_metadata_greptime_2fv1_2fcommon_2eproto[4]); } // =================================================================== @@ -1748,7 +1794,7 @@ void Basic::InternalSwap(Basic* other) { ::PROTOBUF_NAMESPACE_ID::Metadata Basic::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fcommon_2eproto[4]); + file_level_metadata_greptime_2fv1_2fcommon_2eproto[5]); } // =================================================================== @@ -1951,7 +1997,7 @@ void Token::InternalSwap(Token* other) { ::PROTOBUF_NAMESPACE_ID::Metadata Token::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fcommon_2eproto[5]); + file_level_metadata_greptime_2fv1_2fcommon_2eproto[6]); } // =================================================================== @@ -2129,7 +2175,7 @@ void AffectedRows::InternalSwap(AffectedRows* other) { ::PROTOBUF_NAMESPACE_ID::Metadata AffectedRows::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fcommon_2eproto[6]); + file_level_metadata_greptime_2fv1_2fcommon_2eproto[7]); } // =================================================================== @@ -2322,7 +2368,7 @@ void FlightMetadata::InternalSwap(FlightMetadata* other) { ::PROTOBUF_NAMESPACE_ID::Metadata FlightMetadata::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fcommon_2eproto[7]); + file_level_metadata_greptime_2fv1_2fcommon_2eproto[8]); } // =================================================================== @@ -2557,13 +2603,17 @@ void IntervalMonthDayNano::InternalSwap(IntervalMonthDayNano* other) { ::PROTOBUF_NAMESPACE_ID::Metadata IntervalMonthDayNano::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fcommon_2eproto[8]); + file_level_metadata_greptime_2fv1_2fcommon_2eproto[9]); } // @@protoc_insertion_point(namespace_scope) } // namespace v1 } // namespace greptime PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::greptime::v1::RequestHeader_TracingContextEntry_DoNotUse* +Arena::CreateMaybeMessage< ::greptime::v1::RequestHeader_TracingContextEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::greptime::v1::RequestHeader_TracingContextEntry_DoNotUse >(arena); +} template<> PROTOBUF_NOINLINE ::greptime::v1::RequestHeader* Arena::CreateMaybeMessage< ::greptime::v1::RequestHeader >(Arena* arena) { return Arena::CreateMessageInternal< ::greptime::v1::RequestHeader >(arena); diff --git a/c++/greptime/v1/common.pb.h b/c++/greptime/v1/common.pb.h index c0fe1d9b..8d139d47 100644 --- a/c++/greptime/v1/common.pb.h +++ b/c++/greptime/v1/common.pb.h @@ -29,6 +29,9 @@ #include #include // IWYU pragma: export #include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include #include #include // @@protoc_insertion_point(includes) @@ -65,6 +68,9 @@ extern IntervalMonthDayNanoDefaultTypeInternal _IntervalMonthDayNano_default_ins class RequestHeader; struct RequestHeaderDefaultTypeInternal; extern RequestHeaderDefaultTypeInternal _RequestHeader_default_instance_; +class RequestHeader_TracingContextEntry_DoNotUse; +struct RequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal; +extern RequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal _RequestHeader_TracingContextEntry_DoNotUse_default_instance_; class ResponseHeader; struct ResponseHeaderDefaultTypeInternal; extern ResponseHeaderDefaultTypeInternal _ResponseHeader_default_instance_; @@ -83,6 +89,7 @@ template<> ::greptime::v1::Basic* Arena::CreateMaybeMessage<::greptime::v1::Basi template<> ::greptime::v1::FlightMetadata* Arena::CreateMaybeMessage<::greptime::v1::FlightMetadata>(Arena*); template<> ::greptime::v1::IntervalMonthDayNano* Arena::CreateMaybeMessage<::greptime::v1::IntervalMonthDayNano>(Arena*); template<> ::greptime::v1::RequestHeader* Arena::CreateMaybeMessage<::greptime::v1::RequestHeader>(Arena*); +template<> ::greptime::v1::RequestHeader_TracingContextEntry_DoNotUse* Arena::CreateMaybeMessage<::greptime::v1::RequestHeader_TracingContextEntry_DoNotUse>(Arena*); template<> ::greptime::v1::ResponseHeader* Arena::CreateMaybeMessage<::greptime::v1::ResponseHeader>(Arena*); template<> ::greptime::v1::Status* Arena::CreateMaybeMessage<::greptime::v1::Status>(Arena*); template<> ::greptime::v1::Token* Arena::CreateMaybeMessage<::greptime::v1::Token>(Arena*); @@ -171,6 +178,34 @@ inline bool ColumnDataType_Parse( } // =================================================================== +class RequestHeader_TracingContextEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + RequestHeader_TracingContextEntry_DoNotUse(); + explicit PROTOBUF_CONSTEXPR RequestHeader_TracingContextEntry_DoNotUse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit RequestHeader_TracingContextEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const RequestHeader_TracingContextEntry_DoNotUse& other); + static const RequestHeader_TracingContextEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_RequestHeader_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.RequestHeader.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.RequestHeader.TracingContextEntry.value"); + } + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + friend struct ::TableStruct_greptime_2fv1_2fcommon_2eproto; +}; + +// ------------------------------------------------------------------- + class RequestHeader final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.RequestHeader) */ { public: @@ -219,7 +254,7 @@ class RequestHeader final : &_RequestHeader_default_instance_); } static constexpr int kIndexInFileMessages = - 0; + 1; friend void swap(RequestHeader& a, RequestHeader& b) { a.Swap(&b); @@ -280,6 +315,8 @@ class RequestHeader final : protected: explicit RequestHeader(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); + private: + static void ArenaDtor(void* object); public: static const ClassData _class_data_; @@ -289,16 +326,33 @@ class RequestHeader final : // nested types ---------------------------------------------------- + // accessors ------------------------------------------------------- enum : int { + kTracingContextFieldNumber = 5, kCatalogFieldNumber = 1, kSchemaFieldNumber = 2, kDbnameFieldNumber = 4, kAuthorizationFieldNumber = 3, - kTraceIdFieldNumber = 5, - kSpanIdFieldNumber = 6, }; + // map tracing_context = 5; + 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(); + // string catalog = 1; void clear_catalog(); const std::string& catalog() const; @@ -359,24 +413,6 @@ class RequestHeader final : ::greptime::v1::AuthHeader* authorization); ::greptime::v1::AuthHeader* unsafe_arena_release_authorization(); - // uint64 trace_id = 5; - void clear_trace_id(); - uint64_t trace_id() const; - void set_trace_id(uint64_t value); - private: - uint64_t _internal_trace_id() const; - void _internal_set_trace_id(uint64_t value); - public: - - // uint64 span_id = 6; - void clear_span_id(); - uint64_t span_id() const; - void set_span_id(uint64_t value); - private: - uint64_t _internal_span_id() const; - void _internal_set_span_id(uint64_t value); - public: - // @@protoc_insertion_point(class_scope:greptime.v1.RequestHeader) private: class _Internal; @@ -385,12 +421,15 @@ class RequestHeader final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + RequestHeader_TracingContextEntry_DoNotUse, + std::string, std::string, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING> tracing_context_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr catalog_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr schema_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr dbname_; ::greptime::v1::AuthHeader* authorization_; - uint64_t trace_id_; - uint64_t span_id_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; @@ -446,7 +485,7 @@ class ResponseHeader final : &_ResponseHeader_default_instance_); } static constexpr int kIndexInFileMessages = - 1; + 2; friend void swap(ResponseHeader& a, ResponseHeader& b) { a.Swap(&b); @@ -603,7 +642,7 @@ class Status final : &_Status_default_instance_); } static constexpr int kIndexInFileMessages = - 2; + 3; friend void swap(Status& a, Status& b) { a.Swap(&b); @@ -773,7 +812,7 @@ class AuthHeader final : &_AuthHeader_default_instance_); } static constexpr int kIndexInFileMessages = - 3; + 4; friend void swap(AuthHeader& a, AuthHeader& b) { a.Swap(&b); @@ -963,7 +1002,7 @@ class Basic final : &_Basic_default_instance_); } static constexpr int kIndexInFileMessages = - 4; + 5; friend void swap(Basic& a, Basic& b) { a.Swap(&b); @@ -1132,7 +1171,7 @@ class Token final : &_Token_default_instance_); } static constexpr int kIndexInFileMessages = - 5; + 6; friend void swap(Token& a, Token& b) { a.Swap(&b); @@ -1285,7 +1324,7 @@ class AffectedRows final : &_AffectedRows_default_instance_); } static constexpr int kIndexInFileMessages = - 6; + 7; friend void swap(AffectedRows& a, AffectedRows& b) { a.Swap(&b); @@ -1433,7 +1472,7 @@ class FlightMetadata final : &_FlightMetadata_default_instance_); } static constexpr int kIndexInFileMessages = - 7; + 8; friend void swap(FlightMetadata& a, FlightMetadata& b) { a.Swap(&b); @@ -1590,7 +1629,7 @@ class IntervalMonthDayNano final : &_IntervalMonthDayNano_default_instance_); } static constexpr int kIndexInFileMessages = - 8; + 9; friend void swap(IntervalMonthDayNano& a, IntervalMonthDayNano& b) { a.Swap(&b); @@ -1719,6 +1758,8 @@ class IntervalMonthDayNano final : #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ +// ------------------------------------------------------------------- + // RequestHeader // string catalog = 1; @@ -1961,44 +2002,33 @@ inline void RequestHeader::set_allocated_dbname(std::string* dbname) { // @@protoc_insertion_point(field_set_allocated:greptime.v1.RequestHeader.dbname) } -// uint64 trace_id = 5; -inline void RequestHeader::clear_trace_id() { - _impl_.trace_id_ = uint64_t{0u}; +// map tracing_context = 5; +inline int RequestHeader::_internal_tracing_context_size() const { + return _impl_.tracing_context_.size(); } -inline uint64_t RequestHeader::_internal_trace_id() const { - return _impl_.trace_id_; +inline int RequestHeader::tracing_context_size() const { + return _internal_tracing_context_size(); } -inline uint64_t RequestHeader::trace_id() const { - // @@protoc_insertion_point(field_get:greptime.v1.RequestHeader.trace_id) - return _internal_trace_id(); +inline void RequestHeader::clear_tracing_context() { + _impl_.tracing_context_.Clear(); } -inline void RequestHeader::_internal_set_trace_id(uint64_t value) { - - _impl_.trace_id_ = value; -} -inline void RequestHeader::set_trace_id(uint64_t value) { - _internal_set_trace_id(value); - // @@protoc_insertion_point(field_set:greptime.v1.RequestHeader.trace_id) +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& +RequestHeader::_internal_tracing_context() const { + return _impl_.tracing_context_.GetMap(); } - -// uint64 span_id = 6; -inline void RequestHeader::clear_span_id() { - _impl_.span_id_ = uint64_t{0u}; +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& +RequestHeader::tracing_context() const { + // @@protoc_insertion_point(field_map:greptime.v1.RequestHeader.tracing_context) + return _internal_tracing_context(); } -inline uint64_t RequestHeader::_internal_span_id() const { - return _impl_.span_id_; +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* +RequestHeader::_internal_mutable_tracing_context() { + return _impl_.tracing_context_.MutableMap(); } -inline uint64_t RequestHeader::span_id() const { - // @@protoc_insertion_point(field_get:greptime.v1.RequestHeader.span_id) - return _internal_span_id(); -} -inline void RequestHeader::_internal_set_span_id(uint64_t value) { - - _impl_.span_id_ = value; -} -inline void RequestHeader::set_span_id(uint64_t value) { - _internal_set_span_id(value); - // @@protoc_insertion_point(field_set:greptime.v1.RequestHeader.span_id) +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* +RequestHeader::mutable_tracing_context() { + // @@protoc_insertion_point(field_mutable_map:greptime.v1.RequestHeader.tracing_context) + return _internal_mutable_tracing_context(); } // ------------------------------------------------------------------- @@ -2689,6 +2719,8 @@ inline void IntervalMonthDayNano::set_nanoseconds(int64_t value) { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/c++/greptime/v1/meta/common.pb.cc b/c++/greptime/v1/meta/common.pb.cc index 1623b9b3..5415bb4f 100644 --- a/c++/greptime/v1/meta/common.pb.cc +++ b/c++/greptime/v1/meta/common.pb.cc @@ -23,9 +23,21 @@ namespace _pbi = _pb::internal; namespace greptime { namespace v1 { namespace meta { +PROTOBUF_CONSTEXPR RequestHeader_TracingContextEntry_DoNotUse::RequestHeader_TracingContextEntry_DoNotUse( + ::_pbi::ConstantInitialized) {} +struct RequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR RequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~RequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal() {} + union { + RequestHeader_TracingContextEntry_DoNotUse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal _RequestHeader_TracingContextEntry_DoNotUse_default_instance_; PROTOBUF_CONSTEXPR RequestHeader::RequestHeader( ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.protocol_version_)*/uint64_t{0u} + /*decltype(_impl_.tracing_context_)*/{::_pbi::ConstantInitialized()} + , /*decltype(_impl_.protocol_version_)*/uint64_t{0u} , /*decltype(_impl_.cluster_id_)*/uint64_t{0u} , /*decltype(_impl_.member_id_)*/uint64_t{0u} , /*decltype(_impl_.role_)*/0 @@ -141,11 +153,21 @@ 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_2fcommon_2eproto[8]; +static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[9]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2fmeta_2fcommon_2eproto[1]; static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fmeta_2fcommon_2eproto = nullptr; const uint32_t TableStruct_greptime_2fv1_2fmeta_2fcommon_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RequestHeader_TracingContextEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RequestHeader_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::RequestHeader_TracingContextEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RequestHeader_TracingContextEntry_DoNotUse, value_), + 0, + 1, ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RequestHeader, _internal_metadata_), ~0u, // no _extensions_ @@ -156,6 +178,7 @@ const uint32_t TableStruct_greptime_2fv1_2fmeta_2fcommon_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RequestHeader, _impl_.cluster_id_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RequestHeader, _impl_.member_id_), PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RequestHeader, _impl_.role_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::RequestHeader, _impl_.tracing_context_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::ResponseHeader, _internal_metadata_), ~0u, // no _extensions_ @@ -215,17 +238,19 @@ const uint32_t TableStruct_greptime_2fv1_2fmeta_2fcommon_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::greptime::v1::meta::KeyValue, _impl_.value_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, -1, sizeof(::greptime::v1::meta::RequestHeader)}, - { 10, -1, -1, sizeof(::greptime::v1::meta::ResponseHeader)}, - { 19, -1, -1, sizeof(::greptime::v1::meta::Error)}, - { 27, -1, -1, sizeof(::greptime::v1::meta::Peer)}, - { 35, -1, -1, sizeof(::greptime::v1::meta::TableId)}, - { 42, -1, -1, sizeof(::greptime::v1::meta::TableName)}, - { 51, -1, -1, sizeof(::greptime::v1::meta::TimeInterval)}, - { 59, -1, -1, sizeof(::greptime::v1::meta::KeyValue)}, + { 0, 8, -1, sizeof(::greptime::v1::meta::RequestHeader_TracingContextEntry_DoNotUse)}, + { 10, -1, -1, sizeof(::greptime::v1::meta::RequestHeader)}, + { 21, -1, -1, sizeof(::greptime::v1::meta::ResponseHeader)}, + { 30, -1, -1, sizeof(::greptime::v1::meta::Error)}, + { 38, -1, -1, sizeof(::greptime::v1::meta::Peer)}, + { 46, -1, -1, sizeof(::greptime::v1::meta::TableId)}, + { 53, -1, -1, sizeof(::greptime::v1::meta::TableName)}, + { 62, -1, -1, sizeof(::greptime::v1::meta::TimeInterval)}, + { 70, -1, -1, sizeof(::greptime::v1::meta::KeyValue)}, }; static const ::_pb::Message* const file_default_instances[] = { + &::greptime::v1::meta::_RequestHeader_TracingContextEntry_DoNotUse_default_instance_._instance, &::greptime::v1::meta::_RequestHeader_default_instance_._instance, &::greptime::v1::meta::_ResponseHeader_default_instance_._instance, &::greptime::v1::meta::_Error_default_instance_._instance, @@ -238,28 +263,32 @@ static const ::_pb::Message* const file_default_instances[] = { const char descriptor_table_protodef_greptime_2fv1_2fmeta_2fcommon_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = "\n\035greptime/v1/meta/common.proto\022\020greptim" - "e.v1.meta\"v\n\rRequestHeader\022\030\n\020protocol_v" - "ersion\030\001 \001(\004\022\022\n\ncluster_id\030\002 \001(\004\022\021\n\tmemb" - "er_id\030\003 \001(\004\022$\n\004role\030\004 \001(\0162\026.greptime.v1." - "meta.Role\"f\n\016ResponseHeader\022\030\n\020protocol_" - "version\030\001 \001(\004\022\022\n\ncluster_id\030\002 \001(\004\022&\n\005err" - "or\030\003 \001(\0132\027.greptime.v1.meta.Error\"&\n\005Err" - "or\022\014\n\004code\030\001 \001(\005\022\017\n\007err_msg\030\002 \001(\t\" \n\004Pee" - "r\022\n\n\002id\030\001 \001(\004\022\014\n\004addr\030\002 \001(\t\"\025\n\007TableId\022\n" - "\n\002id\030\001 \001(\r\"J\n\tTableName\022\024\n\014catalog_name\030" - "\001 \001(\t\022\023\n\013schema_name\030\002 \001(\t\022\022\n\ntable_name" - "\030\003 \001(\t\"L\n\014TimeInterval\022\036\n\026start_timestam" - "p_millis\030\001 \001(\003\022\034\n\024end_timestamp_millis\030\002" - " \001(\003\"&\n\010KeyValue\022\013\n\003key\030\001 \001(\014\022\r\n\005value\030\002" - " \001(\014*\"\n\004Role\022\014\n\010DATANODE\020\000\022\014\n\010FRONTEND\020\001" - "BOwnCustomDestructor(this, &RequestHeader::ArenaDtor); + } // @@protoc_insertion_point(arena_constructor:greptime.v1.meta.RequestHeader) } RequestHeader::RequestHeader(const RequestHeader& from) : ::PROTOBUF_NAMESPACE_ID::Message() { RequestHeader* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.protocol_version_){} + /*decltype(_impl_.tracing_context_)*/{} + , decltype(_impl_.protocol_version_){} , decltype(_impl_.cluster_id_){} , decltype(_impl_.member_id_){} , decltype(_impl_.role_){} , /*decltype(_impl_._cached_size_)*/{}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.tracing_context_.MergeFrom(from._impl_.tracing_context_); ::memcpy(&_impl_.protocol_version_, &from._impl_.protocol_version_, static_cast(reinterpret_cast(&_impl_.role_) - reinterpret_cast(&_impl_.protocol_version_)) + sizeof(_impl_.role_)); @@ -322,7 +370,8 @@ inline void RequestHeader::SharedCtor( (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.protocol_version_){uint64_t{0u}} + /*decltype(_impl_.tracing_context_)*/{::_pbi::ArenaInitialized(), arena} + , decltype(_impl_.protocol_version_){uint64_t{0u}} , decltype(_impl_.cluster_id_){uint64_t{0u}} , decltype(_impl_.member_id_){uint64_t{0u}} , decltype(_impl_.role_){0} @@ -334,6 +383,7 @@ RequestHeader::~RequestHeader() { // @@protoc_insertion_point(destructor:greptime.v1.meta.RequestHeader) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; + ArenaDtor(this); return; } SharedDtor(); @@ -341,8 +391,14 @@ RequestHeader::~RequestHeader() { inline void RequestHeader::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.tracing_context_.Destruct(); + _impl_.tracing_context_.~MapField(); } +void RequestHeader::ArenaDtor(void* object) { + RequestHeader* _this = reinterpret_cast< RequestHeader* >(object); + _this->_impl_.tracing_context_.Destruct(); +} void RequestHeader::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } @@ -353,6 +409,7 @@ void RequestHeader::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + _impl_.tracing_context_.Clear(); ::memset(&_impl_.protocol_version_, 0, static_cast( reinterpret_cast(&_impl_.role_) - reinterpret_cast(&_impl_.protocol_version_)) + sizeof(_impl_.role_)); @@ -398,6 +455,19 @@ const char* RequestHeader::_InternalParse(const char* ptr, ::_pbi::ParseContext* } else goto handle_unusual; continue; + // map tracing_context = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + 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<42>(ptr)); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -452,6 +522,36 @@ uint8_t* RequestHeader::_InternalSerialize( 4, this->_internal_role(), target); } + // map tracing_context = 5; + if (!this->_internal_tracing_context().empty()) { + using MapType = ::_pb::Map; + using WireHelper = RequestHeader_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.RequestHeader.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.RequestHeader.TracingContextEntry.value"); + }; + + if (stream->IsSerializationDeterministic() && map_field.size() > 1) { + for (const auto& entry : ::_pbi::MapSorterPtr(map_field)) { + target = WireHelper::InternalSerialize(5, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } else { + for (const auto& entry : map_field) { + target = WireHelper::InternalSerialize(5, 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); @@ -468,6 +568,15 @@ size_t RequestHeader::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + // map tracing_context = 5; + 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 += RequestHeader_TracingContextEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + // uint64 protocol_version = 1; if (this->_internal_protocol_version() != 0) { total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_protocol_version()); @@ -507,6 +616,7 @@ void RequestHeader::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const :: uint32_t cached_has_bits = 0; (void) cached_has_bits; + _this->_impl_.tracing_context_.MergeFrom(from._impl_.tracing_context_); if (from._internal_protocol_version() != 0) { _this->_internal_set_protocol_version(from._internal_protocol_version()); } @@ -536,6 +646,7 @@ bool RequestHeader::IsInitialized() const { void RequestHeader::InternalSwap(RequestHeader* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.tracing_context_.InternalSwap(&other->_impl_.tracing_context_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< PROTOBUF_FIELD_OFFSET(RequestHeader, _impl_.role_) + sizeof(RequestHeader::_impl_.role_) @@ -547,7 +658,7 @@ void RequestHeader::InternalSwap(RequestHeader* other) { ::PROTOBUF_NAMESPACE_ID::Metadata RequestHeader::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[0]); + file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[1]); } // =================================================================== @@ -799,7 +910,7 @@ void ResponseHeader::InternalSwap(ResponseHeader* other) { ::PROTOBUF_NAMESPACE_ID::Metadata ResponseHeader::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[1]); + file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[2]); } // =================================================================== @@ -1029,7 +1140,7 @@ void Error::InternalSwap(Error* other) { ::PROTOBUF_NAMESPACE_ID::Metadata Error::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[2]); + file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[3]); } // =================================================================== @@ -1259,7 +1370,7 @@ void Peer::InternalSwap(Peer* other) { ::PROTOBUF_NAMESPACE_ID::Metadata Peer::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[3]); + file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[4]); } // =================================================================== @@ -1437,7 +1548,7 @@ void TableId::InternalSwap(TableId* other) { ::PROTOBUF_NAMESPACE_ID::Metadata TableId::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[4]); + file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[5]); } // =================================================================== @@ -1740,7 +1851,7 @@ void TableName::InternalSwap(TableName* other) { ::PROTOBUF_NAMESPACE_ID::Metadata TableName::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[5]); + file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[6]); } // =================================================================== @@ -1951,7 +2062,7 @@ void TimeInterval::InternalSwap(TimeInterval* other) { ::PROTOBUF_NAMESPACE_ID::Metadata TimeInterval::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[6]); + file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[7]); } // =================================================================== @@ -2194,7 +2305,7 @@ void KeyValue::InternalSwap(KeyValue* other) { ::PROTOBUF_NAMESPACE_ID::Metadata KeyValue::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_getter, &descriptor_table_greptime_2fv1_2fmeta_2fcommon_2eproto_once, - file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[7]); + file_level_metadata_greptime_2fv1_2fmeta_2fcommon_2eproto[8]); } // @@protoc_insertion_point(namespace_scope) @@ -2202,6 +2313,10 @@ ::PROTOBUF_NAMESPACE_ID::Metadata KeyValue::GetMetadata() const { } // namespace v1 } // namespace greptime PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::greptime::v1::meta::RequestHeader_TracingContextEntry_DoNotUse* +Arena::CreateMaybeMessage< ::greptime::v1::meta::RequestHeader_TracingContextEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::greptime::v1::meta::RequestHeader_TracingContextEntry_DoNotUse >(arena); +} template<> PROTOBUF_NOINLINE ::greptime::v1::meta::RequestHeader* Arena::CreateMaybeMessage< ::greptime::v1::meta::RequestHeader >(Arena* arena) { return Arena::CreateMessageInternal< ::greptime::v1::meta::RequestHeader >(arena); diff --git a/c++/greptime/v1/meta/common.pb.h b/c++/greptime/v1/meta/common.pb.h index 8d99f882..ae3a05ad 100644 --- a/c++/greptime/v1/meta/common.pb.h +++ b/c++/greptime/v1/meta/common.pb.h @@ -29,6 +29,9 @@ #include #include // IWYU pragma: export #include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include #include #include // @@protoc_insertion_point(includes) @@ -60,6 +63,9 @@ extern PeerDefaultTypeInternal _Peer_default_instance_; class RequestHeader; struct RequestHeaderDefaultTypeInternal; extern RequestHeaderDefaultTypeInternal _RequestHeader_default_instance_; +class RequestHeader_TracingContextEntry_DoNotUse; +struct RequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal; +extern RequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal _RequestHeader_TracingContextEntry_DoNotUse_default_instance_; class ResponseHeader; struct ResponseHeaderDefaultTypeInternal; extern ResponseHeaderDefaultTypeInternal _ResponseHeader_default_instance_; @@ -80,6 +86,7 @@ template<> ::greptime::v1::meta::Error* Arena::CreateMaybeMessage<::greptime::v1 template<> ::greptime::v1::meta::KeyValue* Arena::CreateMaybeMessage<::greptime::v1::meta::KeyValue>(Arena*); template<> ::greptime::v1::meta::Peer* Arena::CreateMaybeMessage<::greptime::v1::meta::Peer>(Arena*); template<> ::greptime::v1::meta::RequestHeader* Arena::CreateMaybeMessage<::greptime::v1::meta::RequestHeader>(Arena*); +template<> ::greptime::v1::meta::RequestHeader_TracingContextEntry_DoNotUse* Arena::CreateMaybeMessage<::greptime::v1::meta::RequestHeader_TracingContextEntry_DoNotUse>(Arena*); template<> ::greptime::v1::meta::ResponseHeader* Arena::CreateMaybeMessage<::greptime::v1::meta::ResponseHeader>(Arena*); template<> ::greptime::v1::meta::TableId* Arena::CreateMaybeMessage<::greptime::v1::meta::TableId>(Arena*); template<> ::greptime::v1::meta::TableName* Arena::CreateMaybeMessage<::greptime::v1::meta::TableName>(Arena*); @@ -116,6 +123,34 @@ inline bool Role_Parse( } // =================================================================== +class RequestHeader_TracingContextEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + RequestHeader_TracingContextEntry_DoNotUse(); + explicit PROTOBUF_CONSTEXPR RequestHeader_TracingContextEntry_DoNotUse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit RequestHeader_TracingContextEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const RequestHeader_TracingContextEntry_DoNotUse& other); + static const RequestHeader_TracingContextEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_RequestHeader_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.RequestHeader.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.RequestHeader.TracingContextEntry.value"); + } + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + friend struct ::TableStruct_greptime_2fv1_2fmeta_2fcommon_2eproto; +}; + +// ------------------------------------------------------------------- + class RequestHeader final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.meta.RequestHeader) */ { public: @@ -164,7 +199,7 @@ class RequestHeader final : &_RequestHeader_default_instance_); } static constexpr int kIndexInFileMessages = - 0; + 1; friend void swap(RequestHeader& a, RequestHeader& b) { a.Swap(&b); @@ -225,6 +260,8 @@ class RequestHeader final : protected: explicit RequestHeader(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); + private: + static void ArenaDtor(void* object); public: static const ClassData _class_data_; @@ -234,14 +271,33 @@ class RequestHeader final : // nested types ---------------------------------------------------- + // accessors ------------------------------------------------------- enum : int { + kTracingContextFieldNumber = 5, kProtocolVersionFieldNumber = 1, kClusterIdFieldNumber = 2, kMemberIdFieldNumber = 3, kRoleFieldNumber = 4, }; + // map tracing_context = 5; + 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(); + // uint64 protocol_version = 1; void clear_protocol_version(); uint64_t protocol_version() const; @@ -286,6 +342,11 @@ class RequestHeader final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + RequestHeader_TracingContextEntry_DoNotUse, + std::string, std::string, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING> tracing_context_; uint64_t protocol_version_; uint64_t cluster_id_; uint64_t member_id_; @@ -345,7 +406,7 @@ class ResponseHeader final : &_ResponseHeader_default_instance_); } static constexpr int kIndexInFileMessages = - 1; + 2; friend void swap(ResponseHeader& a, ResponseHeader& b) { a.Swap(&b); @@ -524,7 +585,7 @@ class Error final : &_Error_default_instance_); } static constexpr int kIndexInFileMessages = - 2; + 3; friend void swap(Error& a, Error& b) { a.Swap(&b); @@ -688,7 +749,7 @@ class Peer final : &_Peer_default_instance_); } static constexpr int kIndexInFileMessages = - 3; + 4; friend void swap(Peer& a, Peer& b) { a.Swap(&b); @@ -852,7 +913,7 @@ class TableId final : &_TableId_default_instance_); } static constexpr int kIndexInFileMessages = - 4; + 5; friend void swap(TableId& a, TableId& b) { a.Swap(&b); @@ -1000,7 +1061,7 @@ class TableName final : &_TableName_default_instance_); } static constexpr int kIndexInFileMessages = - 5; + 6; friend void swap(TableName& a, TableName& b) { a.Swap(&b); @@ -1185,7 +1246,7 @@ class TimeInterval final : &_TimeInterval_default_instance_); } static constexpr int kIndexInFileMessages = - 6; + 7; friend void swap(TimeInterval& a, TimeInterval& b) { a.Swap(&b); @@ -1344,7 +1405,7 @@ class KeyValue final : &_KeyValue_default_instance_); } static constexpr int kIndexInFileMessages = - 7; + 8; friend void swap(KeyValue& a, KeyValue& b) { a.Swap(&b); @@ -1472,6 +1533,8 @@ class KeyValue final : #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ +// ------------------------------------------------------------------- + // RequestHeader // uint64 protocol_version = 1; @@ -1554,6 +1617,35 @@ inline void RequestHeader::set_role(::greptime::v1::meta::Role value) { // @@protoc_insertion_point(field_set:greptime.v1.meta.RequestHeader.role) } +// map tracing_context = 5; +inline int RequestHeader::_internal_tracing_context_size() const { + return _impl_.tracing_context_.size(); +} +inline int RequestHeader::tracing_context_size() const { + return _internal_tracing_context_size(); +} +inline void RequestHeader::clear_tracing_context() { + _impl_.tracing_context_.Clear(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& +RequestHeader::_internal_tracing_context() const { + return _impl_.tracing_context_.GetMap(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& +RequestHeader::tracing_context() const { + // @@protoc_insertion_point(field_map:greptime.v1.meta.RequestHeader.tracing_context) + return _internal_tracing_context(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* +RequestHeader::_internal_mutable_tracing_context() { + return _impl_.tracing_context_.MutableMap(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* +RequestHeader::mutable_tracing_context() { + // @@protoc_insertion_point(field_mutable_map:greptime.v1.meta.RequestHeader.tracing_context) + return _internal_mutable_tracing_context(); +} + // ------------------------------------------------------------------- // ResponseHeader @@ -2179,6 +2271,8 @@ inline void KeyValue::set_allocated_value(std::string* value) { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/c++/greptime/v1/region/server.pb.cc b/c++/greptime/v1/region/server.pb.cc index 7bc17c7d..f6d9a8ac 100644 --- a/c++/greptime/v1/region/server.pb.cc +++ b/c++/greptime/v1/region/server.pb.cc @@ -23,11 +23,21 @@ namespace _pbi = _pb::internal; namespace greptime { namespace v1 { namespace region { +PROTOBUF_CONSTEXPR RegionRequestHeader_TracingContextEntry_DoNotUse::RegionRequestHeader_TracingContextEntry_DoNotUse( + ::_pbi::ConstantInitialized) {} +struct RegionRequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR RegionRequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~RegionRequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal() {} + union { + RegionRequestHeader_TracingContextEntry_DoNotUse _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RegionRequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal _RegionRequestHeader_TracingContextEntry_DoNotUse_default_instance_; PROTOBUF_CONSTEXPR RegionRequestHeader::RegionRequestHeader( ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.dbname_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.trace_id_)*/uint64_t{0u} - , /*decltype(_impl_.span_id_)*/uint64_t{0u} + /*decltype(_impl_.tracing_context_)*/{::_pbi::ConstantInitialized()} + , /*decltype(_impl_.dbname_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_._cached_size_)*/{}} {} struct RegionRequestHeaderDefaultTypeInternal { PROTOBUF_CONSTEXPR RegionRequestHeaderDefaultTypeInternal() @@ -344,19 +354,28 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORIT } // namespace region } // namespace v1 } // namespace greptime -static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[23]; +static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[24]; static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_greptime_2fv1_2fregion_2fserver_2eproto = nullptr; static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fregion_2fserver_2eproto = nullptr; const uint32_t TableStruct_greptime_2fv1_2fregion_2fserver_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::greptime::v1::region::RegionRequestHeader_TracingContextEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::region::RegionRequestHeader_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::region::RegionRequestHeader_TracingContextEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::region::RegionRequestHeader_TracingContextEntry_DoNotUse, value_), + 0, + 1, ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::region::RegionRequestHeader, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::greptime::v1::region::RegionRequestHeader, _impl_.trace_id_), - PROTOBUF_FIELD_OFFSET(::greptime::v1::region::RegionRequestHeader, _impl_.span_id_), + PROTOBUF_FIELD_OFFSET(::greptime::v1::region::RegionRequestHeader, _impl_.tracing_context_), PROTOBUF_FIELD_OFFSET(::greptime::v1::region::RegionRequestHeader, _impl_.dbname_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::greptime::v1::region::RegionRequest, _internal_metadata_), @@ -550,32 +569,34 @@ const uint32_t TableStruct_greptime_2fv1_2fregion_2fserver_2eproto::offsets[] PR PROTOBUF_FIELD_OFFSET(::greptime::v1::region::RegionColumnDef, _impl_.column_id_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, -1, sizeof(::greptime::v1::region::RegionRequestHeader)}, - { 9, -1, -1, sizeof(::greptime::v1::region::RegionRequest)}, - { 27, -1, -1, sizeof(::greptime::v1::region::RegionResponse)}, - { 35, -1, -1, sizeof(::greptime::v1::region::InsertRequests)}, - { 42, -1, -1, sizeof(::greptime::v1::region::DeleteRequests)}, - { 49, -1, -1, sizeof(::greptime::v1::region::InsertRequest)}, - { 57, -1, -1, sizeof(::greptime::v1::region::DeleteRequest)}, - { 65, -1, -1, sizeof(::greptime::v1::region::QueryRequest)}, - { 74, 82, -1, sizeof(::greptime::v1::region::CreateRequest_OptionsEntry_DoNotUse)}, - { 84, -1, -1, sizeof(::greptime::v1::region::CreateRequest)}, - { 96, -1, -1, sizeof(::greptime::v1::region::DropRequest)}, - { 103, 111, -1, sizeof(::greptime::v1::region::OpenRequest_OptionsEntry_DoNotUse)}, - { 113, -1, -1, sizeof(::greptime::v1::region::OpenRequest)}, - { 123, -1, -1, sizeof(::greptime::v1::region::CloseRequest)}, - { 130, -1, -1, sizeof(::greptime::v1::region::AlterRequest)}, - { 141, -1, -1, sizeof(::greptime::v1::region::AddColumns)}, - { 148, -1, -1, sizeof(::greptime::v1::region::DropColumns)}, - { 155, -1, -1, sizeof(::greptime::v1::region::AddColumn)}, - { 163, -1, -1, sizeof(::greptime::v1::region::DropColumn)}, - { 170, -1, -1, sizeof(::greptime::v1::region::FlushRequest)}, - { 177, -1, -1, sizeof(::greptime::v1::region::CompactRequest)}, - { 184, -1, -1, sizeof(::greptime::v1::region::TruncateRequest)}, - { 191, -1, -1, sizeof(::greptime::v1::region::RegionColumnDef)}, + { 0, 8, -1, sizeof(::greptime::v1::region::RegionRequestHeader_TracingContextEntry_DoNotUse)}, + { 10, -1, -1, sizeof(::greptime::v1::region::RegionRequestHeader)}, + { 18, -1, -1, sizeof(::greptime::v1::region::RegionRequest)}, + { 36, -1, -1, sizeof(::greptime::v1::region::RegionResponse)}, + { 44, -1, -1, sizeof(::greptime::v1::region::InsertRequests)}, + { 51, -1, -1, sizeof(::greptime::v1::region::DeleteRequests)}, + { 58, -1, -1, sizeof(::greptime::v1::region::InsertRequest)}, + { 66, -1, -1, sizeof(::greptime::v1::region::DeleteRequest)}, + { 74, -1, -1, sizeof(::greptime::v1::region::QueryRequest)}, + { 83, 91, -1, sizeof(::greptime::v1::region::CreateRequest_OptionsEntry_DoNotUse)}, + { 93, -1, -1, sizeof(::greptime::v1::region::CreateRequest)}, + { 105, -1, -1, sizeof(::greptime::v1::region::DropRequest)}, + { 112, 120, -1, sizeof(::greptime::v1::region::OpenRequest_OptionsEntry_DoNotUse)}, + { 122, -1, -1, sizeof(::greptime::v1::region::OpenRequest)}, + { 132, -1, -1, sizeof(::greptime::v1::region::CloseRequest)}, + { 139, -1, -1, sizeof(::greptime::v1::region::AlterRequest)}, + { 150, -1, -1, sizeof(::greptime::v1::region::AddColumns)}, + { 157, -1, -1, sizeof(::greptime::v1::region::DropColumns)}, + { 164, -1, -1, sizeof(::greptime::v1::region::AddColumn)}, + { 172, -1, -1, sizeof(::greptime::v1::region::DropColumn)}, + { 179, -1, -1, sizeof(::greptime::v1::region::FlushRequest)}, + { 186, -1, -1, sizeof(::greptime::v1::region::CompactRequest)}, + { 193, -1, -1, sizeof(::greptime::v1::region::TruncateRequest)}, + { 200, -1, -1, sizeof(::greptime::v1::region::RegionColumnDef)}, }; static const ::_pb::Message* const file_default_instances[] = { + &::greptime::v1::region::_RegionRequestHeader_TracingContextEntry_DoNotUse_default_instance_._instance, &::greptime::v1::region::_RegionRequestHeader_default_instance_._instance, &::greptime::v1::region::_RegionRequest_default_instance_._instance, &::greptime::v1::region::_RegionResponse_default_instance_._instance, @@ -605,69 +626,72 @@ const char descriptor_table_protodef_greptime_2fv1_2fregion_2fserver_2eproto[] P "\n\037greptime/v1/region/server.proto\022\022grept" "ime.v1.region\032\030greptime/v1/common.proto\032" "\025greptime/v1/row.proto\032\025greptime/v1/ddl." - "proto\"H\n\023RegionRequestHeader\022\020\n\010trace_id" - "\030\001 \001(\004\022\017\n\007span_id\030\002 \001(\004\022\016\n\006dbname\030\003 \001(\t\"" - "\336\004\n\rRegionRequest\0227\n\006header\030\001 \001(\0132\'.grep" - "time.v1.region.RegionRequestHeader\0225\n\007in" - "serts\030\003 \001(\0132\".greptime.v1.region.InsertR" - "equestsH\000\0225\n\007deletes\030\004 \001(\0132\".greptime.v1" - ".region.DeleteRequestsH\000\0223\n\006create\030\005 \001(\013" - "2!.greptime.v1.region.CreateRequestH\000\022/\n" - "\004drop\030\006 \001(\0132\037.greptime.v1.region.DropReq" - "uestH\000\022/\n\004open\030\007 \001(\0132\037.greptime.v1.regio" - "n.OpenRequestH\000\0221\n\005close\030\010 \001(\0132 .greptim" - "e.v1.region.CloseRequestH\000\0221\n\005alter\030\t \001(" - "\0132 .greptime.v1.region.AlterRequestH\000\0221\n" - "\005flush\030\n \001(\0132 .greptime.v1.region.FlushR" - "equestH\000\0225\n\007compact\030\013 \001(\0132\".greptime.v1." - "region.CompactRequestH\000\0227\n\010truncate\030\014 \001(" - "\0132#.greptime.v1.region.TruncateRequestH\000" - "B\006\n\004body\"T\n\016RegionResponse\022+\n\006header\030\001 \001" - "(\0132\033.greptime.v1.ResponseHeader\022\025\n\raffec" - "ted_rows\030\002 \001(\004\"E\n\016InsertRequests\0223\n\010requ" - "ests\030\001 \003(\0132!.greptime.v1.region.InsertRe" - "quest\"E\n\016DeleteRequests\0223\n\010requests\030\001 \003(" - "\0132!.greptime.v1.region.DeleteRequest\"C\n\r" - "InsertRequest\022\021\n\tregion_id\030\001 \001(\004\022\037\n\004rows" - "\030\002 \001(\0132\021.greptime.v1.Rows\"C\n\rDeleteReque" - "st\022\021\n\tregion_id\030\001 \001(\004\022\037\n\004rows\030\002 \001(\0132\021.gr" - "eptime.v1.Rows\"h\n\014QueryRequest\0227\n\006header" - "\030\001 \001(\0132\'.greptime.v1.region.RegionReques" - "tHeader\022\021\n\tregion_id\030\002 \001(\004\022\014\n\004plan\030\003 \001(\014" - "\"\200\002\n\rCreateRequest\022\021\n\tregion_id\030\001 \001(\004\022\016\n" - "\006engine\030\002 \001(\t\0228\n\013column_defs\030\003 \003(\0132#.gre" - "ptime.v1.region.RegionColumnDef\022\023\n\013prima" - "ry_key\030\004 \003(\r\022\014\n\004path\030\005 \001(\t\022\?\n\007options\030\006 " - "\003(\0132..greptime.v1.region.CreateRequest.O" - "ptionsEntry\032.\n\014OptionsEntry\022\013\n\003key\030\001 \001(\t" - "\022\r\n\005value\030\002 \001(\t:\0028\001\" \n\013DropRequest\022\021\n\tre" - "gion_id\030\001 \001(\004\"\255\001\n\013OpenRequest\022\021\n\tregion_" - "id\030\001 \001(\004\022\016\n\006engine\030\002 \001(\t\022\014\n\004path\030\003 \001(\t\022=" - "\n\007options\030\004 \003(\0132,.greptime.v1.region.Ope" - "nRequest.OptionsEntry\032.\n\014OptionsEntry\022\013\n" - "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"!\n\014CloseRe" - "quest\022\021\n\tregion_id\030\001 \001(\004\"\261\001\n\014AlterReques" - "t\022\021\n\tregion_id\030\001 \001(\004\0225\n\013add_columns\030\002 \001(" - "\0132\036.greptime.v1.region.AddColumnsH\000\0227\n\014d" - "rop_columns\030\003 \001(\0132\037.greptime.v1.region.D" - "ropColumnsH\000\022\026\n\016schema_version\030\004 \001(\004B\006\n\004" - "kind\"@\n\nAddColumns\0222\n\013add_columns\030\001 \003(\0132" - "\035.greptime.v1.region.AddColumn\"C\n\013DropCo" - "lumns\0224\n\014drop_columns\030\001 \003(\0132\036.greptime.v" - "1.region.DropColumn\"v\n\tAddColumn\0227\n\ncolu" - "mn_def\030\001 \001(\0132#.greptime.v1.region.Region" - "ColumnDef\0220\n\010location\030\003 \001(\0132\036.greptime.v" - "1.AddColumnLocation\"\032\n\nDropColumn\022\014\n\004nam" - "e\030\001 \001(\t\"!\n\014FlushRequest\022\021\n\tregion_id\030\001 \001" - "(\004\"#\n\016CompactRequest\022\021\n\tregion_id\030\001 \001(\004\"" - "$\n\017TruncateRequest\022\021\n\tregion_id\030\001 \001(\004\"P\n" - "\017RegionColumnDef\022*\n\ncolumn_def\030\001 \001(\0132\026.g" - "reptime.v1.ColumnDef\022\021\n\tcolumn_id\030\002 \001(\r2" - "Y\n\006Region\022O\n\006Handle\022!.greptime.v1.region" - ".RegionRequest\032\".greptime.v1.region.Regi" - "onResponseB]\n\025io.greptime.v1.regionB\006Ser" - "verZOwnCustomDestructor(this, &RegionRequestHeader::ArenaDtor); + } // @@protoc_insertion_point(arena_constructor:greptime.v1.region.RegionRequestHeader) } RegionRequestHeader::RegionRequestHeader(const RegionRequestHeader& from) : ::PROTOBUF_NAMESPACE_ID::Message() { RegionRequestHeader* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.dbname_){} - , decltype(_impl_.trace_id_){} - , decltype(_impl_.span_id_){} + /*decltype(_impl_.tracing_context_)*/{} + , decltype(_impl_.dbname_){} , /*decltype(_impl_._cached_size_)*/{}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.tracing_context_.MergeFrom(from._impl_.tracing_context_); _impl_.dbname_.InitDefault(); #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING _impl_.dbname_.Set("", GetArenaForAllocation()); @@ -723,9 +764,6 @@ RegionRequestHeader::RegionRequestHeader(const RegionRequestHeader& from) _this->_impl_.dbname_.Set(from._internal_dbname(), _this->GetArenaForAllocation()); } - ::memcpy(&_impl_.trace_id_, &from._impl_.trace_id_, - static_cast(reinterpret_cast(&_impl_.span_id_) - - reinterpret_cast(&_impl_.trace_id_)) + sizeof(_impl_.span_id_)); // @@protoc_insertion_point(copy_constructor:greptime.v1.region.RegionRequestHeader) } @@ -734,9 +772,8 @@ inline void RegionRequestHeader::SharedCtor( (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.dbname_){} - , decltype(_impl_.trace_id_){uint64_t{0u}} - , decltype(_impl_.span_id_){uint64_t{0u}} + /*decltype(_impl_.tracing_context_)*/{::_pbi::ArenaInitialized(), arena} + , decltype(_impl_.dbname_){} , /*decltype(_impl_._cached_size_)*/{} }; _impl_.dbname_.InitDefault(); @@ -749,6 +786,7 @@ RegionRequestHeader::~RegionRequestHeader() { // @@protoc_insertion_point(destructor:greptime.v1.region.RegionRequestHeader) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; + ArenaDtor(this); return; } SharedDtor(); @@ -756,9 +794,15 @@ RegionRequestHeader::~RegionRequestHeader() { inline void RegionRequestHeader::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.tracing_context_.Destruct(); + _impl_.tracing_context_.~MapField(); _impl_.dbname_.Destroy(); } +void RegionRequestHeader::ArenaDtor(void* object) { + RegionRequestHeader* _this = reinterpret_cast< RegionRequestHeader* >(object); + _this->_impl_.tracing_context_.Destruct(); +} void RegionRequestHeader::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } @@ -769,10 +813,8 @@ void RegionRequestHeader::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + _impl_.tracing_context_.Clear(); _impl_.dbname_.ClearToEmpty(); - ::memset(&_impl_.trace_id_, 0, static_cast( - reinterpret_cast(&_impl_.span_id_) - - reinterpret_cast(&_impl_.trace_id_)) + sizeof(_impl_.span_id_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -782,22 +824,6 @@ const char* RegionRequestHeader::_InternalParse(const char* ptr, ::_pbi::ParseCo uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // uint64 trace_id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _impl_.trace_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; - // uint64 span_id = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _impl_.span_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; // string dbname = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { @@ -808,6 +834,19 @@ const char* RegionRequestHeader::_InternalParse(const char* ptr, ::_pbi::ParseCo } else goto handle_unusual; continue; + // map tracing_context = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + 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<42>(ptr)); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -837,18 +876,6 @@ uint8_t* RegionRequestHeader::_InternalSerialize( uint32_t cached_has_bits = 0; (void) cached_has_bits; - // uint64 trace_id = 1; - if (this->_internal_trace_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_trace_id(), target); - } - - // uint64 span_id = 2; - if (this->_internal_span_id() != 0) { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_span_id(), target); - } - // string dbname = 3; if (!this->_internal_dbname().empty()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( @@ -859,6 +886,36 @@ uint8_t* RegionRequestHeader::_InternalSerialize( 3, this->_internal_dbname(), target); } + // map tracing_context = 5; + if (!this->_internal_tracing_context().empty()) { + using MapType = ::_pb::Map; + using WireHelper = RegionRequestHeader_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.region.RegionRequestHeader.TracingContextEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + entry.second.data(), static_cast(entry.second.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "greptime.v1.region.RegionRequestHeader.TracingContextEntry.value"); + }; + + if (stream->IsSerializationDeterministic() && map_field.size() > 1) { + for (const auto& entry : ::_pbi::MapSorterPtr(map_field)) { + target = WireHelper::InternalSerialize(5, entry.first, entry.second, target, stream); + check_utf8(entry); + } + } else { + for (const auto& entry : map_field) { + target = WireHelper::InternalSerialize(5, 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); @@ -875,6 +932,15 @@ size_t RegionRequestHeader::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + // map tracing_context = 5; + 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 += RegionRequestHeader_TracingContextEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + // string dbname = 3; if (!this->_internal_dbname().empty()) { total_size += 1 + @@ -882,16 +948,6 @@ size_t RegionRequestHeader::ByteSizeLong() const { this->_internal_dbname()); } - // uint64 trace_id = 1; - if (this->_internal_trace_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_trace_id()); - } - - // uint64 span_id = 2; - if (this->_internal_span_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_span_id()); - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -910,15 +966,10 @@ void RegionRequestHeader::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, co uint32_t cached_has_bits = 0; (void) cached_has_bits; + _this->_impl_.tracing_context_.MergeFrom(from._impl_.tracing_context_); if (!from._internal_dbname().empty()) { _this->_internal_set_dbname(from._internal_dbname()); } - if (from._internal_trace_id() != 0) { - _this->_internal_set_trace_id(from._internal_trace_id()); - } - if (from._internal_span_id() != 0) { - _this->_internal_set_span_id(from._internal_span_id()); - } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -938,22 +989,17 @@ void RegionRequestHeader::InternalSwap(RegionRequestHeader* other) { auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.tracing_context_.InternalSwap(&other->_impl_.tracing_context_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( &_impl_.dbname_, lhs_arena, &other->_impl_.dbname_, rhs_arena ); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(RegionRequestHeader, _impl_.span_id_) - + sizeof(RegionRequestHeader::_impl_.span_id_) - - PROTOBUF_FIELD_OFFSET(RegionRequestHeader, _impl_.trace_id_)>( - reinterpret_cast(&_impl_.trace_id_), - reinterpret_cast(&other->_impl_.trace_id_)); } ::PROTOBUF_NAMESPACE_ID::Metadata RegionRequestHeader::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[0]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[1]); } // =================================================================== @@ -1764,7 +1810,7 @@ void RegionRequest::InternalSwap(RegionRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata RegionRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[1]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[2]); } // =================================================================== @@ -1994,7 +2040,7 @@ void RegionResponse::InternalSwap(RegionResponse* other) { ::PROTOBUF_NAMESPACE_ID::Metadata RegionResponse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[2]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[3]); } // =================================================================== @@ -2179,7 +2225,7 @@ void InsertRequests::InternalSwap(InsertRequests* other) { ::PROTOBUF_NAMESPACE_ID::Metadata InsertRequests::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[3]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[4]); } // =================================================================== @@ -2364,7 +2410,7 @@ void DeleteRequests::InternalSwap(DeleteRequests* other) { ::PROTOBUF_NAMESPACE_ID::Metadata DeleteRequests::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[4]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[5]); } // =================================================================== @@ -2594,7 +2640,7 @@ void InsertRequest::InternalSwap(InsertRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata InsertRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[5]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[6]); } // =================================================================== @@ -2824,7 +2870,7 @@ void DeleteRequest::InternalSwap(DeleteRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata DeleteRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[6]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[7]); } // =================================================================== @@ -3095,7 +3141,7 @@ void QueryRequest::InternalSwap(QueryRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata QueryRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[7]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[8]); } // =================================================================== @@ -3109,7 +3155,7 @@ void CreateRequest_OptionsEntry_DoNotUse::MergeFrom(const CreateRequest_OptionsE ::PROTOBUF_NAMESPACE_ID::Metadata CreateRequest_OptionsEntry_DoNotUse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[8]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[9]); } // =================================================================== @@ -3533,7 +3579,7 @@ void CreateRequest::InternalSwap(CreateRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata CreateRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[9]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[10]); } // =================================================================== @@ -3711,7 +3757,7 @@ void DropRequest::InternalSwap(DropRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata DropRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[10]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[11]); } // =================================================================== @@ -3725,7 +3771,7 @@ void OpenRequest_OptionsEntry_DoNotUse::MergeFrom(const OpenRequest_OptionsEntry ::PROTOBUF_NAMESPACE_ID::Metadata OpenRequest_OptionsEntry_DoNotUse::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[11]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[12]); } // =================================================================== @@ -4073,7 +4119,7 @@ void OpenRequest::InternalSwap(OpenRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata OpenRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[12]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[13]); } // =================================================================== @@ -4251,7 +4297,7 @@ void CloseRequest::InternalSwap(CloseRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata CloseRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[13]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[14]); } // =================================================================== @@ -4616,7 +4662,7 @@ void AlterRequest::InternalSwap(AlterRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata AlterRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[14]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[15]); } // =================================================================== @@ -4801,7 +4847,7 @@ void AddColumns::InternalSwap(AddColumns* other) { ::PROTOBUF_NAMESPACE_ID::Metadata AddColumns::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[15]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[16]); } // =================================================================== @@ -4986,7 +5032,7 @@ void DropColumns::InternalSwap(DropColumns* other) { ::PROTOBUF_NAMESPACE_ID::Metadata DropColumns::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[16]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[17]); } // =================================================================== @@ -5231,7 +5277,7 @@ void AddColumn::InternalSwap(AddColumn* other) { ::PROTOBUF_NAMESPACE_ID::Metadata AddColumn::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[17]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[18]); } // =================================================================== @@ -5434,7 +5480,7 @@ void DropColumn::InternalSwap(DropColumn* other) { ::PROTOBUF_NAMESPACE_ID::Metadata DropColumn::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[18]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[19]); } // =================================================================== @@ -5612,7 +5658,7 @@ void FlushRequest::InternalSwap(FlushRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata FlushRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[19]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[20]); } // =================================================================== @@ -5790,7 +5836,7 @@ void CompactRequest::InternalSwap(CompactRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata CompactRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[20]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[21]); } // =================================================================== @@ -5968,7 +6014,7 @@ void TruncateRequest::InternalSwap(TruncateRequest* other) { ::PROTOBUF_NAMESPACE_ID::Metadata TruncateRequest::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[21]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[22]); } // =================================================================== @@ -6198,7 +6244,7 @@ void RegionColumnDef::InternalSwap(RegionColumnDef* other) { ::PROTOBUF_NAMESPACE_ID::Metadata RegionColumnDef::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, - file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[22]); + file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[23]); } // @@protoc_insertion_point(namespace_scope) @@ -6206,6 +6252,10 @@ ::PROTOBUF_NAMESPACE_ID::Metadata RegionColumnDef::GetMetadata() const { } // namespace v1 } // namespace greptime PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::greptime::v1::region::RegionRequestHeader_TracingContextEntry_DoNotUse* +Arena::CreateMaybeMessage< ::greptime::v1::region::RegionRequestHeader_TracingContextEntry_DoNotUse >(Arena* arena) { + return Arena::CreateMessageInternal< ::greptime::v1::region::RegionRequestHeader_TracingContextEntry_DoNotUse >(arena); +} template<> PROTOBUF_NOINLINE ::greptime::v1::region::RegionRequestHeader* Arena::CreateMaybeMessage< ::greptime::v1::region::RegionRequestHeader >(Arena* arena) { return Arena::CreateMessageInternal< ::greptime::v1::region::RegionRequestHeader >(arena); diff --git a/c++/greptime/v1/region/server.pb.h b/c++/greptime/v1/region/server.pb.h index 788e5aa2..e0b41396 100644 --- a/c++/greptime/v1/region/server.pb.h +++ b/c++/greptime/v1/region/server.pb.h @@ -116,6 +116,9 @@ extern RegionRequestDefaultTypeInternal _RegionRequest_default_instance_; class RegionRequestHeader; struct RegionRequestHeaderDefaultTypeInternal; extern RegionRequestHeaderDefaultTypeInternal _RegionRequestHeader_default_instance_; +class RegionRequestHeader_TracingContextEntry_DoNotUse; +struct RegionRequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal; +extern RegionRequestHeader_TracingContextEntry_DoNotUseDefaultTypeInternal _RegionRequestHeader_TracingContextEntry_DoNotUse_default_instance_; class RegionResponse; struct RegionResponseDefaultTypeInternal; extern RegionResponseDefaultTypeInternal _RegionResponse_default_instance_; @@ -147,6 +150,7 @@ template<> ::greptime::v1::region::QueryRequest* Arena::CreateMaybeMessage<::gre template<> ::greptime::v1::region::RegionColumnDef* Arena::CreateMaybeMessage<::greptime::v1::region::RegionColumnDef>(Arena*); template<> ::greptime::v1::region::RegionRequest* Arena::CreateMaybeMessage<::greptime::v1::region::RegionRequest>(Arena*); template<> ::greptime::v1::region::RegionRequestHeader* Arena::CreateMaybeMessage<::greptime::v1::region::RegionRequestHeader>(Arena*); +template<> ::greptime::v1::region::RegionRequestHeader_TracingContextEntry_DoNotUse* Arena::CreateMaybeMessage<::greptime::v1::region::RegionRequestHeader_TracingContextEntry_DoNotUse>(Arena*); template<> ::greptime::v1::region::RegionResponse* Arena::CreateMaybeMessage<::greptime::v1::region::RegionResponse>(Arena*); template<> ::greptime::v1::region::TruncateRequest* Arena::CreateMaybeMessage<::greptime::v1::region::TruncateRequest>(Arena*); PROTOBUF_NAMESPACE_CLOSE @@ -156,6 +160,34 @@ namespace region { // =================================================================== +class RegionRequestHeader_TracingContextEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + RegionRequestHeader_TracingContextEntry_DoNotUse(); + explicit PROTOBUF_CONSTEXPR RegionRequestHeader_TracingContextEntry_DoNotUse( + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + explicit RegionRequestHeader_TracingContextEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const RegionRequestHeader_TracingContextEntry_DoNotUse& other); + static const RegionRequestHeader_TracingContextEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_RegionRequestHeader_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.region.RegionRequestHeader.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.region.RegionRequestHeader.TracingContextEntry.value"); + } + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + friend struct ::TableStruct_greptime_2fv1_2fregion_2fserver_2eproto; +}; + +// ------------------------------------------------------------------- + class RegionRequestHeader final : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:greptime.v1.region.RegionRequestHeader) */ { public: @@ -204,7 +236,7 @@ class RegionRequestHeader final : &_RegionRequestHeader_default_instance_); } static constexpr int kIndexInFileMessages = - 0; + 1; friend void swap(RegionRequestHeader& a, RegionRequestHeader& b) { a.Swap(&b); @@ -265,6 +297,8 @@ class RegionRequestHeader final : protected: explicit RegionRequestHeader(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); + private: + static void ArenaDtor(void* object); public: static const ClassData _class_data_; @@ -274,13 +308,30 @@ class RegionRequestHeader final : // nested types ---------------------------------------------------- + // accessors ------------------------------------------------------- enum : int { + kTracingContextFieldNumber = 5, kDbnameFieldNumber = 3, - kTraceIdFieldNumber = 1, - kSpanIdFieldNumber = 2, }; + // map tracing_context = 5; + 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(); + // string dbname = 3; void clear_dbname(); const std::string& dbname() const; @@ -295,24 +346,6 @@ class RegionRequestHeader final : std::string* _internal_mutable_dbname(); public: - // uint64 trace_id = 1; - void clear_trace_id(); - uint64_t trace_id() const; - void set_trace_id(uint64_t value); - private: - uint64_t _internal_trace_id() const; - void _internal_set_trace_id(uint64_t value); - public: - - // uint64 span_id = 2; - void clear_span_id(); - uint64_t span_id() const; - void set_span_id(uint64_t value); - private: - uint64_t _internal_span_id() const; - void _internal_set_span_id(uint64_t value); - public: - // @@protoc_insertion_point(class_scope:greptime.v1.region.RegionRequestHeader) private: class _Internal; @@ -321,9 +354,12 @@ class RegionRequestHeader final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + RegionRequestHeader_TracingContextEntry_DoNotUse, + std::string, std::string, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING> tracing_context_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr dbname_; - uint64_t trace_id_; - uint64_t span_id_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; @@ -393,7 +429,7 @@ class RegionRequest final : &_RegionRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 1; + 2; friend void swap(RegionRequest& a, RegionRequest& b) { a.Swap(&b); @@ -771,7 +807,7 @@ class RegionResponse final : &_RegionResponse_default_instance_); } static constexpr int kIndexInFileMessages = - 2; + 3; friend void swap(RegionResponse& a, RegionResponse& b) { a.Swap(&b); @@ -939,7 +975,7 @@ class InsertRequests final : &_InsertRequests_default_instance_); } static constexpr int kIndexInFileMessages = - 3; + 4; friend void swap(InsertRequests& a, InsertRequests& b) { a.Swap(&b); @@ -1096,7 +1132,7 @@ class DeleteRequests final : &_DeleteRequests_default_instance_); } static constexpr int kIndexInFileMessages = - 4; + 5; friend void swap(DeleteRequests& a, DeleteRequests& b) { a.Swap(&b); @@ -1253,7 +1289,7 @@ class InsertRequest final : &_InsertRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 5; + 6; friend void swap(InsertRequest& a, InsertRequest& b) { a.Swap(&b); @@ -1421,7 +1457,7 @@ class DeleteRequest final : &_DeleteRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 6; + 7; friend void swap(DeleteRequest& a, DeleteRequest& b) { a.Swap(&b); @@ -1589,7 +1625,7 @@ class QueryRequest final : &_QueryRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 7; + 8; friend void swap(QueryRequest& a, QueryRequest& b) { a.Swap(&b); @@ -1801,7 +1837,7 @@ class CreateRequest final : &_CreateRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 9; + 10; friend void swap(CreateRequest& a, CreateRequest& b) { a.Swap(&b); @@ -2052,7 +2088,7 @@ class DropRequest final : &_DropRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 10; + 11; friend void swap(DropRequest& a, DropRequest& b) { a.Swap(&b); @@ -2228,7 +2264,7 @@ class OpenRequest final : &_OpenRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 12; + 13; friend void swap(OpenRequest& a, OpenRequest& b) { a.Swap(&b); @@ -2434,7 +2470,7 @@ class CloseRequest final : &_CloseRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 13; + 14; friend void swap(CloseRequest& a, CloseRequest& b) { a.Swap(&b); @@ -2588,7 +2624,7 @@ class AlterRequest final : &_AlterRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 14; + 15; friend void swap(AlterRequest& a, AlterRequest& b) { a.Swap(&b); @@ -2800,7 +2836,7 @@ class AddColumns final : &_AddColumns_default_instance_); } static constexpr int kIndexInFileMessages = - 15; + 16; friend void swap(AddColumns& a, AddColumns& b) { a.Swap(&b); @@ -2957,7 +2993,7 @@ class DropColumns final : &_DropColumns_default_instance_); } static constexpr int kIndexInFileMessages = - 16; + 17; friend void swap(DropColumns& a, DropColumns& b) { a.Swap(&b); @@ -3114,7 +3150,7 @@ class AddColumn final : &_AddColumn_default_instance_); } static constexpr int kIndexInFileMessages = - 17; + 18; friend void swap(AddColumn& a, AddColumn& b) { a.Swap(&b); @@ -3291,7 +3327,7 @@ class DropColumn final : &_DropColumn_default_instance_); } static constexpr int kIndexInFileMessages = - 18; + 19; friend void swap(DropColumn& a, DropColumn& b) { a.Swap(&b); @@ -3444,7 +3480,7 @@ class FlushRequest final : &_FlushRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 19; + 20; friend void swap(FlushRequest& a, FlushRequest& b) { a.Swap(&b); @@ -3592,7 +3628,7 @@ class CompactRequest final : &_CompactRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 20; + 21; friend void swap(CompactRequest& a, CompactRequest& b) { a.Swap(&b); @@ -3740,7 +3776,7 @@ class TruncateRequest final : &_TruncateRequest_default_instance_); } static constexpr int kIndexInFileMessages = - 21; + 22; friend void swap(TruncateRequest& a, TruncateRequest& b) { a.Swap(&b); @@ -3888,7 +3924,7 @@ class RegionColumnDef final : &_RegionColumnDef_default_instance_); } static constexpr int kIndexInFileMessages = - 22; + 23; friend void swap(RegionColumnDef& a, RegionColumnDef& b) { a.Swap(&b); @@ -4015,46 +4051,37 @@ class RegionColumnDef final : #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ +// ------------------------------------------------------------------- + // RegionRequestHeader -// uint64 trace_id = 1; -inline void RegionRequestHeader::clear_trace_id() { - _impl_.trace_id_ = uint64_t{0u}; -} -inline uint64_t RegionRequestHeader::_internal_trace_id() const { - return _impl_.trace_id_; +// map tracing_context = 5; +inline int RegionRequestHeader::_internal_tracing_context_size() const { + return _impl_.tracing_context_.size(); } -inline uint64_t RegionRequestHeader::trace_id() const { - // @@protoc_insertion_point(field_get:greptime.v1.region.RegionRequestHeader.trace_id) - return _internal_trace_id(); +inline int RegionRequestHeader::tracing_context_size() const { + return _internal_tracing_context_size(); } -inline void RegionRequestHeader::_internal_set_trace_id(uint64_t value) { - - _impl_.trace_id_ = value; -} -inline void RegionRequestHeader::set_trace_id(uint64_t value) { - _internal_set_trace_id(value); - // @@protoc_insertion_point(field_set:greptime.v1.region.RegionRequestHeader.trace_id) -} - -// uint64 span_id = 2; -inline void RegionRequestHeader::clear_span_id() { - _impl_.span_id_ = uint64_t{0u}; +inline void RegionRequestHeader::clear_tracing_context() { + _impl_.tracing_context_.Clear(); } -inline uint64_t RegionRequestHeader::_internal_span_id() const { - return _impl_.span_id_; +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& +RegionRequestHeader::_internal_tracing_context() const { + return _impl_.tracing_context_.GetMap(); } -inline uint64_t RegionRequestHeader::span_id() const { - // @@protoc_insertion_point(field_get:greptime.v1.region.RegionRequestHeader.span_id) - return _internal_span_id(); +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& +RegionRequestHeader::tracing_context() const { + // @@protoc_insertion_point(field_map:greptime.v1.region.RegionRequestHeader.tracing_context) + return _internal_tracing_context(); } -inline void RegionRequestHeader::_internal_set_span_id(uint64_t value) { - - _impl_.span_id_ = value; +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* +RegionRequestHeader::_internal_mutable_tracing_context() { + return _impl_.tracing_context_.MutableMap(); } -inline void RegionRequestHeader::set_span_id(uint64_t value) { - _internal_set_span_id(value); - // @@protoc_insertion_point(field_set:greptime.v1.region.RegionRequestHeader.span_id) +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* +RegionRequestHeader::mutable_tracing_context() { + // @@protoc_insertion_point(field_mutable_map:greptime.v1.region.RegionRequestHeader.tracing_context) + return _internal_mutable_tracing_context(); } // string dbname = 3; @@ -6724,6 +6751,8 @@ inline void RegionColumnDef::set_column_id(uint32_t value) { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) diff --git a/go/greptime/v1/common.pb.go b/go/greptime/v1/common.pb.go index a61872cc..fd0fda68 100644 --- a/go/greptime/v1/common.pb.go +++ b/go/greptime/v1/common.pb.go @@ -226,10 +226,9 @@ type RequestHeader struct { Authorization *AuthHeader `protobuf:"bytes,3,opt,name=authorization,proto3" json:"authorization,omitempty"` // The `dbname` for the request Dbname string `protobuf:"bytes,4,opt,name=dbname,proto3" json:"dbname,omitempty"` - // TraceID of request - TraceId uint64 `protobuf:"varint,5,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` - // SpanID of request - SpanId uint64 `protobuf:"varint,6,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` + // 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,5,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 *RequestHeader) Reset() { @@ -292,18 +291,11 @@ func (x *RequestHeader) GetDbname() string { return "" } -func (x *RequestHeader) GetTraceId() uint64 { +func (x *RequestHeader) GetTracingContext() map[string]string { if x != nil { - return x.TraceId + return x.TracingContext } - return 0 -} - -func (x *RequestHeader) GetSpanId() uint64 { - if x != nil { - return x.SpanId - } - return 0 + return nil } type ResponseHeader struct { @@ -754,7 +746,7 @@ var File_greptime_v1_common_proto protoreflect.FileDescriptor var file_greptime_v1_common_proto_rawDesc = []byte{ 0x0a, 0x18, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x67, 0x72, 0x65, 0x70, - 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x22, 0xcc, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x22, 0xb4, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, @@ -764,89 +756,95 @@ var file_greptime_v1_common_proto_rawDesc = []byte{ 0x2e, 0x41, 0x75, 0x74, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x62, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x62, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x17, 0x0a, - 0x07, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, - 0x73, 0x70, 0x61, 0x6e, 0x49, 0x64, 0x22, 0x3d, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, - 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x42, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, - 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x73, 0x0a, 0x0a, 0x41, 0x75, 0x74, - 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x61, 0x73, 0x69, 0x63, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x73, 0x69, 0x63, 0x48, 0x00, 0x52, 0x05, 0x62, 0x61, - 0x73, 0x69, 0x63, 0x12, 0x2a, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x48, 0x00, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, - 0x0d, 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x3f, - 0x0a, 0x05, 0x42, 0x61, 0x73, 0x69, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, - 0x1d, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x24, - 0x0a, 0x0c, 0x41, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0x50, 0x0a, 0x0e, 0x46, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3e, 0x0a, 0x0d, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, - 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x66, 0x66, 0x65, - 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x52, 0x0c, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, - 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x22, 0x64, 0x0a, 0x14, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, - 0x61, 0x6c, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x44, 0x61, 0x79, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x16, - 0x0a, 0x06, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, - 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x79, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x64, 0x61, 0x79, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x61, - 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0b, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x2a, 0x31, 0x0a, 0x0c, - 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, - 0x54, 0x41, 0x47, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x10, 0x01, - 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x02, 0x2a, - 0xa8, 0x04, 0x0a, 0x0e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x10, 0x00, 0x12, - 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x54, 0x38, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x54, - 0x31, 0x36, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x03, 0x12, - 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x49, - 0x4e, 0x54, 0x38, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x31, 0x36, 0x10, - 0x06, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x07, 0x12, 0x0a, 0x0a, - 0x06, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x08, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x4c, 0x4f, - 0x41, 0x54, 0x33, 0x32, 0x10, 0x09, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x36, - 0x34, 0x10, 0x0a, 0x12, 0x0a, 0x0a, 0x06, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x0b, 0x12, - 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x0c, 0x12, 0x08, 0x0a, 0x04, 0x44, - 0x41, 0x54, 0x45, 0x10, 0x0d, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x41, 0x54, 0x45, 0x54, 0x49, 0x4d, - 0x45, 0x10, 0x0e, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, - 0x5f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x0f, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x49, 0x4d, - 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x5f, 0x4d, 0x49, 0x4c, 0x4c, 0x49, 0x53, 0x45, 0x43, 0x4f, - 0x4e, 0x44, 0x10, 0x10, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, - 0x50, 0x5f, 0x4d, 0x49, 0x43, 0x52, 0x4f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x11, 0x12, - 0x18, 0x0a, 0x14, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x5f, 0x4e, 0x41, 0x4e, - 0x4f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x12, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x49, 0x4d, - 0x45, 0x5f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x13, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x49, - 0x4d, 0x45, 0x5f, 0x4d, 0x49, 0x4c, 0x4c, 0x49, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x14, - 0x12, 0x14, 0x0a, 0x10, 0x54, 0x49, 0x4d, 0x45, 0x5f, 0x4d, 0x49, 0x43, 0x52, 0x4f, 0x53, 0x45, - 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x15, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x49, 0x4d, 0x45, 0x5f, 0x4e, - 0x41, 0x4e, 0x4f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x16, 0x12, 0x17, 0x0a, 0x13, 0x49, - 0x4e, 0x54, 0x45, 0x52, 0x56, 0x41, 0x4c, 0x5f, 0x59, 0x45, 0x41, 0x52, 0x5f, 0x4d, 0x4f, 0x4e, - 0x54, 0x48, 0x10, 0x17, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x56, 0x41, 0x4c, - 0x5f, 0x44, 0x41, 0x59, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x18, 0x12, 0x1b, 0x0a, 0x17, 0x49, - 0x4e, 0x54, 0x45, 0x52, 0x56, 0x41, 0x4c, 0x5f, 0x4d, 0x4f, 0x4e, 0x54, 0x48, 0x5f, 0x44, 0x41, - 0x59, 0x5f, 0x4e, 0x41, 0x4e, 0x4f, 0x10, 0x19, 0x12, 0x13, 0x0a, 0x0f, 0x44, 0x55, 0x52, 0x41, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x1a, 0x12, 0x18, 0x0a, - 0x14, 0x44, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x49, 0x4c, 0x4c, 0x49, 0x53, - 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x1b, 0x12, 0x18, 0x0a, 0x14, 0x44, 0x55, 0x52, 0x41, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x49, 0x43, 0x52, 0x4f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, - 0x1c, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x41, - 0x4e, 0x4f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x1d, 0x42, 0x4f, 0x0a, 0x0e, 0x69, 0x6f, - 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x06, 0x43, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x5a, 0x35, 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, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x6d, 0x65, 0x12, 0x57, 0x0a, 0x0f, 0x74, 0x72, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x72, + 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 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, 0x3d, + 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x42, 0x0a, + 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, + 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, + 0x67, 0x22, 0x73, 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x2a, 0x0a, 0x05, 0x62, 0x61, 0x73, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x73, + 0x69, 0x63, 0x48, 0x00, 0x52, 0x05, 0x62, 0x61, 0x73, 0x69, 0x63, 0x12, 0x2a, 0x0a, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x65, + 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x48, 0x00, + 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0d, 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x5f, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x3f, 0x0a, 0x05, 0x42, 0x61, 0x73, 0x69, 0x63, 0x12, + 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x1d, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x24, 0x0a, 0x0c, 0x41, 0x66, 0x66, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x50, 0x0a, 0x0e, + 0x46, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3e, + 0x0a, 0x0d, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, + 0x52, 0x0c, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x22, 0x64, + 0x0a, 0x14, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x44, + 0x61, 0x79, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x64, 0x61, + 0x79, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, + 0x6f, 0x6e, 0x64, 0x73, 0x2a, 0x31, 0x0a, 0x0c, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x41, 0x47, 0x10, 0x00, 0x12, 0x09, 0x0a, + 0x05, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x49, 0x4d, 0x45, + 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x02, 0x2a, 0xa8, 0x04, 0x0a, 0x0e, 0x43, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x4f, + 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x54, 0x38, 0x10, + 0x01, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x31, 0x36, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, + 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x36, 0x34, + 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x49, 0x4e, 0x54, 0x38, 0x10, 0x05, 0x12, 0x0a, 0x0a, + 0x06, 0x55, 0x49, 0x4e, 0x54, 0x31, 0x36, 0x10, 0x06, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x49, 0x4e, + 0x54, 0x33, 0x32, 0x10, 0x07, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, + 0x08, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x33, 0x32, 0x10, 0x09, 0x12, 0x0b, + 0x0a, 0x07, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x36, 0x34, 0x10, 0x0a, 0x12, 0x0a, 0x0a, 0x06, 0x42, + 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x0b, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, + 0x47, 0x10, 0x0c, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x41, 0x54, 0x45, 0x10, 0x0d, 0x12, 0x0c, 0x0a, + 0x08, 0x44, 0x41, 0x54, 0x45, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x0e, 0x12, 0x14, 0x0a, 0x10, 0x54, + 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x5f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, + 0x0f, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x5f, 0x4d, + 0x49, 0x4c, 0x4c, 0x49, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x10, 0x12, 0x19, 0x0a, 0x15, + 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x5f, 0x4d, 0x49, 0x43, 0x52, 0x4f, 0x53, + 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x11, 0x12, 0x18, 0x0a, 0x14, 0x54, 0x49, 0x4d, 0x45, 0x53, + 0x54, 0x41, 0x4d, 0x50, 0x5f, 0x4e, 0x41, 0x4e, 0x4f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, + 0x12, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x49, 0x4d, 0x45, 0x5f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, + 0x10, 0x13, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x49, 0x4d, 0x45, 0x5f, 0x4d, 0x49, 0x4c, 0x4c, 0x49, + 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x14, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x49, 0x4d, 0x45, + 0x5f, 0x4d, 0x49, 0x43, 0x52, 0x4f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x15, 0x12, 0x13, + 0x0a, 0x0f, 0x54, 0x49, 0x4d, 0x45, 0x5f, 0x4e, 0x41, 0x4e, 0x4f, 0x53, 0x45, 0x43, 0x4f, 0x4e, + 0x44, 0x10, 0x16, 0x12, 0x17, 0x0a, 0x13, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x56, 0x41, 0x4c, 0x5f, + 0x59, 0x45, 0x41, 0x52, 0x5f, 0x4d, 0x4f, 0x4e, 0x54, 0x48, 0x10, 0x17, 0x12, 0x15, 0x0a, 0x11, + 0x49, 0x4e, 0x54, 0x45, 0x52, 0x56, 0x41, 0x4c, 0x5f, 0x44, 0x41, 0x59, 0x5f, 0x54, 0x49, 0x4d, + 0x45, 0x10, 0x18, 0x12, 0x1b, 0x0a, 0x17, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x56, 0x41, 0x4c, 0x5f, + 0x4d, 0x4f, 0x4e, 0x54, 0x48, 0x5f, 0x44, 0x41, 0x59, 0x5f, 0x4e, 0x41, 0x4e, 0x4f, 0x10, 0x19, + 0x12, 0x13, 0x0a, 0x0f, 0x44, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x45, 0x43, + 0x4f, 0x4e, 0x44, 0x10, 0x1a, 0x12, 0x18, 0x0a, 0x14, 0x44, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x4d, 0x49, 0x4c, 0x4c, 0x49, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x1b, 0x12, + 0x18, 0x0a, 0x14, 0x44, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x49, 0x43, 0x52, + 0x4f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, 0x10, 0x1c, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x55, 0x52, + 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x41, 0x4e, 0x4f, 0x53, 0x45, 0x43, 0x4f, 0x4e, 0x44, + 0x10, 0x1d, 0x42, 0x4f, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, + 0x65, 0x2e, 0x76, 0x31, 0x42, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5a, 0x35, 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, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -862,7 +860,7 @@ func file_greptime_v1_common_proto_rawDescGZIP() []byte { } var file_greptime_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_greptime_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_greptime_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_greptime_v1_common_proto_goTypes = []interface{}{ (SemanticType)(0), // 0: greptime.v1.SemanticType (ColumnDataType)(0), // 1: greptime.v1.ColumnDataType @@ -875,18 +873,20 @@ var file_greptime_v1_common_proto_goTypes = []interface{}{ (*AffectedRows)(nil), // 8: greptime.v1.AffectedRows (*FlightMetadata)(nil), // 9: greptime.v1.FlightMetadata (*IntervalMonthDayNano)(nil), // 10: greptime.v1.IntervalMonthDayNano + nil, // 11: greptime.v1.RequestHeader.TracingContextEntry } var file_greptime_v1_common_proto_depIdxs = []int32{ - 5, // 0: greptime.v1.RequestHeader.authorization:type_name -> greptime.v1.AuthHeader - 4, // 1: greptime.v1.ResponseHeader.status:type_name -> greptime.v1.Status - 6, // 2: greptime.v1.AuthHeader.basic:type_name -> greptime.v1.Basic - 7, // 3: greptime.v1.AuthHeader.token:type_name -> greptime.v1.Token - 8, // 4: greptime.v1.FlightMetadata.affected_rows:type_name -> greptime.v1.AffectedRows - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 5, // 0: greptime.v1.RequestHeader.authorization:type_name -> greptime.v1.AuthHeader + 11, // 1: greptime.v1.RequestHeader.tracing_context:type_name -> greptime.v1.RequestHeader.TracingContextEntry + 4, // 2: greptime.v1.ResponseHeader.status:type_name -> greptime.v1.Status + 6, // 3: greptime.v1.AuthHeader.basic:type_name -> greptime.v1.Basic + 7, // 4: greptime.v1.AuthHeader.token:type_name -> greptime.v1.Token + 8, // 5: greptime.v1.FlightMetadata.affected_rows:type_name -> greptime.v1.AffectedRows + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_greptime_v1_common_proto_init() } @@ -1014,7 +1014,7 @@ func file_greptime_v1_common_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_greptime_v1_common_proto_rawDesc, NumEnums: 2, - NumMessages: 9, + NumMessages: 10, NumExtensions: 0, NumServices: 0, }, diff --git a/go/greptime/v1/meta/common.pb.go b/go/greptime/v1/meta/common.pb.go index 82972a06..962fd2d3 100644 --- a/go/greptime/v1/meta/common.pb.go +++ b/go/greptime/v1/meta/common.pb.go @@ -91,6 +91,9 @@ type RequestHeader struct { // member_id is the ID of the sender server. MemberId uint64 `protobuf:"varint,3,opt,name=member_id,json=memberId,proto3" json:"member_id,omitempty"` Role Role `protobuf:"varint,4,opt,name=role,proto3,enum=greptime.v1.meta.Role" json:"role,omitempty"` + // 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,5,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 *RequestHeader) Reset() { @@ -153,6 +156,13 @@ func (x *RequestHeader) GetRole() Role { return Role_DATANODE } +func (x *RequestHeader) GetTracingContext() map[string]string { + if x != nil { + return x.TracingContext + } + return nil +} + type ResponseHeader struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -557,7 +567,7 @@ var file_greptime_v1_meta_common_proto_rawDesc = []byte{ 0x0a, 0x1d, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, - 0x61, 0x22, 0xa2, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, + 0x61, 0x22, 0xc3, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, @@ -567,48 +577,58 @@ var file_greptime_v1_meta_common_proto_rawDesc = []byte{ 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x52, 0x6f, 0x6c, 0x65, - 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x89, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x22, 0x34, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, - 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, - 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x2a, 0x0a, 0x04, 0x50, 0x65, 0x65, 0x72, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x61, 0x64, 0x64, 0x72, 0x22, 0x19, 0x0a, 0x07, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, - 0x6e, 0x0a, 0x09, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, - 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, - 0x76, 0x0a, 0x0c, 0x54, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, - 0x34, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, - 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x12, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, 0x32, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0x22, 0x0a, 0x04, 0x52, - 0x6f, 0x6c, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x41, 0x54, 0x41, 0x4e, 0x4f, 0x44, 0x45, 0x10, - 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x52, 0x4f, 0x4e, 0x54, 0x45, 0x4e, 0x44, 0x10, 0x01, 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, + 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x5c, 0x0a, 0x0f, 0x74, 0x72, 0x61, 0x63, 0x69, 0x6e, + 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x33, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x6d, 0x65, + 0x74, 0x61, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 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, 0x89, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x22, 0x34, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x2a, 0x0a, 0x04, 0x50, 0x65, 0x65, + 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x61, 0x64, 0x64, 0x72, 0x22, 0x19, 0x0a, 0x07, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x49, 0x64, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x6e, 0x0a, 0x09, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, + 0x0c, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x22, 0x76, 0x0a, 0x0c, 0x54, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x12, 0x34, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x14, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x22, 0x32, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0x22, 0x0a, 0x04, + 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x41, 0x54, 0x41, 0x4e, 0x4f, 0x44, 0x45, + 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x52, 0x4f, 0x4e, 0x54, 0x45, 0x4e, 0x44, 0x10, 0x01, + 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 ( @@ -624,7 +644,7 @@ func file_greptime_v1_meta_common_proto_rawDescGZIP() []byte { } var file_greptime_v1_meta_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_greptime_v1_meta_common_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_greptime_v1_meta_common_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_greptime_v1_meta_common_proto_goTypes = []interface{}{ (Role)(0), // 0: greptime.v1.meta.Role (*RequestHeader)(nil), // 1: greptime.v1.meta.RequestHeader @@ -635,15 +655,17 @@ var file_greptime_v1_meta_common_proto_goTypes = []interface{}{ (*TableName)(nil), // 6: greptime.v1.meta.TableName (*TimeInterval)(nil), // 7: greptime.v1.meta.TimeInterval (*KeyValue)(nil), // 8: greptime.v1.meta.KeyValue + nil, // 9: greptime.v1.meta.RequestHeader.TracingContextEntry } var file_greptime_v1_meta_common_proto_depIdxs = []int32{ 0, // 0: greptime.v1.meta.RequestHeader.role:type_name -> greptime.v1.meta.Role - 3, // 1: greptime.v1.meta.ResponseHeader.error:type_name -> greptime.v1.meta.Error - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 9, // 1: greptime.v1.meta.RequestHeader.tracing_context:type_name -> greptime.v1.meta.RequestHeader.TracingContextEntry + 3, // 2: greptime.v1.meta.ResponseHeader.error:type_name -> greptime.v1.meta.Error + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_greptime_v1_meta_common_proto_init() } @@ -755,7 +777,7 @@ func file_greptime_v1_meta_common_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_greptime_v1_meta_common_proto_rawDesc, NumEnums: 1, - NumMessages: 8, + NumMessages: 9, NumExtensions: 0, NumServices: 0, }, diff --git a/java/src/main/java/greptime/v1/meta/Common.java b/java/src/main/java/greptime/v1/meta/Common.java index eb8a3e2d..747ee186 100644 --- a/java/src/main/java/greptime/v1/meta/Common.java +++ b/java/src/main/java/greptime/v1/meta/Common.java @@ -162,6 +162,67 @@ public interface RequestHeaderOrBuilder extends * @return The role. */ greptime.v1.meta.Common.Role getRole(); + + /** + *
+     * Encoded trace_id & span_id, follow the w3c Trace Context
+     * https://www.w3.org/TR/trace-context/#header-name
+     * 
+ * + * map<string, string> tracing_context = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + + /* 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 = 5; + */ + + java.lang.String getTracingContextOrThrow( + java.lang.String key); } /** * Protobuf type {@code greptime.v1.meta.RequestHeader} @@ -199,6 +260,7 @@ private RequestHeader( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -230,6 +292,19 @@ private RequestHeader( role_ = rawValue; break; } + case 42: { + 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)) { @@ -256,6 +331,18 @@ private RequestHeader( return greptime.v1.meta.Common.internal_static_greptime_v1_meta_RequestHeader_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetTracingContext(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -324,6 +411,107 @@ public long getMemberId() { return result == null ? greptime.v1.meta.Common.Role.UNRECOGNIZED : result; } + public static final int TRACING_CONTEXT_FIELD_NUMBER = 5; + 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.Common.internal_static_greptime_v1_meta_RequestHeader_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 = 5; + */ + + @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 = 5; + */ + @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 = 5; + */ + @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 = 5; + */ + @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() { @@ -350,6 +538,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (role_ != greptime.v1.meta.Common.Role.DATANODE.getNumber()) { output.writeEnum(4, role_); } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetTracingContext(), + TracingContextDefaultEntryHolder.defaultEntry, + 5); unknownFields.writeTo(output); } @@ -375,6 +569,16 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeEnumSize(4, role_); } + 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(5, tracingContext__); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -397,6 +601,8 @@ public boolean equals(final java.lang.Object obj) { if (getMemberId() != other.getMemberId()) return false; if (role_ != other.role_) return false; + if (!internalGetTracingContext().equals( + other.internalGetTracingContext())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -419,6 +625,10 @@ public int hashCode() { getMemberId()); hash = (37 * hash) + ROLE_FIELD_NUMBER; hash = (53 * hash) + role_; + 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; @@ -526,6 +736,28 @@ public static final class Builder extends return greptime.v1.meta.Common.internal_static_greptime_v1_meta_RequestHeader_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetTracingContext(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 5: + return internalGetMutableTracingContext(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -560,6 +792,7 @@ public Builder clear() { role_ = 0; + internalGetMutableTracingContext().clear(); return this; } @@ -586,10 +819,13 @@ public greptime.v1.meta.Common.RequestHeader build() { @java.lang.Override public greptime.v1.meta.Common.RequestHeader buildPartial() { greptime.v1.meta.Common.RequestHeader result = new greptime.v1.meta.Common.RequestHeader(this); + int from_bitField0_ = bitField0_; result.protocolVersion_ = protocolVersion_; result.clusterId_ = clusterId_; result.memberId_ = memberId_; result.role_ = role_; + result.tracingContext_ = internalGetTracingContext(); + result.tracingContext_.makeImmutable(); onBuilt(); return result; } @@ -650,6 +886,8 @@ public Builder mergeFrom(greptime.v1.meta.Common.RequestHeader other) { if (other.role_ != 0) { setRoleValue(other.getRoleValue()); } + internalGetMutableTracingContext().mergeFrom( + other.internalGetTracingContext()); this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -678,6 +916,7 @@ public Builder mergeFrom( } return this; } + private int bitField0_; private long protocolVersion_ ; /** @@ -849,6 +1088,172 @@ public Builder clearRole() { onChanged(); return this; } + + 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 = 5; + */ + + @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 = 5; + */ + @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 = 5; + */ + @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 = 5; + */ + @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 = 5; + */ + + 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 = 5; + */ + 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 = 5; + */ + + 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) { @@ -5543,6 +5948,11 @@ public greptime.v1.meta.Common.KeyValue getDefaultInstanceForType() { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_greptime_v1_meta_RequestHeader_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_greptime_v1_meta_RequestHeader_TracingContextEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_greptime_v1_meta_RequestHeader_TracingContextEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_greptime_v1_meta_ResponseHeader_descriptor; private static final @@ -5588,22 +5998,26 @@ public greptime.v1.meta.Common.KeyValue getDefaultInstanceForType() { static { java.lang.String[] descriptorData = { "\n\035greptime/v1/meta/common.proto\022\020greptim" + - "e.v1.meta\"v\n\rRequestHeader\022\030\n\020protocol_v" + - "ersion\030\001 \001(\004\022\022\n\ncluster_id\030\002 \001(\004\022\021\n\tmemb" + - "er_id\030\003 \001(\004\022$\n\004role\030\004 \001(\0162\026.greptime.v1." + - "meta.Role\"f\n\016ResponseHeader\022\030\n\020protocol_" + - "version\030\001 \001(\004\022\022\n\ncluster_id\030\002 \001(\004\022&\n\005err" + - "or\030\003 \001(\0132\027.greptime.v1.meta.Error\"&\n\005Err" + - "or\022\014\n\004code\030\001 \001(\005\022\017\n\007err_msg\030\002 \001(\t\" \n\004Pee" + - "r\022\n\n\002id\030\001 \001(\004\022\014\n\004addr\030\002 \001(\t\"\025\n\007TableId\022\n" + - "\n\002id\030\001 \001(\r\"J\n\tTableName\022\024\n\014catalog_name\030" + - "\001 \001(\t\022\023\n\013schema_name\030\002 \001(\t\022\022\n\ntable_name" + - "\030\003 \001(\t\"L\n\014TimeInterval\022\036\n\026start_timestam" + - "p_millis\030\001 \001(\003\022\034\n\024end_timestamp_millis\030\002" + - " \001(\003\"&\n\010KeyValue\022\013\n\003key\030\001 \001(\014\022\r\n\005value\030\002" + - " \001(\014*\"\n\004Role\022\014\n\010DATANODE\020\000\022\014\n\010FRONTEND\020\001" + - "B - * TraceID of request + * Encoded trace_id & span_id, follow the w3c Trace Context + * https://www.w3.org/TR/trace-context/#header-name * * - * uint64 trace_id = 5; - * @return The traceId. + * map<string, string> tracing_context = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 5; */ - long getTraceId(); + /* nullable */ +java.lang.String getTracingContextOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); /** *
-     * SpanID of request
+     * Encoded trace_id & span_id, follow the w3c Trace Context
+     * https://www.w3.org/TR/trace-context/#header-name
      * 
* - * uint64 span_id = 6; - * @return The spanId. + * map<string, string> tracing_context = 5; */ - long getSpanId(); + + java.lang.String getTracingContextOrThrow( + java.lang.String key); } /** * Protobuf type {@code greptime.v1.RequestHeader} @@ -640,6 +681,7 @@ private RequestHeader( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -681,14 +723,17 @@ private RequestHeader( dbname_ = s; break; } - case 40: { - - traceId_ = input.readUInt64(); - break; - } - case 48: { - - spanId_ = input.readUInt64(); + case 42: { + 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: { @@ -717,6 +762,18 @@ private RequestHeader( return io.greptime.v1.Common.internal_static_greptime_v1_RequestHeader_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetTracingContext(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -901,34 +958,105 @@ public java.lang.String getDbname() { } } - public static final int TRACE_ID_FIELD_NUMBER = 5; - private long traceId_; + public static final int TRACING_CONTEXT_FIELD_NUMBER = 5; + private static final class TracingContextDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.greptime.v1.Common.internal_static_greptime_v1_RequestHeader_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(); + } /** *
-     * TraceID of request
+     * Encoded trace_id & span_id, follow the w3c Trace Context
+     * https://www.w3.org/TR/trace-context/#header-name
      * 
* - * uint64 trace_id = 5; - * @return The traceId. + * map<string, string> tracing_context = 5; + */ + + @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 = 5; */ @java.lang.Override - public long getTraceId() { - return traceId_; + + 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 = 5; + */ + @java.lang.Override - public static final int SPAN_ID_FIELD_NUMBER = 6; - private long spanId_; + 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; + } /** *
-     * SpanID of request
+     * Encoded trace_id & span_id, follow the w3c Trace Context
+     * https://www.w3.org/TR/trace-context/#header-name
      * 
* - * uint64 span_id = 6; - * @return The spanId. + * map<string, string> tracing_context = 5; */ @java.lang.Override - public long getSpanId() { - return spanId_; + + 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; @@ -957,12 +1085,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dbname_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, dbname_); } - if (traceId_ != 0L) { - output.writeUInt64(5, traceId_); - } - if (spanId_ != 0L) { - output.writeUInt64(6, spanId_); - } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetTracingContext(), + TracingContextDefaultEntryHolder.defaultEntry, + 5); unknownFields.writeTo(output); } @@ -985,13 +1113,15 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dbname_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, dbname_); } - if (traceId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(5, traceId_); - } - if (spanId_ != 0L) { + 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 - .computeUInt64Size(6, spanId_); + .computeMessageSize(5, tracingContext__); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -1019,10 +1149,8 @@ public boolean equals(final java.lang.Object obj) { } if (!getDbname() .equals(other.getDbname())) return false; - if (getTraceId() - != other.getTraceId()) return false; - if (getSpanId() - != other.getSpanId()) return false; + if (!internalGetTracingContext().equals( + other.internalGetTracingContext())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -1044,12 +1172,10 @@ public int hashCode() { } hash = (37 * hash) + DBNAME_FIELD_NUMBER; hash = (53 * hash) + getDbname().hashCode(); - hash = (37 * hash) + TRACE_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTraceId()); - hash = (37 * hash) + SPAN_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getSpanId()); + 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; @@ -1157,6 +1283,28 @@ public static final class Builder extends return io.greptime.v1.Common.internal_static_greptime_v1_RequestHeader_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetTracingContext(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 5: + return internalGetMutableTracingContext(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -1195,10 +1343,7 @@ public Builder clear() { } dbname_ = ""; - traceId_ = 0L; - - spanId_ = 0L; - + internalGetMutableTracingContext().clear(); return this; } @@ -1225,6 +1370,7 @@ public io.greptime.v1.Common.RequestHeader build() { @java.lang.Override public io.greptime.v1.Common.RequestHeader buildPartial() { io.greptime.v1.Common.RequestHeader result = new io.greptime.v1.Common.RequestHeader(this); + int from_bitField0_ = bitField0_; result.catalog_ = catalog_; result.schema_ = schema_; if (authorizationBuilder_ == null) { @@ -1233,8 +1379,8 @@ public io.greptime.v1.Common.RequestHeader buildPartial() { result.authorization_ = authorizationBuilder_.build(); } result.dbname_ = dbname_; - result.traceId_ = traceId_; - result.spanId_ = spanId_; + result.tracingContext_ = internalGetTracingContext(); + result.tracingContext_.makeImmutable(); onBuilt(); return result; } @@ -1298,12 +1444,8 @@ public Builder mergeFrom(io.greptime.v1.Common.RequestHeader other) { dbname_ = other.dbname_; onChanged(); } - if (other.getTraceId() != 0L) { - setTraceId(other.getTraceId()); - } - if (other.getSpanId() != 0L) { - setSpanId(other.getSpanId()); - } + internalGetMutableTracingContext().mergeFrom( + other.internalGetTracingContext()); this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1332,6 +1474,7 @@ public Builder mergeFrom( } return this; } + private int bitField0_; private java.lang.Object catalog_ = ""; /** @@ -1776,89 +1919,169 @@ public Builder setDbnameBytes( return this; } - private long traceId_ ; + 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(); + } /** *
-       * TraceID of request
+       * Encoded trace_id & span_id, follow the w3c Trace Context
+       * https://www.w3.org/TR/trace-context/#header-name
        * 
* - * uint64 trace_id = 5; - * @return The traceId. + * map<string, string> tracing_context = 5; */ + @java.lang.Override - public long getTraceId() { - return traceId_; + 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(); } /** *
-       * TraceID of request
+       * Encoded trace_id & span_id, follow the w3c Trace Context
+       * https://www.w3.org/TR/trace-context/#header-name
        * 
* - * uint64 trace_id = 5; - * @param value The traceId to set. - * @return This builder for chaining. + * map<string, string> tracing_context = 5; */ - public Builder setTraceId(long value) { - - traceId_ = value; - onChanged(); - return this; + @java.lang.Override + + public java.util.Map getTracingContextMap() { + return internalGetTracingContext().getMap(); } /** *
-       * TraceID of request
+       * Encoded trace_id & span_id, follow the w3c Trace Context
+       * https://www.w3.org/TR/trace-context/#header-name
        * 
* - * uint64 trace_id = 5; - * @return This builder for chaining. + * map<string, string> tracing_context = 5; */ - public Builder clearTraceId() { - - traceId_ = 0L; - onChanged(); - return this; - } + @java.lang.Override - private long spanId_ ; + 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; + } /** *
-       * SpanID of request
+       * Encoded trace_id & span_id, follow the w3c Trace Context
+       * https://www.w3.org/TR/trace-context/#header-name
        * 
* - * uint64 span_id = 6; - * @return The spanId. + * map<string, string> tracing_context = 5; */ @java.lang.Override - public long getSpanId() { - return spanId_; + + 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; } /** *
-       * SpanID of request
+       * Encoded trace_id & span_id, follow the w3c Trace Context
+       * https://www.w3.org/TR/trace-context/#header-name
        * 
* - * uint64 span_id = 6; - * @param value The spanId to set. - * @return This builder for chaining. + * map<string, string> tracing_context = 5; */ - public Builder setSpanId(long value) { - - spanId_ = value; - onChanged(); + + 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(); + } /** *
-       * SpanID of request
+       * Encoded trace_id & span_id, follow the w3c Trace Context
+       * https://www.w3.org/TR/trace-context/#header-name
        * 
* - * uint64 span_id = 6; - * @return This builder for chaining. + * map<string, string> tracing_context = 5; */ - public Builder clearSpanId() { - - spanId_ = 0L; - onChanged(); + 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 = 5; + */ + + public Builder putAllTracingContext( + java.util.Map values) { + internalGetMutableTracingContext().getMutableMap() + .putAll(values); return this; } @java.lang.Override @@ -7187,6 +7410,11 @@ public io.greptime.v1.Common.IntervalMonthDayNano getDefaultInstanceForType() { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_greptime_v1_RequestHeader_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_greptime_v1_RequestHeader_TracingContextEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_greptime_v1_RequestHeader_TracingContextEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_greptime_v1_ResponseHeader_descriptor; private static final @@ -7237,39 +7465,41 @@ public io.greptime.v1.Common.IntervalMonthDayNano getDefaultInstanceForType() { static { java.lang.String[] descriptorData = { "\n\030greptime/v1/common.proto\022\013greptime.v1\"" + - "\223\001\n\rRequestHeader\022\017\n\007catalog\030\001 \001(\t\022\016\n\006sc" + + "\360\001\n\rRequestHeader\022\017\n\007catalog\030\001 \001(\t\022\016\n\006sc" + "hema\030\002 \001(\t\022.\n\rauthorization\030\003 \001(\0132\027.grep" + - "time.v1.AuthHeader\022\016\n\006dbname\030\004 \001(\t\022\020\n\010tr" + - "ace_id\030\005 \001(\004\022\017\n\007span_id\030\006 \001(\004\"5\n\016Respons" + - "eHeader\022#\n\006status\030\001 \001(\0132\023.greptime.v1.St" + - "atus\".\n\006Status\022\023\n\013status_code\030\001 \001(\r\022\017\n\007e" + - "rr_msg\030\002 \001(\t\"e\n\nAuthHeader\022#\n\005basic\030\001 \001(" + - "\0132\022.greptime.v1.BasicH\000\022#\n\005token\030\002 \001(\0132\022" + - ".greptime.v1.TokenH\000B\r\n\013auth_scheme\"+\n\005B" + - "asic\022\020\n\010username\030\001 \001(\t\022\020\n\010password\030\002 \001(\t" + - "\"\026\n\005Token\022\r\n\005token\030\001 \001(\t\"\035\n\014AffectedRows" + - "\022\r\n\005value\030\001 \001(\r\"B\n\016FlightMetadata\0220\n\raff" + - "ected_rows\030\001 \001(\0132\031.greptime.v1.AffectedR" + - "ows\"I\n\024IntervalMonthDayNano\022\016\n\006months\030\001 " + - "\001(\005\022\014\n\004days\030\002 \001(\005\022\023\n\013nanoseconds\030\003 \001(\003*1" + - "\n\014SemanticType\022\007\n\003TAG\020\000\022\t\n\005FIELD\020\001\022\r\n\tTI" + - "MESTAMP\020\002*\250\004\n\016ColumnDataType\022\013\n\007BOOLEAN\020" + - "\000\022\010\n\004INT8\020\001\022\t\n\005INT16\020\002\022\t\n\005INT32\020\003\022\t\n\005INT" + - "64\020\004\022\t\n\005UINT8\020\005\022\n\n\006UINT16\020\006\022\n\n\006UINT32\020\007\022" + - "\n\n\006UINT64\020\010\022\013\n\007FLOAT32\020\t\022\013\n\007FLOAT64\020\n\022\n\n" + - "\006BINARY\020\013\022\n\n\006STRING\020\014\022\010\n\004DATE\020\r\022\014\n\010DATET" + - "IME\020\016\022\024\n\020TIMESTAMP_SECOND\020\017\022\031\n\025TIMESTAMP" + - "_MILLISECOND\020\020\022\031\n\025TIMESTAMP_MICROSECOND\020" + - "\021\022\030\n\024TIMESTAMP_NANOSECOND\020\022\022\017\n\013TIME_SECO" + - "ND\020\023\022\024\n\020TIME_MILLISECOND\020\024\022\024\n\020TIME_MICRO" + - "SECOND\020\025\022\023\n\017TIME_NANOSECOND\020\026\022\027\n\023INTERVA" + - "L_YEAR_MONTH\020\027\022\025\n\021INTERVAL_DAY_TIME\020\030\022\033\n" + - "\027INTERVAL_MONTH_DAY_NANO\020\031\022\023\n\017DURATION_S" + - "ECOND\020\032\022\030\n\024DURATION_MILLISECOND\020\033\022\030\n\024DUR" + - "ATION_MICROSECOND\020\034\022\027\n\023DURATION_NANOSECO" + - "ND\020\035BO\n\016io.greptime.v1B\006CommonZ5github.c" + - "om/GreptimeTeam/greptime-proto/go/grepti" + - "me/v1b\006proto3" + "time.v1.AuthHeader\022\016\n\006dbname\030\004 \001(\t\022G\n\017tr" + + "acing_context\030\005 \003(\0132..greptime.v1.Reques" + + "tHeader.TracingContextEntry\0325\n\023TracingCo" + + "ntextEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\002" + + "8\001\"5\n\016ResponseHeader\022#\n\006status\030\001 \001(\0132\023.g" + + "reptime.v1.Status\".\n\006Status\022\023\n\013status_co" + + "de\030\001 \001(\r\022\017\n\007err_msg\030\002 \001(\t\"e\n\nAuthHeader\022" + + "#\n\005basic\030\001 \001(\0132\022.greptime.v1.BasicH\000\022#\n\005" + + "token\030\002 \001(\0132\022.greptime.v1.TokenH\000B\r\n\013aut" + + "h_scheme\"+\n\005Basic\022\020\n\010username\030\001 \001(\t\022\020\n\010p" + + "assword\030\002 \001(\t\"\026\n\005Token\022\r\n\005token\030\001 \001(\t\"\035\n" + + "\014AffectedRows\022\r\n\005value\030\001 \001(\r\"B\n\016FlightMe" + + "tadata\0220\n\raffected_rows\030\001 \001(\0132\031.greptime" + + ".v1.AffectedRows\"I\n\024IntervalMonthDayNano" + + "\022\016\n\006months\030\001 \001(\005\022\014\n\004days\030\002 \001(\005\022\023\n\013nanose" + + "conds\030\003 \001(\003*1\n\014SemanticType\022\007\n\003TAG\020\000\022\t\n\005" + + "FIELD\020\001\022\r\n\tTIMESTAMP\020\002*\250\004\n\016ColumnDataTyp" + + "e\022\013\n\007BOOLEAN\020\000\022\010\n\004INT8\020\001\022\t\n\005INT16\020\002\022\t\n\005I" + + "NT32\020\003\022\t\n\005INT64\020\004\022\t\n\005UINT8\020\005\022\n\n\006UINT16\020\006" + + "\022\n\n\006UINT32\020\007\022\n\n\006UINT64\020\010\022\013\n\007FLOAT32\020\t\022\013\n" + + "\007FLOAT64\020\n\022\n\n\006BINARY\020\013\022\n\n\006STRING\020\014\022\010\n\004DA" + + "TE\020\r\022\014\n\010DATETIME\020\016\022\024\n\020TIMESTAMP_SECOND\020\017" + + "\022\031\n\025TIMESTAMP_MILLISECOND\020\020\022\031\n\025TIMESTAMP" + + "_MICROSECOND\020\021\022\030\n\024TIMESTAMP_NANOSECOND\020\022" + + "\022\017\n\013TIME_SECOND\020\023\022\024\n\020TIME_MILLISECOND\020\024\022" + + "\024\n\020TIME_MICROSECOND\020\025\022\023\n\017TIME_NANOSECOND" + + "\020\026\022\027\n\023INTERVAL_YEAR_MONTH\020\027\022\025\n\021INTERVAL_" + + "DAY_TIME\020\030\022\033\n\027INTERVAL_MONTH_DAY_NANO\020\031\022" + + "\023\n\017DURATION_SECOND\020\032\022\030\n\024DURATION_MILLISE" + + "COND\020\033\022\030\n\024DURATION_MICROSECOND\020\034\022\027\n\023DURA" + + "TION_NANOSECOND\020\035BO\n\016io.greptime.v1B\006Com" + + "monZ5github.com/GreptimeTeam/greptime-pr" + + "oto/go/greptime/v1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -7280,7 +7510,13 @@ public io.greptime.v1.Common.IntervalMonthDayNano getDefaultInstanceForType() { internal_static_greptime_v1_RequestHeader_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_greptime_v1_RequestHeader_descriptor, - new java.lang.String[] { "Catalog", "Schema", "Authorization", "Dbname", "TraceId", "SpanId", }); + new java.lang.String[] { "Catalog", "Schema", "Authorization", "Dbname", "TracingContext", }); + internal_static_greptime_v1_RequestHeader_TracingContextEntry_descriptor = + internal_static_greptime_v1_RequestHeader_descriptor.getNestedTypes().get(0); + internal_static_greptime_v1_RequestHeader_TracingContextEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_greptime_v1_RequestHeader_TracingContextEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); internal_static_greptime_v1_ResponseHeader_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_greptime_v1_ResponseHeader_fieldAccessorTable = new diff --git a/java/src/main/java/io/greptime/v1/region/Server.java b/java/src/main/java/io/greptime/v1/region/Server.java index ce5bb244..e763d4b8 100644 --- a/java/src/main/java/io/greptime/v1/region/Server.java +++ b/java/src/main/java/io/greptime/v1/region/Server.java @@ -20,23 +20,59 @@ public interface RegionRequestHeaderOrBuilder extends /** *
-     * TraceID of request
+     * Encoded trace_id & span_id, follow the w3c Trace Context https://www.w3.org/TR/trace-context/#header-name
      * 
* - * uint64 trace_id = 1; - * @return The traceId. + * map<string, string> tracing_context = 5; + */ + 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 = 5; + */ + 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 = 5; + */ + 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 = 5; */ - long getTraceId(); + /* nullable */ +java.lang.String getTracingContextOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); /** *
-     * SpanID of request
+     * Encoded trace_id & span_id, follow the w3c Trace Context https://www.w3.org/TR/trace-context/#header-name
      * 
* - * uint64 span_id = 2; - * @return The spanId. + * map<string, string> tracing_context = 5; */ - long getSpanId(); + + java.lang.String getTracingContextOrThrow( + java.lang.String key); /** *
@@ -94,6 +130,7 @@ private RegionRequestHeader(
       if (extensionRegistry == null) {
         throw new java.lang.NullPointerException();
       }
+      int mutable_bitField0_ = 0;
       com.google.protobuf.UnknownFieldSet.Builder unknownFields =
           com.google.protobuf.UnknownFieldSet.newBuilder();
       try {
@@ -104,22 +141,25 @@ private RegionRequestHeader(
             case 0:
               done = true;
               break;
-            case 8: {
-
-              traceId_ = input.readUInt64();
-              break;
-            }
-            case 16: {
-
-              spanId_ = input.readUInt64();
-              break;
-            }
             case 26: {
               java.lang.String s = input.readStringRequireUtf8();
 
               dbname_ = s;
               break;
             }
+            case 42: {
+              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)) {
@@ -146,6 +186,18 @@ private RegionRequestHeader(
       return io.greptime.v1.region.Server.internal_static_greptime_v1_region_RegionRequestHeader_descriptor;
     }
 
+    @SuppressWarnings({"rawtypes"})
+    @java.lang.Override
+    protected com.google.protobuf.MapField internalGetMapField(
+        int number) {
+      switch (number) {
+        case 5:
+          return internalGetTracingContext();
+        default:
+          throw new RuntimeException(
+              "Invalid map field number: " + number);
+      }
+    }
     @java.lang.Override
     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
         internalGetFieldAccessorTable() {
@@ -154,34 +206,101 @@ private RegionRequestHeader(
               io.greptime.v1.region.Server.RegionRequestHeader.class, io.greptime.v1.region.Server.RegionRequestHeader.Builder.class);
     }
 
-    public static final int TRACE_ID_FIELD_NUMBER = 1;
-    private long traceId_;
+    public static final int TRACING_CONTEXT_FIELD_NUMBER = 5;
+    private static final class TracingContextDefaultEntryHolder {
+      static final com.google.protobuf.MapEntry<
+          java.lang.String, java.lang.String> defaultEntry =
+              com.google.protobuf.MapEntry
+              .newDefaultInstance(
+                  io.greptime.v1.region.Server.internal_static_greptime_v1_region_RegionRequestHeader_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();
+    }
     /**
      * 
-     * TraceID of request
+     * Encoded trace_id & span_id, follow the w3c Trace Context https://www.w3.org/TR/trace-context/#header-name
      * 
* - * uint64 trace_id = 1; - * @return The traceId. + * map<string, string> tracing_context = 5; + */ + + @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 - public long getTraceId() { - return traceId_; + @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 = 5; + */ + @java.lang.Override - public static final int SPAN_ID_FIELD_NUMBER = 2; - private long spanId_; + public java.util.Map getTracingContextMap() { + return internalGetTracingContext().getMap(); + } /** *
-     * SpanID of request
+     * Encoded trace_id & span_id, follow the w3c Trace Context https://www.w3.org/TR/trace-context/#header-name
      * 
* - * uint64 span_id = 2; - * @return The spanId. + * map<string, string> tracing_context = 5; */ @java.lang.Override - public long getSpanId() { - return spanId_; + + 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 = 5; + */ + @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 static final int DBNAME_FIELD_NUMBER = 3; @@ -244,15 +363,15 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (traceId_ != 0L) { - output.writeUInt64(1, traceId_); - } - if (spanId_ != 0L) { - output.writeUInt64(2, spanId_); - } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dbname_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, dbname_); } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetTracingContext(), + TracingContextDefaultEntryHolder.defaultEntry, + 5); unknownFields.writeTo(output); } @@ -262,17 +381,19 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (traceId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, traceId_); - } - if (spanId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(2, spanId_); - } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dbname_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, dbname_); } + 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(5, tracingContext__); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -288,10 +409,8 @@ public boolean equals(final java.lang.Object obj) { } io.greptime.v1.region.Server.RegionRequestHeader other = (io.greptime.v1.region.Server.RegionRequestHeader) obj; - if (getTraceId() - != other.getTraceId()) return false; - if (getSpanId() - != other.getSpanId()) return false; + if (!internalGetTracingContext().equals( + other.internalGetTracingContext())) return false; if (!getDbname() .equals(other.getDbname())) return false; if (!unknownFields.equals(other.unknownFields)) return false; @@ -305,12 +424,10 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TRACE_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTraceId()); - hash = (37 * hash) + SPAN_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getSpanId()); + if (!internalGetTracingContext().getMap().isEmpty()) { + hash = (37 * hash) + TRACING_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + internalGetTracingContext().hashCode(); + } hash = (37 * hash) + DBNAME_FIELD_NUMBER; hash = (53 * hash) + getDbname().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); @@ -420,6 +537,28 @@ public static final class Builder extends return io.greptime.v1.region.Server.internal_static_greptime_v1_region_RegionRequestHeader_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetTracingContext(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 5: + return internalGetMutableTracingContext(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -446,10 +585,7 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); - traceId_ = 0L; - - spanId_ = 0L; - + internalGetMutableTracingContext().clear(); dbname_ = ""; return this; @@ -478,8 +614,9 @@ public io.greptime.v1.region.Server.RegionRequestHeader build() { @java.lang.Override public io.greptime.v1.region.Server.RegionRequestHeader buildPartial() { io.greptime.v1.region.Server.RegionRequestHeader result = new io.greptime.v1.region.Server.RegionRequestHeader(this); - result.traceId_ = traceId_; - result.spanId_ = spanId_; + int from_bitField0_ = bitField0_; + result.tracingContext_ = internalGetTracingContext(); + result.tracingContext_.makeImmutable(); result.dbname_ = dbname_; onBuilt(); return result; @@ -529,12 +666,8 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(io.greptime.v1.region.Server.RegionRequestHeader other) { if (other == io.greptime.v1.region.Server.RegionRequestHeader.getDefaultInstance()) return this; - if (other.getTraceId() != 0L) { - setTraceId(other.getTraceId()); - } - if (other.getSpanId() != 0L) { - setSpanId(other.getSpanId()); - } + internalGetMutableTracingContext().mergeFrom( + other.internalGetTracingContext()); if (!other.getDbname().isEmpty()) { dbname_ = other.dbname_; onChanged(); @@ -567,90 +700,164 @@ public Builder mergeFrom( } 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_; + } - private long traceId_ ; + public int getTracingContextCount() { + return internalGetTracingContext().getMap().size(); + } /** *
-       * TraceID of request
+       * Encoded trace_id & span_id, follow the w3c Trace Context https://www.w3.org/TR/trace-context/#header-name
        * 
* - * uint64 trace_id = 1; - * @return The traceId. + * map<string, string> tracing_context = 5; + */ + + @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 - public long getTraceId() { - return traceId_; + @java.lang.Deprecated + public java.util.Map getTracingContext() { + return getTracingContextMap(); } /** *
-       * TraceID of request
+       * Encoded trace_id & span_id, follow the w3c Trace Context https://www.w3.org/TR/trace-context/#header-name
        * 
* - * uint64 trace_id = 1; - * @param value The traceId to set. - * @return This builder for chaining. + * map<string, string> tracing_context = 5; */ - public Builder setTraceId(long value) { - - traceId_ = value; - onChanged(); - return this; + @java.lang.Override + + public java.util.Map getTracingContextMap() { + return internalGetTracingContext().getMap(); } /** *
-       * TraceID of request
+       * Encoded trace_id & span_id, follow the w3c Trace Context https://www.w3.org/TR/trace-context/#header-name
        * 
* - * uint64 trace_id = 1; - * @return This builder for chaining. + * map<string, string> tracing_context = 5; */ - public Builder clearTraceId() { - - traceId_ = 0L; - onChanged(); - return this; - } + @java.lang.Override - private long spanId_ ; + 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; + } /** *
-       * SpanID of request
+       * Encoded trace_id & span_id, follow the w3c Trace Context https://www.w3.org/TR/trace-context/#header-name
        * 
* - * uint64 span_id = 2; - * @return The spanId. + * map<string, string> tracing_context = 5; */ @java.lang.Override - public long getSpanId() { - return spanId_; + + 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; } /** *
-       * SpanID of request
+       * Encoded trace_id & span_id, follow the w3c Trace Context https://www.w3.org/TR/trace-context/#header-name
        * 
* - * uint64 span_id = 2; - * @param value The spanId to set. - * @return This builder for chaining. + * map<string, string> tracing_context = 5; */ - public Builder setSpanId(long value) { - - spanId_ = value; - onChanged(); + + 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(); + } /** *
-       * SpanID of request
+       * Encoded trace_id & span_id, follow the w3c Trace Context https://www.w3.org/TR/trace-context/#header-name
        * 
* - * uint64 span_id = 2; - * @return This builder for chaining. + * map<string, string> tracing_context = 5; */ - public Builder clearSpanId() { - - spanId_ = 0L; - onChanged(); + 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 = 5; + */ + + public Builder putAllTracingContext( + java.util.Map values) { + internalGetMutableTracingContext().getMutableMap() + .putAll(values); return this; } @@ -18756,6 +18963,11 @@ public io.greptime.v1.region.Server.RegionColumnDef getDefaultInstanceForType() private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_greptime_v1_region_RegionRequestHeader_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_greptime_v1_region_RegionRequestHeader_TracingContextEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_greptime_v1_region_RegionRequestHeader_TracingContextEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_greptime_v1_region_RegionRequest_descriptor; private static final @@ -18878,69 +19090,72 @@ public io.greptime.v1.region.Server.RegionColumnDef getDefaultInstanceForType() "\n\037greptime/v1/region/server.proto\022\022grept" + "ime.v1.region\032\030greptime/v1/common.proto\032" + "\025greptime/v1/row.proto\032\025greptime/v1/ddl." + - "proto\"H\n\023RegionRequestHeader\022\020\n\010trace_id" + - "\030\001 \001(\004\022\017\n\007span_id\030\002 \001(\004\022\016\n\006dbname\030\003 \001(\t\"" + - "\336\004\n\rRegionRequest\0227\n\006header\030\001 \001(\0132\'.grep" + - "time.v1.region.RegionRequestHeader\0225\n\007in" + - "serts\030\003 \001(\0132\".greptime.v1.region.InsertR" + - "equestsH\000\0225\n\007deletes\030\004 \001(\0132\".greptime.v1" + - ".region.DeleteRequestsH\000\0223\n\006create\030\005 \001(\013" + - "2!.greptime.v1.region.CreateRequestH\000\022/\n" + - "\004drop\030\006 \001(\0132\037.greptime.v1.region.DropReq" + - "uestH\000\022/\n\004open\030\007 \001(\0132\037.greptime.v1.regio" + - "n.OpenRequestH\000\0221\n\005close\030\010 \001(\0132 .greptim" + - "e.v1.region.CloseRequestH\000\0221\n\005alter\030\t \001(" + - "\0132 .greptime.v1.region.AlterRequestH\000\0221\n" + - "\005flush\030\n \001(\0132 .greptime.v1.region.FlushR" + - "equestH\000\0225\n\007compact\030\013 \001(\0132\".greptime.v1." + - "region.CompactRequestH\000\0227\n\010truncate\030\014 \001(" + - "\0132#.greptime.v1.region.TruncateRequestH\000" + - "B\006\n\004body\"T\n\016RegionResponse\022+\n\006header\030\001 \001" + - "(\0132\033.greptime.v1.ResponseHeader\022\025\n\raffec" + - "ted_rows\030\002 \001(\004\"E\n\016InsertRequests\0223\n\010requ" + - "ests\030\001 \003(\0132!.greptime.v1.region.InsertRe" + - "quest\"E\n\016DeleteRequests\0223\n\010requests\030\001 \003(" + - "\0132!.greptime.v1.region.DeleteRequest\"C\n\r" + - "InsertRequest\022\021\n\tregion_id\030\001 \001(\004\022\037\n\004rows" + - "\030\002 \001(\0132\021.greptime.v1.Rows\"C\n\rDeleteReque" + - "st\022\021\n\tregion_id\030\001 \001(\004\022\037\n\004rows\030\002 \001(\0132\021.gr" + - "eptime.v1.Rows\"h\n\014QueryRequest\0227\n\006header" + - "\030\001 \001(\0132\'.greptime.v1.region.RegionReques" + - "tHeader\022\021\n\tregion_id\030\002 \001(\004\022\014\n\004plan\030\003 \001(\014" + - "\"\200\002\n\rCreateRequest\022\021\n\tregion_id\030\001 \001(\004\022\016\n" + - "\006engine\030\002 \001(\t\0228\n\013column_defs\030\003 \003(\0132#.gre" + - "ptime.v1.region.RegionColumnDef\022\023\n\013prima" + - "ry_key\030\004 \003(\r\022\014\n\004path\030\005 \001(\t\022?\n\007options\030\006 " + - "\003(\0132..greptime.v1.region.CreateRequest.O" + - "ptionsEntry\032.\n\014OptionsEntry\022\013\n\003key\030\001 \001(\t" + - "\022\r\n\005value\030\002 \001(\t:\0028\001\" \n\013DropRequest\022\021\n\tre" + - "gion_id\030\001 \001(\004\"\255\001\n\013OpenRequest\022\021\n\tregion_" + - "id\030\001 \001(\004\022\016\n\006engine\030\002 \001(\t\022\014\n\004path\030\003 \001(\t\022=" + - "\n\007options\030\004 \003(\0132,.greptime.v1.region.Ope" + - "nRequest.OptionsEntry\032.\n\014OptionsEntry\022\013\n" + - "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"!\n\014CloseRe" + - "quest\022\021\n\tregion_id\030\001 \001(\004\"\261\001\n\014AlterReques" + - "t\022\021\n\tregion_id\030\001 \001(\004\0225\n\013add_columns\030\002 \001(" + - "\0132\036.greptime.v1.region.AddColumnsH\000\0227\n\014d" + - "rop_columns\030\003 \001(\0132\037.greptime.v1.region.D" + - "ropColumnsH\000\022\026\n\016schema_version\030\004 \001(\004B\006\n\004" + - "kind\"@\n\nAddColumns\0222\n\013add_columns\030\001 \003(\0132" + - "\035.greptime.v1.region.AddColumn\"C\n\013DropCo" + - "lumns\0224\n\014drop_columns\030\001 \003(\0132\036.greptime.v" + - "1.region.DropColumn\"v\n\tAddColumn\0227\n\ncolu" + - "mn_def\030\001 \001(\0132#.greptime.v1.region.Region" + - "ColumnDef\0220\n\010location\030\003 \001(\0132\036.greptime.v" + - "1.AddColumnLocation\"\032\n\nDropColumn\022\014\n\004nam" + - "e\030\001 \001(\t\"!\n\014FlushRequest\022\021\n\tregion_id\030\001 \001" + - "(\004\"#\n\016CompactRequest\022\021\n\tregion_id\030\001 \001(\004\"" + - "$\n\017TruncateRequest\022\021\n\tregion_id\030\001 \001(\004\"P\n" + - "\017RegionColumnDef\022*\n\ncolumn_def\030\001 \001(\0132\026.g" + - "reptime.v1.ColumnDef\022\021\n\tcolumn_id\030\002 \001(\r2" + - "Y\n\006Region\022O\n\006Handle\022!.greptime.v1.region" + - ".RegionRequest\032\".greptime.v1.region.Regi" + - "onResponseB]\n\025io.greptime.v1.regionB\006Ser" + - "verZ tracing_context = 5; } message ResponseHeader { Status status = 1; } diff --git a/proto/greptime/v1/meta/common.proto b/proto/greptime/v1/meta/common.proto index 4a344d33..216a770e 100644 --- a/proto/greptime/v1/meta/common.proto +++ b/proto/greptime/v1/meta/common.proto @@ -25,6 +25,9 @@ message RequestHeader { // member_id is the ID of the sender server. uint64 member_id = 3; Role role = 4; + // Encoded trace_id & span_id, follow the w3c Trace Context + // https://www.w3.org/TR/trace-context/#header-name + map tracing_context = 5; } enum Role { @@ -49,9 +52,7 @@ message Peer { string addr = 2; } -message TableId { - uint32 id = 1; -} +message TableId { uint32 id = 1; } message TableName { string catalog_name = 1; diff --git a/proto/greptime/v1/region/server.proto b/proto/greptime/v1/region/server.proto index 5191da28..75519565 100644 --- a/proto/greptime/v1/region/server.proto +++ b/proto/greptime/v1/region/server.proto @@ -27,10 +27,8 @@ import "greptime/v1/ddl.proto"; service Region { rpc Handle(RegionRequest) returns (RegionResponse); } message RegionRequestHeader { - // TraceID of request - uint64 trace_id = 1; - // SpanID of request - uint64 span_id = 2; + // Encoded trace_id & span_id, follow the w3c Trace Context https://www.w3.org/TR/trace-context/#header-name + map tracing_context = 5; // DB Name of request, tracking only string dbname = 3; } diff --git a/src/v1/meta.rs b/src/v1/meta.rs index 5e34eca8..b71ecbd3 100644 --- a/src/v1/meta.rs +++ b/src/v1/meta.rs @@ -59,12 +59,17 @@ impl Eq for Peer {} impl RequestHeader { #[inline] - pub fn new((cluster_id, member_id): (u64, u64), role: Role) -> Self { + pub fn new( + (cluster_id, member_id): (u64, u64), + role: Role, + tracing_context: HashMap, + ) -> Self { Self { protocol_version: PROTOCOL_VERSION, cluster_id, member_id, role: role.into(), + tracing_context, } } } @@ -138,15 +143,25 @@ macro_rules! gen_set_header { ($req: ty) => { impl $req { #[inline] - pub fn set_header(&mut self, (cluster_id, member_id): (u64, u64), role: Role) { + pub fn set_header( + &mut self, + (cluster_id, member_id): (u64, u64), + role: Role, + tracing_context: HashMap, + ) { match self.header.as_mut() { Some(header) => { header.cluster_id = cluster_id; header.member_id = member_id; header.role = role.into(); + header.tracing_context = tracing_context; } None => { - self.header = Some(RequestHeader::new((cluster_id, member_id), role)); + self.header = Some(RequestHeader::new( + (cluster_id, member_id), + role, + tracing_context, + )); } } }