refactor: common semantic type (#73)

This commit is contained in:
JeremyHi
2023-08-01 18:51:10 +08:00
committed by GitHub
parent e665c9ff3e
commit eeae2d0dfa
15 changed files with 2726 additions and 2755 deletions
+34 -446
View File
@@ -92,26 +92,10 @@ struct ColumnDefaultTypeInternal {
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ColumnDefaultTypeInternal _Column_default_instance_;
PROTOBUF_CONSTEXPR ColumnDef::ColumnDef(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.default_constraint_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.datatype_)*/0
, /*decltype(_impl_.is_nullable_)*/false
, /*decltype(_impl_._cached_size_)*/{}} {}
struct ColumnDefDefaultTypeInternal {
PROTOBUF_CONSTEXPR ColumnDefDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~ColumnDefDefaultTypeInternal() {}
union {
ColumnDef _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ColumnDefDefaultTypeInternal _ColumnDef_default_instance_;
} // namespace v1
} // namespace greptime
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fcolumn_2eproto[3];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_greptime_2fv1_2fcolumn_2eproto[2];
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fcolumn_2eproto[2];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_greptime_2fv1_2fcolumn_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fcolumn_2eproto = nullptr;
const uint32_t TableStruct_greptime_2fv1_2fcolumn_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
@@ -155,73 +139,50 @@ const uint32_t TableStruct_greptime_2fv1_2fcolumn_2eproto::offsets[] PROTOBUF_SE
PROTOBUF_FIELD_OFFSET(::greptime::v1::Column, _impl_.values_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::Column, _impl_.null_mask_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::Column, _impl_.datatype_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::ColumnDef, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::greptime::v1::ColumnDef, _impl_.name_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::ColumnDef, _impl_.datatype_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::ColumnDef, _impl_.is_nullable_),
PROTOBUF_FIELD_OFFSET(::greptime::v1::ColumnDef, _impl_.default_constraint_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::greptime::v1::Column_Values)},
{ 29, -1, -1, sizeof(::greptime::v1::Column)},
{ 40, -1, -1, sizeof(::greptime::v1::ColumnDef)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::greptime::v1::_Column_Values_default_instance_._instance,
&::greptime::v1::_Column_default_instance_._instance,
&::greptime::v1::_ColumnDef_default_instance_._instance,
};
const char descriptor_table_protodef_greptime_2fv1_2fcolumn_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\030greptime/v1/column.proto\022\013greptime.v1\""
"\255\006\n\006Column\022\023\n\013column_name\030\001 \001(\t\0227\n\rseman"
"tic_type\030\002 \001(\0162 .greptime.v1.Column.Sema"
"nticType\022*\n\006values\030\003 \001(\0132\032.greptime.v1.C"
"olumn.Values\022\021\n\tnull_mask\030\004 \001(\014\022-\n\010datat"
"ype\030\005 \001(\0162\033.greptime.v1.ColumnDataType\032\263"
"\004\n\006Values\022\021\n\ti8_values\030\001 \003(\005\022\022\n\ni16_valu"
"es\030\002 \003(\005\022\022\n\ni32_values\030\003 \003(\005\022\022\n\ni64_valu"
"es\030\004 \003(\003\022\021\n\tu8_values\030\005 \003(\r\022\022\n\nu16_value"
"s\030\006 \003(\r\022\022\n\nu32_values\030\007 \003(\r\022\022\n\nu64_value"
"s\030\010 \003(\004\022\022\n\nf32_values\030\t \003(\002\022\022\n\nf64_value"
"s\030\n \003(\001\022\023\n\013bool_values\030\013 \003(\010\022\025\n\rbinary_v"
"alues\030\014 \003(\014\022\025\n\rstring_values\030\r \003(\t\022\023\n\013da"
"te_values\030\016 \003(\005\022\027\n\017datetime_values\030\017 \003(\003"
"\022\030\n\020ts_second_values\030\020 \003(\003\022\035\n\025ts_millise"
"cond_values\030\021 \003(\003\022\035\n\025ts_microsecond_valu"
"es\030\022 \003(\003\022\034\n\024ts_nanosecond_values\030\023 \003(\003\022\032"
"\n\022time_second_values\030\024 \003(\003\022\037\n\027time_milli"
"second_values\030\025 \003(\003\022\037\n\027time_microsecond_"
"values\030\026 \003(\003\022\036\n\026time_nanosecond_values\030\027"
" \003(\003\"1\n\014SemanticType\022\007\n\003TAG\020\000\022\t\n\005FIELD\020\001"
"\022\r\n\tTIMESTAMP\020\002\"y\n\tColumnDef\022\014\n\004name\030\001 \001"
"(\t\022-\n\010datatype\030\002 \001(\0162\033.greptime.v1.Colum"
"nDataType\022\023\n\013is_nullable\030\003 \001(\010\022\032\n\022defaul"
"t_constraint\030\004 \001(\014*\371\002\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\006"
"UINT32\020\007\022\n\n\006UINT64\020\010\022\013\n\007FLOAT32\020\t\022\013\n\007FLO"
"AT64\020\n\022\n\n\006BINARY\020\013\022\n\n\006STRING\020\014\022\010\n\004DATE\020\r"
"\022\014\n\010DATETIME\020\016\022\024\n\020TIMESTAMP_SECOND\020\017\022\031\n\025"
"TIMESTAMP_MILLISECOND\020\020\022\031\n\025TIMESTAMP_MIC"
"ROSECOND\020\021\022\030\n\024TIMESTAMP_NANOSECOND\020\022\022\017\n\013"
"TIME_SECOND\020\023\022\024\n\020TIME_MILLISECOND\020\024\022\024\n\020T"
"IME_MICROSECOND\020\025\022\023\n\017TIME_NANOSECOND\020\026BP"
"\n\016io.greptime.v1B\007ColumnsZ5github.com/Gr"
"eptimeTeam/greptime-proto/go/greptime/v1"
"b\006proto3"
"\n\030greptime/v1/column.proto\022\013greptime.v1\032"
"\030greptime/v1/common.proto\"\363\005\n\006Column\022\023\n\013"
"column_name\030\001 \001(\t\0220\n\rsemantic_type\030\002 \001(\016"
"2\031.greptime.v1.SemanticType\022*\n\006values\030\003 "
"\001(\0132\032.greptime.v1.Column.Values\022\021\n\tnull_"
"mask\030\004 \001(\014\022-\n\010datatype\030\005 \001(\0162\033.greptime."
"v1.ColumnDataType\032\263\004\n\006Values\022\021\n\ti8_value"
"s\030\001 \003(\005\022\022\n\ni16_values\030\002 \003(\005\022\022\n\ni32_value"
"s\030\003 \003(\005\022\022\n\ni64_values\030\004 \003(\003\022\021\n\tu8_values"
"\030\005 \003(\r\022\022\n\nu16_values\030\006 \003(\r\022\022\n\nu32_values"
"\030\007 \003(\r\022\022\n\nu64_values\030\010 \003(\004\022\022\n\nf32_values"
"\030\t \003(\002\022\022\n\nf64_values\030\n \003(\001\022\023\n\013bool_value"
"s\030\013 \003(\010\022\025\n\rbinary_values\030\014 \003(\014\022\025\n\rstring"
"_values\030\r \003(\t\022\023\n\013date_values\030\016 \003(\005\022\027\n\017da"
"tetime_values\030\017 \003(\003\022\030\n\020ts_second_values\030"
"\020 \003(\003\022\035\n\025ts_millisecond_values\030\021 \003(\003\022\035\n\025"
"ts_microsecond_values\030\022 \003(\003\022\034\n\024ts_nanose"
"cond_values\030\023 \003(\003\022\032\n\022time_second_values\030"
"\024 \003(\003\022\037\n\027time_millisecond_values\030\025 \003(\003\022\037"
"\n\027time_microsecond_values\030\026 \003(\003\022\036\n\026time_"
"nanosecond_values\030\027 \003(\003BP\n\016io.greptime.v"
"1B\007ColumnsZ5github.com/GreptimeTeam/grep"
"time-proto/go/greptime/v1b\006proto3"
;
static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2fcolumn_2eproto_deps[1] = {
&::descriptor_table_greptime_2fv1_2fcommon_2eproto,
};
static ::_pbi::once_flag descriptor_table_greptime_2fv1_2fcolumn_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_greptime_2fv1_2fcolumn_2eproto = {
false, false, 1448, descriptor_table_protodef_greptime_2fv1_2fcolumn_2eproto,
false, false, 913, descriptor_table_protodef_greptime_2fv1_2fcolumn_2eproto,
"greptime/v1/column.proto",
&descriptor_table_greptime_2fv1_2fcolumn_2eproto_once, nullptr, 0, 3,
&descriptor_table_greptime_2fv1_2fcolumn_2eproto_once, descriptor_table_greptime_2fv1_2fcolumn_2eproto_deps, 1, 2,
schemas, file_default_instances, TableStruct_greptime_2fv1_2fcolumn_2eproto::offsets,
file_level_metadata_greptime_2fv1_2fcolumn_2eproto, file_level_enum_descriptors_greptime_2fv1_2fcolumn_2eproto,
file_level_service_descriptors_greptime_2fv1_2fcolumn_2eproto,
@@ -234,64 +195,6 @@ PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_greptime
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_greptime_2fv1_2fcolumn_2eproto(&descriptor_table_greptime_2fv1_2fcolumn_2eproto);
namespace greptime {
namespace v1 {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Column_SemanticType_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_greptime_2fv1_2fcolumn_2eproto);
return file_level_enum_descriptors_greptime_2fv1_2fcolumn_2eproto[0];
}
bool Column_SemanticType_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
return true;
default:
return false;
}
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr Column_SemanticType Column::TAG;
constexpr Column_SemanticType Column::FIELD;
constexpr Column_SemanticType Column::TIMESTAMP;
constexpr Column_SemanticType Column::SemanticType_MIN;
constexpr Column_SemanticType Column::SemanticType_MAX;
constexpr int Column::SemanticType_ARRAYSIZE;
#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ColumnDataType_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_greptime_2fv1_2fcolumn_2eproto);
return file_level_enum_descriptors_greptime_2fv1_2fcolumn_2eproto[1];
}
bool ColumnDataType_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
return true;
default:
return false;
}
}
// ===================================================================
@@ -1502,12 +1405,12 @@ const char* Column::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
} else
goto handle_unusual;
continue;
// .greptime.v1.Column.SemanticType semantic_type = 2;
// .greptime.v1.SemanticType semantic_type = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
_internal_set_semantic_type(static_cast<::greptime::v1::Column_SemanticType>(val));
_internal_set_semantic_type(static_cast<::greptime::v1::SemanticType>(val));
} else
goto handle_unusual;
continue;
@@ -1576,7 +1479,7 @@ uint8_t* Column::_InternalSerialize(
1, this->_internal_column_name(), target);
}
// .greptime.v1.Column.SemanticType semantic_type = 2;
// .greptime.v1.SemanticType semantic_type = 2;
if (this->_internal_semantic_type() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteEnumToArray(
@@ -1640,7 +1543,7 @@ size_t Column::ByteSizeLong() const {
*_impl_.values_);
}
// .greptime.v1.Column.SemanticType semantic_type = 2;
// .greptime.v1.SemanticType semantic_type = 2;
if (this->_internal_semantic_type() != 0) {
total_size += 1 +
::_pbi::WireFormatLite::EnumSize(this->_internal_semantic_type());
@@ -1727,317 +1630,6 @@ void Column::InternalSwap(Column* other) {
file_level_metadata_greptime_2fv1_2fcolumn_2eproto[1]);
}
// ===================================================================
class ColumnDef::_Internal {
public:
};
ColumnDef::ColumnDef(::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.ColumnDef)
}
ColumnDef::ColumnDef(const ColumnDef& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
ColumnDef* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.name_){}
, decltype(_impl_.default_constraint_){}
, decltype(_impl_.datatype_){}
, decltype(_impl_.is_nullable_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_impl_.name_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.name_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_name().empty()) {
_this->_impl_.name_.Set(from._internal_name(),
_this->GetArenaForAllocation());
}
_impl_.default_constraint_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.default_constraint_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_default_constraint().empty()) {
_this->_impl_.default_constraint_.Set(from._internal_default_constraint(),
_this->GetArenaForAllocation());
}
::memcpy(&_impl_.datatype_, &from._impl_.datatype_,
static_cast<size_t>(reinterpret_cast<char*>(&_impl_.is_nullable_) -
reinterpret_cast<char*>(&_impl_.datatype_)) + sizeof(_impl_.is_nullable_));
// @@protoc_insertion_point(copy_constructor:greptime.v1.ColumnDef)
}
inline void ColumnDef::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.name_){}
, decltype(_impl_.default_constraint_){}
, decltype(_impl_.datatype_){0}
, decltype(_impl_.is_nullable_){false}
, /*decltype(_impl_._cached_size_)*/{}
};
_impl_.name_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.name_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.default_constraint_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.default_constraint_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}
ColumnDef::~ColumnDef() {
// @@protoc_insertion_point(destructor:greptime.v1.ColumnDef)
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
(void)arena;
return;
}
SharedDtor();
}
inline void ColumnDef::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
_impl_.name_.Destroy();
_impl_.default_constraint_.Destroy();
}
void ColumnDef::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
void ColumnDef::Clear() {
// @@protoc_insertion_point(message_clear_start:greptime.v1.ColumnDef)
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.name_.ClearToEmpty();
_impl_.default_constraint_.ClearToEmpty();
::memset(&_impl_.datatype_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&_impl_.is_nullable_) -
reinterpret_cast<char*>(&_impl_.datatype_)) + sizeof(_impl_.is_nullable_));
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* ColumnDef::_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) {
// string name = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
auto str = _internal_mutable_name();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
CHK_(::_pbi::VerifyUTF8(str, "greptime.v1.ColumnDef.name"));
} else
goto handle_unusual;
continue;
// .greptime.v1.ColumnDataType datatype = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
_internal_set_datatype(static_cast<::greptime::v1::ColumnDataType>(val));
} else
goto handle_unusual;
continue;
// bool is_nullable = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
_impl_.is_nullable_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// bytes default_constraint = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
auto str = _internal_mutable_default_constraint();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
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* ColumnDef::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:greptime.v1.ColumnDef)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
// string name = 1;
if (!this->_internal_name().empty()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"greptime.v1.ColumnDef.name");
target = stream->WriteStringMaybeAliased(
1, this->_internal_name(), target);
}
// .greptime.v1.ColumnDataType datatype = 2;
if (this->_internal_datatype() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteEnumToArray(
2, this->_internal_datatype(), target);
}
// bool is_nullable = 3;
if (this->_internal_is_nullable() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_is_nullable(), target);
}
// bytes default_constraint = 4;
if (!this->_internal_default_constraint().empty()) {
target = stream->WriteBytesMaybeAliased(
4, this->_internal_default_constraint(), 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.ColumnDef)
return target;
}
size_t ColumnDef::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:greptime.v1.ColumnDef)
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 name = 1;
if (!this->_internal_name().empty()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_name());
}
// bytes default_constraint = 4;
if (!this->_internal_default_constraint().empty()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
this->_internal_default_constraint());
}
// .greptime.v1.ColumnDataType datatype = 2;
if (this->_internal_datatype() != 0) {
total_size += 1 +
::_pbi::WireFormatLite::EnumSize(this->_internal_datatype());
}
// bool is_nullable = 3;
if (this->_internal_is_nullable() != 0) {
total_size += 1 + 1;
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ColumnDef::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
ColumnDef::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ColumnDef::GetClassData() const { return &_class_data_; }
void ColumnDef::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
auto* const _this = static_cast<ColumnDef*>(&to_msg);
auto& from = static_cast<const ColumnDef&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:greptime.v1.ColumnDef)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (!from._internal_name().empty()) {
_this->_internal_set_name(from._internal_name());
}
if (!from._internal_default_constraint().empty()) {
_this->_internal_set_default_constraint(from._internal_default_constraint());
}
if (from._internal_datatype() != 0) {
_this->_internal_set_datatype(from._internal_datatype());
}
if (from._internal_is_nullable() != 0) {
_this->_internal_set_is_nullable(from._internal_is_nullable());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
void ColumnDef::CopyFrom(const ColumnDef& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:greptime.v1.ColumnDef)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ColumnDef::IsInitialized() const {
return true;
}
void ColumnDef::InternalSwap(ColumnDef* 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_.name_, lhs_arena,
&other->_impl_.name_, rhs_arena
);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.default_constraint_, lhs_arena,
&other->_impl_.default_constraint_, rhs_arena
);
::PROTOBUF_NAMESPACE_ID::internal::memswap<
PROTOBUF_FIELD_OFFSET(ColumnDef, _impl_.is_nullable_)
+ sizeof(ColumnDef::_impl_.is_nullable_)
- PROTOBUF_FIELD_OFFSET(ColumnDef, _impl_.datatype_)>(
reinterpret_cast<char*>(&_impl_.datatype_),
reinterpret_cast<char*>(&other->_impl_.datatype_));
}
::PROTOBUF_NAMESPACE_ID::Metadata ColumnDef::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2fcolumn_2eproto_getter, &descriptor_table_greptime_2fv1_2fcolumn_2eproto_once,
file_level_metadata_greptime_2fv1_2fcolumn_2eproto[2]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace v1
} // namespace greptime
@@ -2050,10 +1642,6 @@ template<> PROTOBUF_NOINLINE ::greptime::v1::Column*
Arena::CreateMaybeMessage< ::greptime::v1::Column >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::Column >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::ColumnDef*
Arena::CreateMaybeMessage< ::greptime::v1::ColumnDef >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::ColumnDef >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)