feat: add status for reponse header (#65)

This commit is contained in:
JeremyHi
2023-07-17 11:55:51 +08:00
committed by GitHub
parent 6e89daefca
commit bec16e50c9
5 changed files with 2565 additions and 807 deletions
+507 -91
View File
@@ -22,17 +22,6 @@ namespace _pbi = _pb::internal;
namespace greptime {
namespace v1 {
PROTOBUF_CONSTEXPR ResponseHeader::ResponseHeader(
::_pbi::ConstantInitialized) {}
struct ResponseHeaderDefaultTypeInternal {
PROTOBUF_CONSTEXPR ResponseHeaderDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~ResponseHeaderDefaultTypeInternal() {}
union {
ResponseHeader _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ResponseHeaderDefaultTypeInternal _ResponseHeader_default_instance_;
PROTOBUF_CONSTEXPR RequestHeader::RequestHeader(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_._has_bits_)*/{}
@@ -52,6 +41,33 @@ struct RequestHeaderDefaultTypeInternal {
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RequestHeaderDefaultTypeInternal _RequestHeader_default_instance_;
PROTOBUF_CONSTEXPR ResponseHeader::ResponseHeader(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.status_)*/nullptr
, /*decltype(_impl_._cached_size_)*/{}} {}
struct ResponseHeaderDefaultTypeInternal {
PROTOBUF_CONSTEXPR ResponseHeaderDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~ResponseHeaderDefaultTypeInternal() {}
union {
ResponseHeader _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ResponseHeaderDefaultTypeInternal _ResponseHeader_default_instance_;
PROTOBUF_CONSTEXPR Status::Status(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.err_msg_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.status_code_)*/0u
, /*decltype(_impl_._cached_size_)*/{}} {}
struct StatusDefaultTypeInternal {
PROTOBUF_CONSTEXPR StatusDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~StatusDefaultTypeInternal() {}
union {
Status _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StatusDefaultTypeInternal _Status_default_instance_;
PROTOBUF_CONSTEXPR AuthHeader::AuthHeader(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.auth_scheme_)*/{}
@@ -121,17 +137,11 @@ struct FlightMetadataDefaultTypeInternal {
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FlightMetadataDefaultTypeInternal _FlightMetadata_default_instance_;
} // namespace v1
} // namespace greptime
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fcommon_2eproto[7];
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fcommon_2eproto[8];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_greptime_2fv1_2fcommon_2eproto = nullptr;
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) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::ResponseHeader, _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, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::RequestHeader, _internal_metadata_),
~0u, // no _extensions_
@@ -151,6 +161,21 @@ const uint32_t TableStruct_greptime_2fv1_2fcommon_2eproto::offsets[] PROTOBUF_SE
0,
1,
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::ResponseHeader, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::greptime::v1::ResponseHeader, _impl_.status_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::Status, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::greptime::v1::Status, _impl_.status_code_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::Status, _impl_.err_msg_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::AuthHeader, _internal_metadata_),
~0u, // no _extensions_
PROTOBUF_FIELD_OFFSET(::greptime::v1::AuthHeader, _impl_._oneof_case_[0]),
@@ -190,18 +215,20 @@ const uint32_t TableStruct_greptime_2fv1_2fcommon_2eproto::offsets[] PROTOBUF_SE
PROTOBUF_FIELD_OFFSET(::greptime::v1::FlightMetadata, _impl_.affected_rows_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::greptime::v1::ResponseHeader)},
{ 6, 18, -1, sizeof(::greptime::v1::RequestHeader)},
{ 24, -1, -1, sizeof(::greptime::v1::AuthHeader)},
{ 33, -1, -1, sizeof(::greptime::v1::Basic)},
{ 41, -1, -1, sizeof(::greptime::v1::Token)},
{ 48, -1, -1, sizeof(::greptime::v1::AffectedRows)},
{ 55, -1, -1, sizeof(::greptime::v1::FlightMetadata)},
{ 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)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::greptime::v1::_ResponseHeader_default_instance_._instance,
&::greptime::v1::_RequestHeader_default_instance_._instance,
&::greptime::v1::_ResponseHeader_default_instance_._instance,
&::greptime::v1::_Status_default_instance_._instance,
&::greptime::v1::_AuthHeader_default_instance_._instance,
&::greptime::v1::_Basic_default_instance_._instance,
&::greptime::v1::_Token_default_instance_._instance,
@@ -211,27 +238,29 @@ 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\""
"\020\n\016ResponseHeader\"\266\001\n\rRequestHeader\022\017\n\007c"
"atalog\030\001 \001(\t\022\016\n\006schema\030\002 \001(\t\022.\n\rauthoriz"
"ation\030\003 \001(\0132\027.greptime.v1.AuthHeader\022\016\n\006"
"dbname\030\004 \001(\t\022\025\n\010trace_id\030\005 \001(\004H\000\210\001\001\022\024\n\007s"
"pan_id\030\006 \001(\004H\001\210\001\001B\013\n\t_trace_idB\n\n\010_span_"
"id\"e\n\nAuthHeader\022#\n\005basic\030\001 \001(\0132\022.grepti"
"me.v1.BasicH\000\022#\n\005token\030\002 \001(\0132\022.greptime."
"v1.TokenH\000B\r\n\013auth_scheme\"+\n\005Basic\022\020\n\010us"
"ername\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\raffected_rows"
"\030\001 \001(\0132\031.greptime.v1.AffectedRowsBO\n\016io."
"greptime.v1B\006CommonZ5github.com/Greptime"
"Team/greptime-proto/go/greptime/v1b\006prot"
"o3"
"\266\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.AffectedRowsBO"
"\n\016io.greptime.v1B\006CommonZ5github.com/Gre"
"ptimeTeam/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, 602, descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto,
false, false, 687, descriptor_table_protodef_greptime_2fv1_2fcommon_2eproto,
"greptime/v1/common.proto",
&descriptor_table_greptime_2fv1_2fcommon_2eproto_once, nullptr, 0, 7,
&descriptor_table_greptime_2fv1_2fcommon_2eproto_once, nullptr, 0, 8,
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,
@@ -247,46 +276,6 @@ namespace v1 {
// ===================================================================
class ResponseHeader::_Internal {
public:
};
ResponseHeader::ResponseHeader(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) {
// @@protoc_insertion_point(arena_constructor:greptime.v1.ResponseHeader)
}
ResponseHeader::ResponseHeader(const ResponseHeader& from)
: ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() {
ResponseHeader* const _this = this; (void)_this;
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:greptime.v1.ResponseHeader)
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ResponseHeader::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl,
::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl,
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ResponseHeader::GetClassData() const { return &_class_data_; }
::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[0]);
}
// ===================================================================
class RequestHeader::_Internal {
public:
using HasBits = decltype(std::declval<RequestHeader>()._impl_._has_bits_);
@@ -709,6 +698,199 @@ void RequestHeader::InternalSwap(RequestHeader* other) {
}
::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]);
}
// ===================================================================
class ResponseHeader::_Internal {
public:
static const ::greptime::v1::Status& status(const ResponseHeader* msg);
};
const ::greptime::v1::Status&
ResponseHeader::_Internal::status(const ResponseHeader* msg) {
return *msg->_impl_.status_;
}
ResponseHeader::ResponseHeader(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:greptime.v1.ResponseHeader)
}
ResponseHeader::ResponseHeader(const ResponseHeader& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
ResponseHeader* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.status_){nullptr}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
if (from._internal_has_status()) {
_this->_impl_.status_ = new ::greptime::v1::Status(*from._impl_.status_);
}
// @@protoc_insertion_point(copy_constructor:greptime.v1.ResponseHeader)
}
inline void ResponseHeader::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.status_){nullptr}
, /*decltype(_impl_._cached_size_)*/{}
};
}
ResponseHeader::~ResponseHeader() {
// @@protoc_insertion_point(destructor:greptime.v1.ResponseHeader)
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
(void)arena;
return;
}
SharedDtor();
}
inline void ResponseHeader::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
if (this != internal_default_instance()) delete _impl_.status_;
}
void ResponseHeader::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
void ResponseHeader::Clear() {
// @@protoc_insertion_point(message_clear_start:greptime.v1.ResponseHeader)
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
if (GetArenaForAllocation() == nullptr && _impl_.status_ != nullptr) {
delete _impl_.status_;
}
_impl_.status_ = nullptr;
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* ResponseHeader::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// .greptime.v1.Status status = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
ptr = ctx->ParseMessage(_internal_mutable_status(), ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* ResponseHeader::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:greptime.v1.ResponseHeader)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// .greptime.v1.Status status = 1;
if (this->_internal_has_status()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(1, _Internal::status(this),
_Internal::status(this).GetCachedSize(), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:greptime.v1.ResponseHeader)
return target;
}
size_t ResponseHeader::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.ResponseHeader)
size_t total_size = 0;
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .greptime.v1.Status status = 1;
if (this->_internal_has_status()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*_impl_.status_);
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ResponseHeader::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
ResponseHeader::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ResponseHeader::GetClassData() const { return &_class_data_; }
void ResponseHeader::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
auto* const _this = static_cast<ResponseHeader*>(&to_msg);
auto& from = static_cast<const ResponseHeader&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.ResponseHeader)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_has_status()) {
_this->_internal_mutable_status()->::greptime::v1::Status::MergeFrom(
from._internal_status());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
void ResponseHeader::CopyFrom(const ResponseHeader& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.ResponseHeader)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ResponseHeader::IsInitialized() const {
return true;
}
void ResponseHeader::InternalSwap(ResponseHeader* other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_.status_, other->_impl_.status_);
}
::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]);
@@ -716,6 +898,236 @@ void RequestHeader::InternalSwap(RequestHeader* other) {
// ===================================================================
class Status::_Internal {
public:
};
Status::Status(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
// @@protoc_insertion_point(arena_constructor:greptime.v1.Status)
}
Status::Status(const Status& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
Status* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.err_msg_){}
, decltype(_impl_.status_code_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_impl_.err_msg_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.err_msg_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_err_msg().empty()) {
_this->_impl_.err_msg_.Set(from._internal_err_msg(),
_this->GetArenaForAllocation());
}
_this->_impl_.status_code_ = from._impl_.status_code_;
// @@protoc_insertion_point(copy_constructor:greptime.v1.Status)
}
inline void Status::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.err_msg_){}
, decltype(_impl_.status_code_){0u}
, /*decltype(_impl_._cached_size_)*/{}
};
_impl_.err_msg_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.err_msg_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}
Status::~Status() {
// @@protoc_insertion_point(destructor:greptime.v1.Status)
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
(void)arena;
return;
}
SharedDtor();
}
inline void Status::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
_impl_.err_msg_.Destroy();
}
void Status::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
void Status::Clear() {
// @@protoc_insertion_point(message_clear_start:greptime.v1.Status)
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.err_msg_.ClearToEmpty();
_impl_.status_code_ = 0u;
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* Status::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// uint32 status_code = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
_impl_.status_code_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// string err_msg = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
auto str = _internal_mutable_err_msg();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
CHK_(::_pbi::VerifyUTF8(str, "greptime.v1.Status.err_msg"));
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* Status::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:greptime.v1.Status)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// uint32 status_code = 1;
if (this->_internal_status_code() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_status_code(), target);
}
// string err_msg = 2;
if (!this->_internal_err_msg().empty()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_err_msg().data(), static_cast<int>(this->_internal_err_msg().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"greptime.v1.Status.err_msg");
target = stream->WriteStringMaybeAliased(
2, this->_internal_err_msg(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:greptime.v1.Status)
return target;
}
size_t Status::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.Status)
size_t total_size = 0;
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string err_msg = 2;
if (!this->_internal_err_msg().empty()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_err_msg());
}
// uint32 status_code = 1;
if (this->_internal_status_code() != 0) {
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_status_code());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Status::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
Status::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Status::GetClassData() const { return &_class_data_; }
void Status::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
auto* const _this = static_cast<Status*>(&to_msg);
auto& from = static_cast<const Status&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.Status)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (!from._internal_err_msg().empty()) {
_this->_internal_set_err_msg(from._internal_err_msg());
}
if (from._internal_status_code() != 0) {
_this->_internal_set_status_code(from._internal_status_code());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
void Status::CopyFrom(const Status& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.Status)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Status::IsInitialized() const {
return true;
}
void Status::InternalSwap(Status* other) {
using std::swap;
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.err_msg_, lhs_arena,
&other->_impl_.err_msg_, rhs_arena
);
swap(_impl_.status_code_, other->_impl_.status_code_);
}
::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]);
}
// ===================================================================
class AuthHeader::_Internal {
public:
static const ::greptime::v1::Basic& basic(const AuthHeader* msg);
@@ -1016,7 +1428,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[2]);
file_level_metadata_greptime_2fv1_2fcommon_2eproto[3]);
}
// ===================================================================
@@ -1269,7 +1681,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[3]);
file_level_metadata_greptime_2fv1_2fcommon_2eproto[4]);
}
// ===================================================================
@@ -1472,7 +1884,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[4]);
file_level_metadata_greptime_2fv1_2fcommon_2eproto[5]);
}
// ===================================================================
@@ -1650,7 +2062,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[5]);
file_level_metadata_greptime_2fv1_2fcommon_2eproto[6]);
}
// ===================================================================
@@ -1843,20 +2255,24 @@ 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[6]);
file_level_metadata_greptime_2fv1_2fcommon_2eproto[7]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace v1
} // namespace greptime
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::greptime::v1::RequestHeader*
Arena::CreateMaybeMessage< ::greptime::v1::RequestHeader >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::RequestHeader >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::ResponseHeader*
Arena::CreateMaybeMessage< ::greptime::v1::ResponseHeader >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::ResponseHeader >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::RequestHeader*
Arena::CreateMaybeMessage< ::greptime::v1::RequestHeader >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::RequestHeader >(arena);
template<> PROTOBUF_NOINLINE ::greptime::v1::Status*
Arena::CreateMaybeMessage< ::greptime::v1::Status >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::Status >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::AuthHeader*
Arena::CreateMaybeMessage< ::greptime::v1::AuthHeader >(Arena* arena) {