refactor: remove **all** unnecessary 'optional' notation (#91)

This commit is contained in:
zyy17
2023-08-30 11:08:14 +08:00
committed by GitHub
parent ec2d346e09
commit e8e228b026
14 changed files with 685 additions and 1114 deletions
+75 -108
View File
@@ -24,14 +24,13 @@ namespace greptime {
namespace v1 {
PROTOBUF_CONSTEXPR RequestHeader::RequestHeader(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_._has_bits_)*/{}
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_.catalog_)*/{&::_pbi::fixed_address_empty_string, ::_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_.span_id_)*/uint64_t{0u}
, /*decltype(_impl_._cached_size_)*/{}} {}
struct RequestHeaderDefaultTypeInternal {
PROTOBUF_CONSTEXPR RequestHeaderDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
@@ -173,7 +172,7 @@ static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2f
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, _impl_._has_bits_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::RequestHeader, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
@@ -185,12 +184,6 @@ const uint32_t TableStruct_greptime_2fv1_2fcommon_2eproto::offsets[] PROTOBUF_SE
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_),
~0u,
~0u,
~0u,
~0u,
0,
1,
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::ResponseHeader, _internal_metadata_),
~0u, // no _extensions_
@@ -265,16 +258,16 @@ 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, 12, -1, sizeof(::greptime::v1::RequestHeader)},
{ 18, -1, -1, sizeof(::greptime::v1::ResponseHeader)},
{ 25, -1, -1, sizeof(::greptime::v1::Status)},
{ 33, -1, -1, sizeof(::greptime::v1::AuthHeader)},
{ 42, -1, -1, sizeof(::greptime::v1::Basic)},
{ 50, -1, -1, sizeof(::greptime::v1::Token)},
{ 57, -1, -1, sizeof(::greptime::v1::AffectedRows)},
{ 64, -1, -1, sizeof(::greptime::v1::FlightMetadata)},
{ 71, -1, -1, sizeof(::greptime::v1::ColumnDef)},
{ 81, -1, -1, sizeof(::greptime::v1::IntervalMonthDayNano)},
{ 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::ColumnDef)},
{ 75, -1, -1, sizeof(::greptime::v1::IntervalMonthDayNano)},
};
static const ::_pb::Message* const file_default_instances[] = {
@@ -292,44 +285,43 @@ 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\""
"\266\001\n\rRequestHeader\022\017\n\007catalog\030\001 \001(\t\022\016\n\006sc"
"\223\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\025\n\010tr"
"ace_id\030\005 \001(\004H\000\210\001\001\022\024\n\007span_id\030\006 \001(\004H\001\210\001\001B"
"\013\n\t_trace_idB\n\n\010_span_id\"5\n\016ResponseHead"
"er\022#\n\006status\030\001 \001(\0132\023.greptime.v1.Status\""
".\n\006Status\022\023\n\013status_code\030\001 \001(\r\022\017\n\007err_ms"
"g\030\002 \001(\t\"e\n\nAuthHeader\022#\n\005basic\030\001 \001(\0132\022.g"
"reptime.v1.BasicH\000\022#\n\005token\030\002 \001(\0132\022.grep"
"time.v1.TokenH\000B\r\n\013auth_scheme\"+\n\005Basic\022"
"\020\n\010username\030\001 \001(\t\022\020\n\010password\030\002 \001(\t\"\026\n\005T"
"oken\022\r\n\005token\030\001 \001(\t\"\035\n\014AffectedRows\022\r\n\005v"
"alue\030\001 \001(\r\"B\n\016FlightMetadata\0220\n\raffected"
"_rows\030\001 \001(\0132\031.greptime.v1.AffectedRows\"y"
"\n\tColumnDef\022\014\n\004name\030\001 \001(\t\022-\n\010datatype\030\002 "
"\001(\0162\033.greptime.v1.ColumnDataType\022\023\n\013is_n"
"ullable\030\003 \001(\010\022\032\n\022default_constraint\030\004 \001("
"\014\"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\014"
"SemanticType\022\007\n\003TAG\020\000\022\t\n\005FIELD\020\001\022\r\n\tTIME"
"STAMP\020\002*\306\003\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\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\006B"
"INARY\020\013\022\n\n\006STRING\020\014\022\010\n\004DATE\020\r\022\014\n\010DATETIM"
"E\020\016\022\024\n\020TIMESTAMP_SECOND\020\017\022\031\n\025TIMESTAMP_M"
"ILLISECOND\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_MICROSE"
"COND\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\027I"
"NTERVAL_MONTH_DAY_NANO\020\031BO\n\016io.greptime."
"v1B\006CommonZ5github.com/GreptimeTeam/grep"
"time-proto/go/greptime/v1b\006proto3"
"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\"y\n\tColumnDef\022\014\n\004name\030\001 \001(\t\022-\n\010dataty"
"pe\030\002 \001(\0162\033.greptime.v1.ColumnDataType\022\023\n"
"\013is_nullable\030\003 \001(\010\022\032\n\022default_constraint"
"\030\004 \001(\014\"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"
"\tTIMESTAMP\020\002*\306\003\n\016ColumnDataType\022\013\n\007BOOLE"
"AN\020\000\022\010\n\004INT8\020\001\022\t\n\005INT16\020\002\022\t\n\005INT32\020\003\022\t\n\005"
"INT64\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\010DA"
"TETIME\020\016\022\024\n\020TIMESTAMP_SECOND\020\017\022\031\n\025TIMEST"
"AMP_MILLISECOND\020\020\022\031\n\025TIMESTAMP_MICROSECO"
"ND\020\021\022\030\n\024TIMESTAMP_NANOSECOND\020\022\022\017\n\013TIME_S"
"ECOND\020\023\022\024\n\020TIME_MILLISECOND\020\024\022\024\n\020TIME_MI"
"CROSECOND\020\025\022\023\n\017TIME_NANOSECOND\020\026\022\027\n\023INTE"
"RVAL_YEAR_MONTH\020\027\022\025\n\021INTERVAL_DAY_TIME\020\030"
"\022\033\n\027INTERVAL_MONTH_DAY_NANO\020\031BO\n\016io.grep"
"time.v1B\006CommonZ5github.com/GreptimeTeam"
"/greptime-proto/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, 1393, descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto,
false, false, 1358, descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto,
"greptime/v1/common.proto",
&descriptor_table_greptime_2fv1_2fcommon_2eproto_once, nullptr, 0, 10,
schemas, file_default_instances, TableStruct_greptime_2fv1_2fcommon_2eproto::offsets,
@@ -402,14 +394,7 @@ bool ColumnDataType_IsValid(int value) {
class RequestHeader::_Internal {
public:
using HasBits = decltype(std::declval<RequestHeader>()._impl_._has_bits_);
static const ::greptime::v1::AuthHeader& authorization(const RequestHeader* msg);
static void set_has_trace_id(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_span_id(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
};
const ::greptime::v1::AuthHeader&
@@ -426,14 +411,13 @@ RequestHeader::RequestHeader(const RequestHeader& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
RequestHeader* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){from._impl_._has_bits_}
, /*decltype(_impl_._cached_size_)*/{}
, decltype(_impl_.catalog_){}
decltype(_impl_.catalog_){}
, decltype(_impl_.schema_){}
, decltype(_impl_.dbname_){}
, decltype(_impl_.authorization_){nullptr}
, decltype(_impl_.trace_id_){}
, decltype(_impl_.span_id_){}};
, decltype(_impl_.span_id_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_impl_.catalog_.InitDefault();
@@ -474,14 +458,13 @@ inline void RequestHeader::SharedCtor(
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){}
, /*decltype(_impl_._cached_size_)*/{}
, decltype(_impl_.catalog_){}
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();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
@@ -531,19 +514,14 @@ void RequestHeader::Clear() {
delete _impl_.authorization_;
}
_impl_.authorization_ = nullptr;
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
::memset(&_impl_.trace_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&_impl_.span_id_) -
reinterpret_cast<char*>(&_impl_.trace_id_)) + sizeof(_impl_.span_id_));
}
_impl_._has_bits_.Clear();
::memset(&_impl_.trace_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&_impl_.span_id_) -
reinterpret_cast<char*>(&_impl_.trace_id_)) + sizeof(_impl_.span_id_));
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* RequestHeader::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
@@ -586,19 +564,17 @@ const char* RequestHeader::_InternalParse(const char* ptr, ::_pbi::ParseContext*
} else
goto handle_unusual;
continue;
// optional uint64 trace_id = 5;
// uint64 trace_id = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
_Internal::set_has_trace_id(&has_bits);
_impl_.trace_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// optional uint64 span_id = 6;
// uint64 span_id = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
_Internal::set_has_span_id(&has_bits);
_impl_.span_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else
@@ -620,7 +596,6 @@ const char* RequestHeader::_InternalParse(const char* ptr, ::_pbi::ParseContext*
CHK_(ptr != nullptr);
} // while
message_done:
_impl_._has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
@@ -671,14 +646,14 @@ uint8_t* RequestHeader::_InternalSerialize(
4, this->_internal_dbname(), target);
}
// optional uint64 trace_id = 5;
if (_internal_has_trace_id()) {
// uint64 trace_id = 5;
if (this->_internal_trace_id() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt64ToArray(5, this->_internal_trace_id(), target);
}
// optional uint64 span_id = 6;
if (_internal_has_span_id()) {
// uint64 span_id = 6;
if (this->_internal_span_id() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt64ToArray(6, this->_internal_span_id(), target);
}
@@ -727,19 +702,16 @@ size_t RequestHeader::ByteSizeLong() const {
*_impl_.authorization_);
}
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
// optional uint64 trace_id = 5;
if (cached_has_bits & 0x00000001u) {
total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_trace_id());
}
// optional uint64 span_id = 6;
if (cached_has_bits & 0x00000002u) {
total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_span_id());
}
// 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_);
}
@@ -771,15 +743,11 @@ void RequestHeader::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::
_this->_internal_mutable_authorization()->::greptime::v1::AuthHeader::MergeFrom(
from._internal_authorization());
}
cached_has_bits = from._impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
_this->_impl_.trace_id_ = from._impl_.trace_id_;
}
if (cached_has_bits & 0x00000002u) {
_this->_impl_.span_id_ = from._impl_.span_id_;
}
_this->_impl_._has_bits_[0] |= cached_has_bits;
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_);
}
@@ -800,7 +768,6 @@ void RequestHeader::InternalSwap(RequestHeader* other) {
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.catalog_, lhs_arena,
&other->_impl_.catalog_, rhs_arena
+7 -32
View File
@@ -359,11 +359,7 @@ class RequestHeader final :
::greptime::v1::AuthHeader* authorization);
::greptime::v1::AuthHeader* unsafe_arena_release_authorization();
// optional uint64 trace_id = 5;
bool has_trace_id() const;
private:
bool _internal_has_trace_id() const;
public:
// uint64 trace_id = 5;
void clear_trace_id();
uint64_t trace_id() const;
void set_trace_id(uint64_t value);
@@ -372,11 +368,7 @@ class RequestHeader final :
void _internal_set_trace_id(uint64_t value);
public:
// optional uint64 span_id = 6;
bool has_span_id() const;
private:
bool _internal_has_span_id() const;
public:
// uint64 span_id = 6;
void clear_span_id();
uint64_t span_id() const;
void set_span_id(uint64_t value);
@@ -393,14 +385,13 @@ class RequestHeader final :
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::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_; };
friend struct ::TableStruct_greptime_2fv1_2fcommon_2eproto;
@@ -2161,17 +2152,9 @@ inline void RequestHeader::set_allocated_dbname(std::string* dbname) {
// @@protoc_insertion_point(field_set_allocated:greptime.v1.RequestHeader.dbname)
}
// optional uint64 trace_id = 5;
inline bool RequestHeader::_internal_has_trace_id() const {
bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
return value;
}
inline bool RequestHeader::has_trace_id() const {
return _internal_has_trace_id();
}
// uint64 trace_id = 5;
inline void RequestHeader::clear_trace_id() {
_impl_.trace_id_ = uint64_t{0u};
_impl_._has_bits_[0] &= ~0x00000001u;
}
inline uint64_t RequestHeader::_internal_trace_id() const {
return _impl_.trace_id_;
@@ -2181,7 +2164,7 @@ inline uint64_t RequestHeader::trace_id() const {
return _internal_trace_id();
}
inline void RequestHeader::_internal_set_trace_id(uint64_t value) {
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.trace_id_ = value;
}
inline void RequestHeader::set_trace_id(uint64_t value) {
@@ -2189,17 +2172,9 @@ inline void RequestHeader::set_trace_id(uint64_t value) {
// @@protoc_insertion_point(field_set:greptime.v1.RequestHeader.trace_id)
}
// optional uint64 span_id = 6;
inline bool RequestHeader::_internal_has_span_id() const {
bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0;
return value;
}
inline bool RequestHeader::has_span_id() const {
return _internal_has_span_id();
}
// uint64 span_id = 6;
inline void RequestHeader::clear_span_id() {
_impl_.span_id_ = uint64_t{0u};
_impl_._has_bits_[0] &= ~0x00000002u;
}
inline uint64_t RequestHeader::_internal_span_id() const {
return _impl_.span_id_;
@@ -2209,7 +2184,7 @@ inline uint64_t RequestHeader::span_id() const {
return _internal_span_id();
}
inline void RequestHeader::_internal_set_span_id(uint64_t value) {
_impl_._has_bits_[0] |= 0x00000002u;
_impl_.span_id_ = value;
}
inline void RequestHeader::set_span_id(uint64_t value) {
+67 -103
View File
@@ -109,13 +109,12 @@ struct DropTableExprDefaultTypeInternal {
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DropTableExprDefaultTypeInternal _DropTableExpr_default_instance_;
PROTOBUF_CONSTEXPR FlushTableExpr::FlushTableExpr(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_._has_bits_)*/{}
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_.catalog_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
/*decltype(_impl_.catalog_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.schema_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.table_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.table_id_)*/nullptr
, /*decltype(_impl_.region_number_)*/0u} {}
, /*decltype(_impl_.region_number_)*/0u
, /*decltype(_impl_._cached_size_)*/{}} {}
struct FlushTableExprDefaultTypeInternal {
PROTOBUF_CONSTEXPR FlushTableExprDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
@@ -127,12 +126,11 @@ struct FlushTableExprDefaultTypeInternal {
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FlushTableExprDefaultTypeInternal _FlushTableExpr_default_instance_;
PROTOBUF_CONSTEXPR CompactTableExpr::CompactTableExpr(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_._has_bits_)*/{}
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_.catalog_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
/*decltype(_impl_.catalog_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.schema_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.table_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.region_number_)*/0u} {}
, /*decltype(_impl_.region_number_)*/0u
, /*decltype(_impl_._cached_size_)*/{}} {}
struct CompactTableExprDefaultTypeInternal {
PROTOBUF_CONSTEXPR CompactTableExprDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
@@ -340,7 +338,7 @@ const uint32_t TableStruct_greptime_2fv1_2fddl_2eproto::offsets[] PROTOBUF_SECTI
PROTOBUF_FIELD_OFFSET(::greptime::v1::DropTableExpr, _impl_.schema_name_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::DropTableExpr, _impl_.table_name_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::DropTableExpr, _impl_.table_id_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::FlushTableExpr, _impl_._has_bits_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::FlushTableExpr, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
@@ -351,12 +349,7 @@ const uint32_t TableStruct_greptime_2fv1_2fddl_2eproto::offsets[] PROTOBUF_SECTI
PROTOBUF_FIELD_OFFSET(::greptime::v1::FlushTableExpr, _impl_.table_name_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::FlushTableExpr, _impl_.region_number_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::FlushTableExpr, _impl_.table_id_),
~0u,
~0u,
~0u,
0,
~0u,
PROTOBUF_FIELD_OFFSET(::greptime::v1::CompactTableExpr, _impl_._has_bits_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::CompactTableExpr, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
@@ -366,10 +359,6 @@ const uint32_t TableStruct_greptime_2fv1_2fddl_2eproto::offsets[] PROTOBUF_SECTI
PROTOBUF_FIELD_OFFSET(::greptime::v1::CompactTableExpr, _impl_.schema_name_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::CompactTableExpr, _impl_.table_name_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::CompactTableExpr, _impl_.region_number_),
~0u,
~0u,
~0u,
0,
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::CreateDatabaseExpr, _internal_metadata_),
~0u, // no _extensions_
@@ -447,17 +436,17 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode
{ 24, -1, -1, sizeof(::greptime::v1::CreateTableExpr)},
{ 42, -1, -1, sizeof(::greptime::v1::AlterExpr)},
{ 57, -1, -1, sizeof(::greptime::v1::DropTableExpr)},
{ 67, 78, -1, sizeof(::greptime::v1::FlushTableExpr)},
{ 83, 93, -1, sizeof(::greptime::v1::CompactTableExpr)},
{ 97, -1, -1, sizeof(::greptime::v1::CreateDatabaseExpr)},
{ 105, -1, -1, sizeof(::greptime::v1::TruncateTableExpr)},
{ 115, -1, -1, sizeof(::greptime::v1::AddColumns)},
{ 122, -1, -1, sizeof(::greptime::v1::DropColumns)},
{ 129, -1, -1, sizeof(::greptime::v1::RenameTable)},
{ 136, -1, -1, sizeof(::greptime::v1::AddColumn_Location)},
{ 144, -1, -1, sizeof(::greptime::v1::AddColumn)},
{ 153, -1, -1, sizeof(::greptime::v1::DropColumn)},
{ 160, -1, -1, sizeof(::greptime::v1::TableId)},
{ 67, -1, -1, sizeof(::greptime::v1::FlushTableExpr)},
{ 78, -1, -1, sizeof(::greptime::v1::CompactTableExpr)},
{ 88, -1, -1, sizeof(::greptime::v1::CreateDatabaseExpr)},
{ 96, -1, -1, sizeof(::greptime::v1::TruncateTableExpr)},
{ 106, -1, -1, sizeof(::greptime::v1::AddColumns)},
{ 113, -1, -1, sizeof(::greptime::v1::DropColumns)},
{ 120, -1, -1, sizeof(::greptime::v1::RenameTable)},
{ 127, -1, -1, sizeof(::greptime::v1::AddColumn_Location)},
{ 135, -1, -1, sizeof(::greptime::v1::AddColumn)},
{ 144, -1, -1, sizeof(::greptime::v1::DropColumn)},
{ 151, -1, -1, sizeof(::greptime::v1::TableId)},
};
static const ::_pb::Message* const file_default_instances[] = {
@@ -512,40 +501,39 @@ const char descriptor_table_protodef_greptime_2fv1_2fddl_2eproto[] PROTOBUF_SECT
"(\004B\006\n\004kind\"v\n\rDropTableExpr\022\024\n\014catalog_n"
"ame\030\001 \001(\t\022\023\n\013schema_name\030\002 \001(\t\022\022\n\ntable_"
"name\030\003 \001(\t\022&\n\010table_id\030\004 \001(\0132\024.greptime."
"v1.TableId\"\245\001\n\016FlushTableExpr\022\024\n\014catalog"
"v1.TableId\"\216\001\n\016FlushTableExpr\022\024\n\014catalog"
"_name\030\001 \001(\t\022\023\n\013schema_name\030\002 \001(\t\022\022\n\ntabl"
"e_name\030\003 \001(\t\022\032\n\rregion_number\030\004 \001(\rH\000\210\001\001"
"\022&\n\010table_id\030\005 \001(\0132\024.greptime.v1.TableId"
"B\020\n\016_region_number\"\177\n\020CompactTableExpr\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\022\032\n\rregion_number\030\004"
" \001(\rH\000\210\001\001B\020\n\016_region_number\"I\n\022CreateDat"
"abaseExpr\022\025\n\rdatabase_name\030\001 \001(\t\022\034\n\024crea"
"te_if_not_exists\030\002 \001(\010\"z\n\021TruncateTableE"
"xpr\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\022&\n\010table_id\030\004"
" \001(\0132\024.greptime.v1.TableId\"9\n\nAddColumns"
"\022+\n\013add_columns\030\001 \003(\0132\026.greptime.v1.AddC"
"olumn\"<\n\013DropColumns\022-\n\014drop_columns\030\001 \003"
"(\0132\027.greptime.v1.DropColumn\"%\n\013RenameTab"
"le\022\026\n\016new_table_name\030\001 \001(\t\"\215\002\n\tAddColumn"
"\022*\n\ncolumn_def\030\001 \001(\0132\026.greptime.v1.Colum"
"nDef\022\016\n\006is_key\030\002 \001(\010\0221\n\010location\030\003 \001(\0132\037"
".greptime.v1.AddColumn.Location\032\220\001\n\010Loca"
"tion\022C\n\rlocation_type\030\001 \001(\0162,.greptime.v"
"1.AddColumn.Location.LocationType\022\031\n\021aft"
"er_cloumn_name\030\002 \001(\t\"$\n\014LocationType\022\t\n\005"
"FIRST\020\000\022\t\n\005AFTER\020\001\"\032\n\nDropColumn\022\014\n\004name"
"\030\001 \001(\t\"\025\n\007TableId\022\n\n\002id\030\001 \001(\rBL\n\016io.grep"
"time.v1B\003DdlZ5github.com/GreptimeTeam/gr"
"eptime-proto/go/greptime/v1b\006proto3"
"e_name\030\003 \001(\t\022\025\n\rregion_number\030\004 \001(\r\022&\n\010t"
"able_id\030\005 \001(\0132\024.greptime.v1.TableId\"h\n\020C"
"ompactTableExpr\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\022\025"
"\n\rregion_number\030\004 \001(\r\"I\n\022CreateDatabaseE"
"xpr\022\025\n\rdatabase_name\030\001 \001(\t\022\034\n\024create_if_"
"not_exists\030\002 \001(\010\"z\n\021TruncateTableExpr\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\022&\n\010table_id\030\004 \001(\0132\024"
".greptime.v1.TableId\"9\n\nAddColumns\022+\n\013ad"
"d_columns\030\001 \003(\0132\026.greptime.v1.AddColumn\""
"<\n\013DropColumns\022-\n\014drop_columns\030\001 \003(\0132\027.g"
"reptime.v1.DropColumn\"%\n\013RenameTable\022\026\n\016"
"new_table_name\030\001 \001(\t\"\215\002\n\tAddColumn\022*\n\nco"
"lumn_def\030\001 \001(\0132\026.greptime.v1.ColumnDef\022\016"
"\n\006is_key\030\002 \001(\010\0221\n\010location\030\003 \001(\0132\037.grept"
"ime.v1.AddColumn.Location\032\220\001\n\010Location\022C"
"\n\rlocation_type\030\001 \001(\0162,.greptime.v1.AddC"
"olumn.Location.LocationType\022\031\n\021after_clo"
"umn_name\030\002 \001(\t\"$\n\014LocationType\022\t\n\005FIRST\020"
"\000\022\t\n\005AFTER\020\001\"\032\n\nDropColumn\022\014\n\004name\030\001 \001(\t"
"\"\025\n\007TableId\022\n\n\002id\030\001 \001(\rBL\n\016io.greptime.v"
"1B\003DdlZ5github.com/GreptimeTeam/greptime"
"-proto/go/greptime/v1b\006proto3"
;
static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2fddl_2eproto_deps[1] = {
&::descriptor_table_greptime_2fv1_2fcommon_2eproto,
};
static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fddl_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fddl_2eproto = {
false, false, 2355, descriptor_table_protodef_greptime_2fv1_2fddl_2eproto,
false, false, 2309, descriptor_table_protodef_greptime_2fv1_2fddl_2eproto,
"greptime/v1/ddl.proto",
&descriptor_table_greptime_2fv1_2fddl_2eproto_once, descriptor_table_greptime_2fv1_2fddl_2eproto_deps, 1, 16,
schemas, file_default_instances, TableStruct_greptime_2fv1_2fddl_2eproto::offsets,
@@ -2840,10 +2828,6 @@ void DropTableExpr::InternalSwap(DropTableExpr* other) {
class FlushTableExpr::_Internal {
public:
using HasBits = decltype(std::declval<FlushTableExpr>()._impl_._has_bits_);
static void set_has_region_number(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static const ::greptime::v1::TableId& table_id(const FlushTableExpr* msg);
};
@@ -2861,13 +2845,12 @@ FlushTableExpr::FlushTableExpr(const FlushTableExpr& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
FlushTableExpr* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){from._impl_._has_bits_}
, /*decltype(_impl_._cached_size_)*/{}
, decltype(_impl_.catalog_name_){}
decltype(_impl_.catalog_name_){}
, decltype(_impl_.schema_name_){}
, decltype(_impl_.table_name_){}
, decltype(_impl_.table_id_){nullptr}
, decltype(_impl_.region_number_){}};
, decltype(_impl_.region_number_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_impl_.catalog_name_.InitDefault();
@@ -2906,13 +2889,12 @@ inline void FlushTableExpr::SharedCtor(
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){}
, /*decltype(_impl_._cached_size_)*/{}
, decltype(_impl_.catalog_name_){}
decltype(_impl_.catalog_name_){}
, decltype(_impl_.schema_name_){}
, decltype(_impl_.table_name_){}
, decltype(_impl_.table_id_){nullptr}
, decltype(_impl_.region_number_){0u}
, /*decltype(_impl_._cached_size_)*/{}
};
_impl_.catalog_name_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
@@ -2963,13 +2945,11 @@ void FlushTableExpr::Clear() {
}
_impl_.table_id_ = nullptr;
_impl_.region_number_ = 0u;
_impl_._has_bits_.Clear();
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* FlushTableExpr::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
@@ -3004,10 +2984,9 @@ const char* FlushTableExpr::_InternalParse(const char* ptr, ::_pbi::ParseContext
} else
goto handle_unusual;
continue;
// optional uint32 region_number = 4;
// uint32 region_number = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
_Internal::set_has_region_number(&has_bits);
_impl_.region_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
@@ -3037,7 +3016,6 @@ const char* FlushTableExpr::_InternalParse(const char* ptr, ::_pbi::ParseContext
CHK_(ptr != nullptr);
} // while
message_done:
_impl_._has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
@@ -3081,8 +3059,8 @@ uint8_t* FlushTableExpr::_InternalSerialize(
3, this->_internal_table_name(), target);
}
// optional uint32 region_number = 4;
if (_internal_has_region_number()) {
// uint32 region_number = 4;
if (this->_internal_region_number() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_region_number(), target);
}
@@ -3138,9 +3116,8 @@ size_t FlushTableExpr::ByteSizeLong() const {
*_impl_.table_id_);
}
// optional uint32 region_number = 4;
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
// uint32 region_number = 4;
if (this->_internal_region_number() != 0) {
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_region_number());
}
@@ -3175,7 +3152,7 @@ void FlushTableExpr::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const :
_this->_internal_mutable_table_id()->::greptime::v1::TableId::MergeFrom(
from._internal_table_id());
}
if (from._internal_has_region_number()) {
if (from._internal_region_number() != 0) {
_this->_internal_set_region_number(from._internal_region_number());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
@@ -3197,7 +3174,6 @@ void FlushTableExpr::InternalSwap(FlushTableExpr* other) {
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.catalog_name_, lhs_arena,
&other->_impl_.catalog_name_, rhs_arena
@@ -3228,10 +3204,6 @@ void FlushTableExpr::InternalSwap(FlushTableExpr* other) {
class CompactTableExpr::_Internal {
public:
using HasBits = decltype(std::declval<CompactTableExpr>()._impl_._has_bits_);
static void set_has_region_number(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
CompactTableExpr::CompactTableExpr(::PROTOBUF_NAMESPACE_ID::Arena* arena,
@@ -3244,12 +3216,11 @@ CompactTableExpr::CompactTableExpr(const CompactTableExpr& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
CompactTableExpr* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){from._impl_._has_bits_}
, /*decltype(_impl_._cached_size_)*/{}
, decltype(_impl_.catalog_name_){}
decltype(_impl_.catalog_name_){}
, decltype(_impl_.schema_name_){}
, decltype(_impl_.table_name_){}
, decltype(_impl_.region_number_){}};
, decltype(_impl_.region_number_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_impl_.catalog_name_.InitDefault();
@@ -3285,12 +3256,11 @@ inline void CompactTableExpr::SharedCtor(
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){}
, /*decltype(_impl_._cached_size_)*/{}
, decltype(_impl_.catalog_name_){}
decltype(_impl_.catalog_name_){}
, decltype(_impl_.schema_name_){}
, decltype(_impl_.table_name_){}
, decltype(_impl_.region_number_){0u}
, /*decltype(_impl_._cached_size_)*/{}
};
_impl_.catalog_name_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
@@ -3336,13 +3306,11 @@ void CompactTableExpr::Clear() {
_impl_.schema_name_.ClearToEmpty();
_impl_.table_name_.ClearToEmpty();
_impl_.region_number_ = 0u;
_impl_._has_bits_.Clear();
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* CompactTableExpr::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
@@ -3377,10 +3345,9 @@ const char* CompactTableExpr::_InternalParse(const char* ptr, ::_pbi::ParseConte
} else
goto handle_unusual;
continue;
// optional uint32 region_number = 4;
// uint32 region_number = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
_Internal::set_has_region_number(&has_bits);
_impl_.region_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
@@ -3402,7 +3369,6 @@ const char* CompactTableExpr::_InternalParse(const char* ptr, ::_pbi::ParseConte
CHK_(ptr != nullptr);
} // while
message_done:
_impl_._has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
@@ -3446,8 +3412,8 @@ uint8_t* CompactTableExpr::_InternalSerialize(
3, this->_internal_table_name(), target);
}
// optional uint32 region_number = 4;
if (_internal_has_region_number()) {
// uint32 region_number = 4;
if (this->_internal_region_number() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_region_number(), target);
}
@@ -3489,9 +3455,8 @@ size_t CompactTableExpr::ByteSizeLong() const {
this->_internal_table_name());
}
// optional uint32 region_number = 4;
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
// uint32 region_number = 4;
if (this->_internal_region_number() != 0) {
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_region_number());
}
@@ -3522,7 +3487,7 @@ void CompactTableExpr::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const
if (!from._internal_table_name().empty()) {
_this->_internal_set_table_name(from._internal_table_name());
}
if (from._internal_has_region_number()) {
if (from._internal_region_number() != 0) {
_this->_internal_set_region_number(from._internal_region_number());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
@@ -3544,7 +3509,6 @@ void CompactTableExpr::InternalSwap(CompactTableExpr* other) {
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.catalog_name_, lhs_arena,
&other->_impl_.catalog_name_, rhs_arena
+8 -34
View File
@@ -1533,11 +1533,7 @@ class FlushTableExpr final :
::greptime::v1::TableId* table_id);
::greptime::v1::TableId* unsafe_arena_release_table_id();
// optional uint32 region_number = 4;
bool has_region_number() const;
private:
bool _internal_has_region_number() const;
public:
// uint32 region_number = 4;
void clear_region_number();
uint32_t region_number() const;
void set_region_number(uint32_t value);
@@ -1554,13 +1550,12 @@ class FlushTableExpr final :
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr catalog_name_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr schema_name_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr table_name_;
::greptime::v1::TableId* table_id_;
uint32_t region_number_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_greptime_2fv1_2fddl_2eproto;
@@ -1735,11 +1730,7 @@ class CompactTableExpr final :
std::string* _internal_mutable_table_name();
public:
// optional uint32 region_number = 4;
bool has_region_number() const;
private:
bool _internal_has_region_number() const;
public:
// uint32 region_number = 4;
void clear_region_number();
uint32_t region_number() const;
void set_region_number(uint32_t value);
@@ -1756,12 +1747,11 @@ class CompactTableExpr final :
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr catalog_name_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr schema_name_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr table_name_;
uint32_t region_number_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_greptime_2fv1_2fddl_2eproto;
@@ -5322,17 +5312,9 @@ inline void FlushTableExpr::set_allocated_table_name(std::string* table_name) {
// @@protoc_insertion_point(field_set_allocated:greptime.v1.FlushTableExpr.table_name)
}
// optional uint32 region_number = 4;
inline bool FlushTableExpr::_internal_has_region_number() const {
bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
return value;
}
inline bool FlushTableExpr::has_region_number() const {
return _internal_has_region_number();
}
// uint32 region_number = 4;
inline void FlushTableExpr::clear_region_number() {
_impl_.region_number_ = 0u;
_impl_._has_bits_[0] &= ~0x00000001u;
}
inline uint32_t FlushTableExpr::_internal_region_number() const {
return _impl_.region_number_;
@@ -5342,7 +5324,7 @@ inline uint32_t FlushTableExpr::region_number() const {
return _internal_region_number();
}
inline void FlushTableExpr::_internal_set_region_number(uint32_t value) {
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.region_number_ = value;
}
inline void FlushTableExpr::set_region_number(uint32_t value) {
@@ -5594,17 +5576,9 @@ inline void CompactTableExpr::set_allocated_table_name(std::string* table_name)
// @@protoc_insertion_point(field_set_allocated:greptime.v1.CompactTableExpr.table_name)
}
// optional uint32 region_number = 4;
inline bool CompactTableExpr::_internal_has_region_number() const {
bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
return value;
}
inline bool CompactTableExpr::has_region_number() const {
return _internal_has_region_number();
}
// uint32 region_number = 4;
inline void CompactTableExpr::clear_region_number() {
_impl_.region_number_ = 0u;
_impl_._has_bits_[0] &= ~0x00000001u;
}
inline uint32_t CompactTableExpr::_internal_region_number() const {
return _impl_.region_number_;
@@ -5614,7 +5588,7 @@ inline uint32_t CompactTableExpr::region_number() const {
return _internal_region_number();
}
inline void CompactTableExpr::_internal_set_region_number(uint32_t value) {
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.region_number_ = value;
}
inline void CompactTableExpr::set_region_number(uint32_t value) {
+104 -132
View File
@@ -25,10 +25,9 @@ namespace v1 {
namespace region {
PROTOBUF_CONSTEXPR RegionRequestHeader::RegionRequestHeader(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_._has_bits_)*/{}
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_.trace_id_)*/uint64_t{0u}
, /*decltype(_impl_.span_id_)*/uint64_t{0u}} {}
/*decltype(_impl_.trace_id_)*/uint64_t{0u}
, /*decltype(_impl_.span_id_)*/uint64_t{0u}
, /*decltype(_impl_._cached_size_)*/{}} {}
struct RegionRequestHeaderDefaultTypeInternal {
PROTOBUF_CONSTEXPR RegionRequestHeaderDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
@@ -284,7 +283,7 @@ static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_grept
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, _impl_._has_bits_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::region::RegionRequestHeader, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
@@ -292,8 +291,6 @@ const uint32_t TableStruct_greptime_2fv1_2fregion_2fserver_2eproto::offsets[] PR
~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_),
0,
1,
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::region::RegionRequest, _internal_metadata_),
~0u, // no _extensions_
@@ -449,24 +446,24 @@ const uint32_t TableStruct_greptime_2fv1_2fregion_2fserver_2eproto::offsets[] PR
PROTOBUF_FIELD_OFFSET(::greptime::v1::region::ColumnDef, _impl_.semantic_type_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 8, -1, sizeof(::greptime::v1::region::RegionRequestHeader)},
{ 10, -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)},
{ 73, 81, -1, sizeof(::greptime::v1::region::CreateRequest_OptionsEntry_DoNotUse)},
{ 83, -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)},
{ 137, -1, -1, sizeof(::greptime::v1::region::FlushRequest)},
{ 144, -1, -1, sizeof(::greptime::v1::region::CompactRequest)},
{ 151, -1, -1, sizeof(::greptime::v1::region::ColumnDef)},
{ 0, -1, -1, sizeof(::greptime::v1::region::RegionRequestHeader)},
{ 8, -1, -1, sizeof(::greptime::v1::region::RegionRequest)},
{ 25, -1, -1, sizeof(::greptime::v1::region::RegionResponse)},
{ 33, -1, -1, sizeof(::greptime::v1::region::InsertRequests)},
{ 40, -1, -1, sizeof(::greptime::v1::region::DeleteRequests)},
{ 47, -1, -1, sizeof(::greptime::v1::region::InsertRequest)},
{ 55, -1, -1, sizeof(::greptime::v1::region::DeleteRequest)},
{ 63, -1, -1, sizeof(::greptime::v1::region::QueryRequest)},
{ 71, 79, -1, sizeof(::greptime::v1::region::CreateRequest_OptionsEntry_DoNotUse)},
{ 81, -1, -1, sizeof(::greptime::v1::region::CreateRequest)},
{ 94, -1, -1, sizeof(::greptime::v1::region::DropRequest)},
{ 101, 109, -1, sizeof(::greptime::v1::region::OpenRequest_OptionsEntry_DoNotUse)},
{ 111, -1, -1, sizeof(::greptime::v1::region::OpenRequest)},
{ 121, -1, -1, sizeof(::greptime::v1::region::CloseRequest)},
{ 128, -1, -1, sizeof(::greptime::v1::region::AlterRequest)},
{ 135, -1, -1, sizeof(::greptime::v1::region::FlushRequest)},
{ 142, -1, -1, sizeof(::greptime::v1::region::CompactRequest)},
{ 149, -1, -1, sizeof(::greptime::v1::region::ColumnDef)},
};
static const ::_pb::Message* const file_default_instances[] = {
@@ -493,59 +490,59 @@ static const ::_pb::Message* const file_default_instances[] = {
const char descriptor_table_protodef_greptime_2fv1_2fregion_2fserver_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\037greptime/v1/region/server.proto\022\022grept"
"ime.v1.region\032\030greptime/v1/common.proto\032"
"\025greptime/v1/row.proto\"[\n\023RegionRequestH"
"eader\022\025\n\010trace_id\030\001 \001(\004H\000\210\001\001\022\024\n\007span_id\030"
"\002 \001(\004H\001\210\001\001B\013\n\t_trace_idB\n\n\010_span_id\"\245\004\n\r"
"RegionRequest\0227\n\006header\030\001 \001(\0132\'.greptime"
".v1.region.RegionRequestHeader\0225\n\007insert"
"s\030\003 \001(\0132\".greptime.v1.region.InsertReque"
"stsH\000\0225\n\007deletes\030\004 \001(\0132\".greptime.v1.reg"
"ion.DeleteRequestsH\000\0223\n\006create\030\005 \001(\0132!.g"
"reptime.v1.region.CreateRequestH\000\022/\n\004dro"
"p\030\006 \001(\0132\037.greptime.v1.region.DropRequest"
"H\000\022/\n\004open\030\007 \001(\0132\037.greptime.v1.region.Op"
"enRequestH\000\0221\n\005close\030\010 \001(\0132 .greptime.v1"
".region.CloseRequestH\000\0221\n\005alter\030\t \001(\0132 ."
"greptime.v1.region.AlterRequestH\000\0221\n\005flu"
"sh\030\n \001(\0132 .greptime.v1.region.FlushReque"
"stH\000\0225\n\007compact\030\013 \001(\0132\".greptime.v1.regi"
"on.CompactRequestH\000B\006\n\004body\"T\n\016RegionRes"
"ponse\022+\n\006header\030\001 \001(\0132\033.greptime.v1.Resp"
"onseHeader\022\025\n\raffected_rows\030\002 \001(\004\"E\n\016Ins"
"ertRequests\0223\n\010requests\030\001 \003(\0132!.greptime"
".v1.region.InsertRequest\"E\n\016DeleteReques"
"ts\0223\n\010requests\030\001 \003(\0132!.greptime.v1.regio"
"n.DeleteRequest\"C\n\rInsertRequest\022\021\n\tregi"
"on_id\030\001 \001(\004\022\037\n\004rows\030\002 \001(\0132\021.greptime.v1."
"Rows\"C\n\rDeleteRequest\022\021\n\tregion_id\030\001 \001(\004"
"\022\037\n\004rows\030\002 \001(\0132\021.greptime.v1.Rows\"/\n\014Que"
"ryRequest\022\021\n\tregion_id\030\001 \001(\004\022\014\n\004plan\030\002 \001"
"(\014\"\236\002\n\rCreateRequest\022\021\n\tregion_id\030\001 \001(\004\022"
"\016\n\006engine\030\002 \001(\t\0222\n\013column_defs\030\003 \003(\0132\035.g"
"reptime.v1.region.ColumnDef\022\023\n\013primary_k"
"ey\030\004 \003(\r\022\034\n\024create_if_not_exists\030\005 \001(\010\022\022"
"\n\nregion_dir\030\006 \001(\t\022\?\n\007options\030\007 \003(\0132..gr"
"eptime.v1.region.CreateRequest.OptionsEn"
"try\032.\n\014OptionsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu"
"e\030\002 \001(\t:\0028\001\" \n\013DropRequest\022\021\n\tregion_id\030"
"\001 \001(\004\"\263\001\n\013OpenRequest\022\021\n\tregion_id\030\001 \001(\004"
"\022\016\n\006engine\030\002 \001(\t\022\022\n\nregion_dir\030\003 \001(\t\022=\n\007"
"options\030\004 \003(\0132,.greptime.v1.region.OpenR"
"equest.OptionsEntry\032.\n\014OptionsEntry\022\013\n\003k"
"ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"!\n\014CloseRequ"
"est\022\021\n\tregion_id\030\001 \001(\004\"!\n\014AlterRequest\022\021"
"\n\tregion_id\030\001 \001(\004\"!\n\014FlushRequest\022\021\n\treg"
"ion_id\030\001 \001(\004\"#\n\016CompactRequest\022\021\n\tregion"
"_id\030\001 \001(\004\"\276\001\n\tColumnDef\022\014\n\004name\030\001 \001(\t\022\021\n"
"\tcolumn_id\030\002 \001(\r\022-\n\010datatype\030\003 \001(\0162\033.gre"
"ptime.v1.ColumnDataType\022\023\n\013is_nullable\030\004"
" \001(\010\022\032\n\022default_constraint\030\005 \001(\014\0220\n\rsema"
"ntic_type\030\006 \001(\0162\031.greptime.v1.SemanticTy"
"pe2Y\n\006Region\022O\n\006Handle\022!.greptime.v1.reg"
"ion.RegionRequest\032\".greptime.v1.region.R"
"egionResponseB]\n\025io.greptime.v1.regionB\006"
"ServerZ<github.com/GreptimeTeam/greptime"
"-proto/go/greptime/v1/regionb\006proto3"
"\025greptime/v1/row.proto\"8\n\023RegionRequestH"
"eader\022\020\n\010trace_id\030\001 \001(\004\022\017\n\007span_id\030\002 \001(\004"
"\"\245\004\n\rRegionRequest\0227\n\006header\030\001 \001(\0132\'.gre"
"ptime.v1.region.RegionRequestHeader\0225\n\007i"
"nserts\030\003 \001(\0132\".greptime.v1.region.Insert"
"RequestsH\000\0225\n\007deletes\030\004 \001(\0132\".greptime.v"
"1.region.DeleteRequestsH\000\0223\n\006create\030\005 \001("
"\0132!.greptime.v1.region.CreateRequestH\000\022/"
"\n\004drop\030\006 \001(\0132\037.greptime.v1.region.DropRe"
"questH\000\022/\n\004open\030\007 \001(\0132\037.greptime.v1.regi"
"on.OpenRequestH\000\0221\n\005close\030\010 \001(\0132 .grepti"
"me.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.Flush"
"RequestH\000\0225\n\007compact\030\013 \001(\0132\".greptime.v1"
".region.CompactRequestH\000B\006\n\004body\"T\n\016Regi"
"onResponse\022+\n\006header\030\001 \001(\0132\033.greptime.v1"
".ResponseHeader\022\025\n\raffected_rows\030\002 \001(\004\"E"
"\n\016InsertRequests\0223\n\010requests\030\001 \003(\0132!.gre"
"ptime.v1.region.InsertRequest\"E\n\016DeleteR"
"equests\0223\n\010requests\030\001 \003(\0132!.greptime.v1."
"region.DeleteRequest\"C\n\rInsertRequest\022\021\n"
"\tregion_id\030\001 \001(\004\022\037\n\004rows\030\002 \001(\0132\021.greptim"
"e.v1.Rows\"C\n\rDeleteRequest\022\021\n\tregion_id\030"
"\001 \001(\004\022\037\n\004rows\030\002 \001(\0132\021.greptime.v1.Rows\"/"
"\n\014QueryRequest\022\021\n\tregion_id\030\001 \001(\004\022\014\n\004pla"
"n\030\002 \001(\014\"\236\002\n\rCreateRequest\022\021\n\tregion_id\030\001"
" \001(\004\022\016\n\006engine\030\002 \001(\t\0222\n\013column_defs\030\003 \003("
"\0132\035.greptime.v1.region.ColumnDef\022\023\n\013prim"
"ary_key\030\004 \003(\r\022\034\n\024create_if_not_exists\030\005 "
"\001(\010\022\022\n\nregion_dir\030\006 \001(\t\022\?\n\007options\030\007 \003(\013"
"2..greptime.v1.region.CreateRequest.Opti"
"onsEntry\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\tregio"
"n_id\030\001 \001(\004\"\263\001\n\013OpenRequest\022\021\n\tregion_id\030"
"\001 \001(\004\022\016\n\006engine\030\002 \001(\t\022\022\n\nregion_dir\030\003 \001("
"\t\022=\n\007options\030\004 \003(\0132,.greptime.v1.region."
"OpenRequest.OptionsEntry\032.\n\014OptionsEntry"
"\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"!\n\014Clos"
"eRequest\022\021\n\tregion_id\030\001 \001(\004\"!\n\014AlterRequ"
"est\022\021\n\tregion_id\030\001 \001(\004\"!\n\014FlushRequest\022\021"
"\n\tregion_id\030\001 \001(\004\"#\n\016CompactRequest\022\021\n\tr"
"egion_id\030\001 \001(\004\"\276\001\n\tColumnDef\022\014\n\004name\030\001 \001"
"(\t\022\021\n\tcolumn_id\030\002 \001(\r\022-\n\010datatype\030\003 \001(\0162"
"\033.greptime.v1.ColumnDataType\022\023\n\013is_nulla"
"ble\030\004 \001(\010\022\032\n\022default_constraint\030\005 \001(\014\0220\n"
"\rsemantic_type\030\006 \001(\0162\031.greptime.v1.Seman"
"ticType2Y\n\006Region\022O\n\006Handle\022!.greptime.v"
"1.region.RegionRequest\032\".greptime.v1.reg"
"ion.RegionResponseB]\n\025io.greptime.v1.reg"
"ionB\006ServerZ<github.com/GreptimeTeam/gre"
"ptime-proto/go/greptime/v1/regionb\006proto"
"3"
;
static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_deps[2] = {
&::descriptor_table_greptime_2fv1_2fcommon_2eproto,
@@ -553,7 +550,7 @@ static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2freg
};
static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto = {
false, false, 2196, descriptor_table_protodef_greptime_2fv1_2fregion_2fserver_2eproto,
false, false, 2161, descriptor_table_protodef_greptime_2fv1_2fregion_2fserver_2eproto,
"greptime/v1/region/server.proto",
&descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_deps, 2, 18,
schemas, file_default_instances, TableStruct_greptime_2fv1_2fregion_2fserver_2eproto::offsets,
@@ -574,13 +571,6 @@ namespace region {
class RegionRequestHeader::_Internal {
public:
using HasBits = decltype(std::declval<RegionRequestHeader>()._impl_._has_bits_);
static void set_has_trace_id(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_span_id(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
};
RegionRequestHeader::RegionRequestHeader(::PROTOBUF_NAMESPACE_ID::Arena* arena,
@@ -593,10 +583,9 @@ RegionRequestHeader::RegionRequestHeader(const RegionRequestHeader& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
RegionRequestHeader* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){from._impl_._has_bits_}
, /*decltype(_impl_._cached_size_)*/{}
, decltype(_impl_.trace_id_){}
, decltype(_impl_.span_id_){}};
decltype(_impl_.trace_id_){}
, decltype(_impl_.span_id_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
::memcpy(&_impl_.trace_id_, &from._impl_.trace_id_,
@@ -610,10 +599,9 @@ inline void RegionRequestHeader::SharedCtor(
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){}
, /*decltype(_impl_._cached_size_)*/{}
, decltype(_impl_.trace_id_){uint64_t{0u}}
decltype(_impl_.trace_id_){uint64_t{0u}}
, decltype(_impl_.span_id_){uint64_t{0u}}
, /*decltype(_impl_._cached_size_)*/{}
};
}
@@ -640,36 +628,29 @@ void RegionRequestHeader::Clear() {
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
::memset(&_impl_.trace_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&_impl_.span_id_) -
reinterpret_cast<char*>(&_impl_.trace_id_)) + sizeof(_impl_.span_id_));
}
_impl_._has_bits_.Clear();
::memset(&_impl_.trace_id_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&_impl_.span_id_) -
reinterpret_cast<char*>(&_impl_.trace_id_)) + sizeof(_impl_.span_id_));
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* RegionRequestHeader::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// optional uint64 trace_id = 1;
// uint64 trace_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
_Internal::set_has_trace_id(&has_bits);
_impl_.trace_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// optional uint64 span_id = 2;
// uint64 span_id = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
_Internal::set_has_span_id(&has_bits);
_impl_.span_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else
@@ -691,7 +672,6 @@ const char* RegionRequestHeader::_InternalParse(const char* ptr, ::_pbi::ParseCo
CHK_(ptr != nullptr);
} // while
message_done:
_impl_._has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
@@ -705,14 +685,14 @@ uint8_t* RegionRequestHeader::_InternalSerialize(
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// optional uint64 trace_id = 1;
if (_internal_has_trace_id()) {
// uint64 trace_id = 1;
if (this->_internal_trace_id() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_trace_id(), target);
}
// optional uint64 span_id = 2;
if (_internal_has_span_id()) {
// uint64 span_id = 2;
if (this->_internal_span_id() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_span_id(), target);
}
@@ -733,19 +713,16 @@ size_t RegionRequestHeader::ByteSizeLong() const {
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
// optional uint64 trace_id = 1;
if (cached_has_bits & 0x00000001u) {
total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_trace_id());
}
// optional uint64 span_id = 2;
if (cached_has_bits & 0x00000002u) {
total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_span_id());
}
// 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_);
}
@@ -764,15 +741,11 @@ void RegionRequestHeader::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, co
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._impl_._has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
_this->_impl_.trace_id_ = from._impl_.trace_id_;
}
if (cached_has_bits & 0x00000002u) {
_this->_impl_.span_id_ = from._impl_.span_id_;
}
_this->_impl_._has_bits_[0] |= cached_has_bits;
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_);
}
@@ -791,7 +764,6 @@ bool RegionRequestHeader::IsInitialized() const {
void RegionRequestHeader::InternalSwap(RegionRequestHeader* other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
::PROTOBUF_NAMESPACE_ID::internal::memswap<
PROTOBUF_FIELD_OFFSET(RegionRequestHeader, _impl_.span_id_)
+ sizeof(RegionRequestHeader::_impl_.span_id_)
+7 -32
View File
@@ -259,11 +259,7 @@ class RegionRequestHeader final :
kTraceIdFieldNumber = 1,
kSpanIdFieldNumber = 2,
};
// optional uint64 trace_id = 1;
bool has_trace_id() const;
private:
bool _internal_has_trace_id() const;
public:
// uint64 trace_id = 1;
void clear_trace_id();
uint64_t trace_id() const;
void set_trace_id(uint64_t value);
@@ -272,11 +268,7 @@ class RegionRequestHeader final :
void _internal_set_trace_id(uint64_t value);
public:
// optional uint64 span_id = 2;
bool has_span_id() const;
private:
bool _internal_has_span_id() const;
public:
// uint64 span_id = 2;
void clear_span_id();
uint64_t span_id() const;
void set_span_id(uint64_t value);
@@ -293,10 +285,9 @@ class RegionRequestHeader final :
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
uint64_t trace_id_;
uint64_t span_id_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_greptime_2fv1_2fregion_2fserver_2eproto;
@@ -3141,17 +3132,9 @@ class ColumnDef final :
#endif // __GNUC__
// RegionRequestHeader
// optional uint64 trace_id = 1;
inline bool RegionRequestHeader::_internal_has_trace_id() const {
bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
return value;
}
inline bool RegionRequestHeader::has_trace_id() const {
return _internal_has_trace_id();
}
// uint64 trace_id = 1;
inline void RegionRequestHeader::clear_trace_id() {
_impl_.trace_id_ = uint64_t{0u};
_impl_._has_bits_[0] &= ~0x00000001u;
}
inline uint64_t RegionRequestHeader::_internal_trace_id() const {
return _impl_.trace_id_;
@@ -3161,7 +3144,7 @@ inline uint64_t RegionRequestHeader::trace_id() const {
return _internal_trace_id();
}
inline void RegionRequestHeader::_internal_set_trace_id(uint64_t value) {
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.trace_id_ = value;
}
inline void RegionRequestHeader::set_trace_id(uint64_t value) {
@@ -3169,17 +3152,9 @@ inline void RegionRequestHeader::set_trace_id(uint64_t value) {
// @@protoc_insertion_point(field_set:greptime.v1.region.RegionRequestHeader.trace_id)
}
// optional uint64 span_id = 2;
inline bool RegionRequestHeader::_internal_has_span_id() const {
bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0;
return value;
}
inline bool RegionRequestHeader::has_span_id() const {
return _internal_has_span_id();
}
// uint64 span_id = 2;
inline void RegionRequestHeader::clear_span_id() {
_impl_.span_id_ = uint64_t{0u};
_impl_._has_bits_[0] &= ~0x00000002u;
}
inline uint64_t RegionRequestHeader::_internal_span_id() const {
return _impl_.span_id_;
@@ -3189,7 +3164,7 @@ inline uint64_t RegionRequestHeader::span_id() const {
return _internal_span_id();
}
inline void RegionRequestHeader::_internal_set_span_id(uint64_t value) {
_impl_._has_bits_[0] |= 0x00000002u;
_impl_.span_id_ = value;
}
inline void RegionRequestHeader::set_span_id(uint64_t value) {