feat: truncate request by time ranges (#262)

* feat: truncate request by time ranges

Signed-off-by: discord9 <discord9@163.com>

* fix: default time unit is millisecond

Signed-off-by: discord9 <discord9@163.com>

* refactor: per review

Signed-off-by: discord9 <discord9@163.com>

* add time ranges to truncate table expr

Signed-off-by: discord9 <discord9@163.com>

* chore: make all

Signed-off-by: discord9 <discord9@163.com>

* chore: fmt

Signed-off-by: discord9 <discord9@163.com>

* chore: make all

Signed-off-by: discord9 <discord9@163.com>

* chore: make all

Signed-off-by: discord9 <discord9@163.com>

---------

Signed-off-by: discord9 <discord9@163.com>
This commit is contained in:
discord9
2025-08-04 18:17:40 +08:00
committed by GitHub
parent 91c3d7b97a
commit ccfd4da48b
15 changed files with 5844 additions and 894 deletions
+272 -38
View File
@@ -420,7 +420,9 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORIT
PROTOBUF_CONSTEXPR TruncateRequest::TruncateRequest(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.region_id_)*/uint64_t{0u}
, /*decltype(_impl_._cached_size_)*/{}} {}
, /*decltype(_impl_.kind_)*/{}
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_._oneof_case_)*/{}} {}
struct TruncateRequestDefaultTypeInternal {
PROTOBUF_CONSTEXPR TruncateRequestDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
@@ -430,6 +432,17 @@ struct TruncateRequestDefaultTypeInternal {
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TruncateRequestDefaultTypeInternal _TruncateRequest_default_instance_;
PROTOBUF_CONSTEXPR All::All(
::_pbi::ConstantInitialized) {}
struct AllDefaultTypeInternal {
PROTOBUF_CONSTEXPR AllDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
~AllDefaultTypeInternal() {}
union {
All _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AllDefaultTypeInternal _All_default_instance_;
PROTOBUF_CONSTEXPR RegionColumnDef::RegionColumnDef(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.column_def_)*/nullptr
@@ -518,7 +531,7 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORIT
} // namespace region
} // namespace v1
} // namespace greptime
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[36];
static ::_pb::Metadata file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[37];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_greptime_2fv1_2fregion_2fserver_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_greptime_2fv1_2fregion_2fserver_2eproto = nullptr;
@@ -793,10 +806,19 @@ const uint32_t TableStruct_greptime_2fv1_2fregion_2fserver_2eproto::offsets[] PR
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::region::TruncateRequest, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
PROTOBUF_FIELD_OFFSET(::greptime::v1::region::TruncateRequest, _impl_._oneof_case_[0]),
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::greptime::v1::region::TruncateRequest, _impl_.region_id_),
::_pbi::kInvalidFieldOffsetTag,
::_pbi::kInvalidFieldOffsetTag,
PROTOBUF_FIELD_OFFSET(::greptime::v1::region::TruncateRequest, _impl_.kind_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::region::All, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::greptime::v1::region::RegionColumnDef, _internal_metadata_),
~0u, // no _extensions_
@@ -878,12 +900,13 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode
{ 250, -1, -1, sizeof(::greptime::v1::region::StrictWindow)},
{ 257, -1, -1, sizeof(::greptime::v1::region::CompactRequest)},
{ 267, -1, -1, sizeof(::greptime::v1::region::TruncateRequest)},
{ 274, -1, -1, sizeof(::greptime::v1::region::RegionColumnDef)},
{ 282, -1, -1, sizeof(::greptime::v1::region::BulkInsertRequest)},
{ 291, -1, -1, sizeof(::greptime::v1::region::MitoManifestInfo)},
{ 298, -1, -1, sizeof(::greptime::v1::region::MetricManifestInfo)},
{ 306, -1, -1, sizeof(::greptime::v1::region::SyncRequest)},
{ 316, -1, -1, sizeof(::greptime::v1::region::ListMetadataRequest)},
{ 277, -1, -1, sizeof(::greptime::v1::region::All)},
{ 283, -1, -1, sizeof(::greptime::v1::region::RegionColumnDef)},
{ 291, -1, -1, sizeof(::greptime::v1::region::BulkInsertRequest)},
{ 300, -1, -1, sizeof(::greptime::v1::region::MitoManifestInfo)},
{ 307, -1, -1, sizeof(::greptime::v1::region::MetricManifestInfo)},
{ 315, -1, -1, sizeof(::greptime::v1::region::SyncRequest)},
{ 325, -1, -1, sizeof(::greptime::v1::region::ListMetadataRequest)},
};
static const ::_pb::Message* const file_default_instances[] = {
@@ -917,6 +940,7 @@ static const ::_pb::Message* const file_default_instances[] = {
&::greptime::v1::region::_StrictWindow_default_instance_._instance,
&::greptime::v1::region::_CompactRequest_default_instance_._instance,
&::greptime::v1::region::_TruncateRequest_default_instance_._instance,
&::greptime::v1::region::_All_default_instance_._instance,
&::greptime::v1::region::_RegionColumnDef_default_instance_._instance,
&::greptime::v1::region::_BulkInsertRequest_default_instance_._instance,
&::greptime::v1::region::_MitoManifestInfo_default_instance_._instance,
@@ -1025,26 +1049,29 @@ const char descriptor_table_protodef_greptime_2fv1_2fregion_2fserver_2eproto[] P
"\004\022.\n\007regular\030\002 \001(\0132\033.greptime.v1.region."
"RegularH\000\0229\n\rstrict_window\030\003 \001(\0132 .grept"
"ime.v1.region.StrictWindowH\000B\t\n\007options\""
"$\n\017TruncateRequest\022\021\n\tregion_id\030\001 \001(\004\"P\n"
"\017RegionColumnDef\022*\n\ncolumn_def\030\001 \001(\0132\026.g"
"reptime.v1.ColumnDef\022\021\n\tcolumn_id\030\002 \001(\r\""
"Z\n\021BulkInsertRequest\022\021\n\tregion_id\030\001 \001(\004\022"
"*\n\tarrow_ipc\030\002 \001(\0132\025.greptime.v1.ArrowIp"
"cH\000B\006\n\004body\"1\n\020MitoManifestInfo\022\035\n\025data_"
"manifest_version\030\001 \001(\004\"V\n\022MetricManifest"
"Info\022\035\n\025data_manifest_version\030\001 \001(\004\022!\n\031m"
"etadata_manifest_version\030\002 \001(\004\"\275\001\n\013SyncR"
"equest\022\021\n\tregion_id\030\001 \001(\004\022B\n\022mito_manife"
"st_info\030\002 \001(\0132$.greptime.v1.region.MitoM"
"anifestInfoH\000\022F\n\024metric_manifest_info\030\003 "
"\001(\0132&.greptime.v1.region.MetricManifestI"
"nfoH\000B\017\n\rmanifest_info\")\n\023ListMetadataRe"
"quest\022\022\n\nregion_ids\030\001 \003(\0042Y\n\006Region\022O\n\006H"
"andle\022!.greptime.v1.region.RegionRequest"
"\032\".greptime.v1.region.RegionResponseB]\n\025"
"io.greptime.v1.regionB\006ServerZ<github.co"
"m/GreptimeTeam/greptime-proto/go/greptim"
"e/v1/regionb\006proto3"
"\204\001\n\017TruncateRequest\022\021\n\tregion_id\030\001 \001(\004\022&"
"\n\003all\030\002 \001(\0132\027.greptime.v1.region.AllH\000\022."
"\n\013time_ranges\030\003 \001(\0132\027.greptime.v1.TimeRa"
"ngesH\000B\006\n\004kind\"\005\n\003All\"P\n\017RegionColumnDef"
"\022*\n\ncolumn_def\030\001 \001(\0132\026.greptime.v1.Colum"
"nDef\022\021\n\tcolumn_id\030\002 \001(\r\"Z\n\021BulkInsertReq"
"uest\022\021\n\tregion_id\030\001 \001(\004\022*\n\tarrow_ipc\030\002 \001"
"(\0132\025.greptime.v1.ArrowIpcH\000B\006\n\004body\"1\n\020M"
"itoManifestInfo\022\035\n\025data_manifest_version"
"\030\001 \001(\004\"V\n\022MetricManifestInfo\022\035\n\025data_man"
"ifest_version\030\001 \001(\004\022!\n\031metadata_manifest"
"_version\030\002 \001(\004\"\275\001\n\013SyncRequest\022\021\n\tregion"
"_id\030\001 \001(\004\022B\n\022mito_manifest_info\030\002 \001(\0132$."
"greptime.v1.region.MitoManifestInfoH\000\022F\n"
"\024metric_manifest_info\030\003 \001(\0132&.greptime.v"
"1.region.MetricManifestInfoH\000B\017\n\rmanifes"
"t_info\")\n\023ListMetadataRequest\022\022\n\nregion_"
"ids\030\001 \003(\0042Y\n\006Region\022O\n\006Handle\022!.greptime"
".v1.region.RegionRequest\032\".greptime.v1.r"
"egion.RegionResponseB]\n\025io.greptime.v1.r"
"egionB\006ServerZ<github.com/GreptimeTeam/g"
"reptime-proto/go/greptime/v1/regionb\006pro"
"to3"
;
static const ::_pbi::DescriptorTable* const descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_deps[3] = {
&::descriptor_table_greptime_2fv1_2fcommon_2eproto,
@@ -1053,9 +1080,9 @@ 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, 4739, descriptor_table_protodef_greptime_2fv1_2fregion_2fserver_2eproto,
false, false, 4843, 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, 3, 36,
&descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once, descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_deps, 3, 37,
schemas, file_default_instances, TableStruct_greptime_2fv1_2fregion_2fserver_2eproto::offsets,
file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto, file_level_enum_descriptors_greptime_2fv1_2fregion_2fserver_2eproto,
file_level_service_descriptors_greptime_2fv1_2fregion_2fserver_2eproto,
@@ -8523,8 +8550,57 @@ void CompactRequest::InternalSwap(CompactRequest* other) {
class TruncateRequest::_Internal {
public:
static const ::greptime::v1::region::All& all(const TruncateRequest* msg);
static const ::greptime::v1::TimeRanges& time_ranges(const TruncateRequest* msg);
};
const ::greptime::v1::region::All&
TruncateRequest::_Internal::all(const TruncateRequest* msg) {
return *msg->_impl_.kind_.all_;
}
const ::greptime::v1::TimeRanges&
TruncateRequest::_Internal::time_ranges(const TruncateRequest* msg) {
return *msg->_impl_.kind_.time_ranges_;
}
void TruncateRequest::set_allocated_all(::greptime::v1::region::All* all) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
clear_kind();
if (all) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(all);
if (message_arena != submessage_arena) {
all = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, all, submessage_arena);
}
set_has_all();
_impl_.kind_.all_ = all;
}
// @@protoc_insertion_point(field_set_allocated:greptime.v1.region.TruncateRequest.all)
}
void TruncateRequest::set_allocated_time_ranges(::greptime::v1::TimeRanges* time_ranges) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
clear_kind();
if (time_ranges) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(
reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(time_ranges));
if (message_arena != submessage_arena) {
time_ranges = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, time_ranges, submessage_arena);
}
set_has_time_ranges();
_impl_.kind_.time_ranges_ = time_ranges;
}
// @@protoc_insertion_point(field_set_allocated:greptime.v1.region.TruncateRequest.time_ranges)
}
void TruncateRequest::clear_time_ranges() {
if (_internal_has_time_ranges()) {
if (GetArenaForAllocation() == nullptr) {
delete _impl_.kind_.time_ranges_;
}
clear_has_kind();
}
}
TruncateRequest::TruncateRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
@@ -8536,10 +8612,28 @@ TruncateRequest::TruncateRequest(const TruncateRequest& from)
TruncateRequest* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.region_id_){}
, /*decltype(_impl_._cached_size_)*/{}};
, decltype(_impl_.kind_){}
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_._oneof_case_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_this->_impl_.region_id_ = from._impl_.region_id_;
clear_has_kind();
switch (from.kind_case()) {
case kAll: {
_this->_internal_mutable_all()->::greptime::v1::region::All::MergeFrom(
from._internal_all());
break;
}
case kTimeRanges: {
_this->_internal_mutable_time_ranges()->::greptime::v1::TimeRanges::MergeFrom(
from._internal_time_ranges());
break;
}
case KIND_NOT_SET: {
break;
}
}
// @@protoc_insertion_point(copy_constructor:greptime.v1.region.TruncateRequest)
}
@@ -8549,8 +8643,11 @@ inline void TruncateRequest::SharedCtor(
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.region_id_){uint64_t{0u}}
, decltype(_impl_.kind_){}
, /*decltype(_impl_._cached_size_)*/{}
, /*decltype(_impl_._oneof_case_)*/{}
};
clear_has_kind();
}
TruncateRequest::~TruncateRequest() {
@@ -8564,12 +8661,38 @@ TruncateRequest::~TruncateRequest() {
inline void TruncateRequest::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
if (has_kind()) {
clear_kind();
}
}
void TruncateRequest::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
void TruncateRequest::clear_kind() {
// @@protoc_insertion_point(one_of_clear_start:greptime.v1.region.TruncateRequest)
switch (kind_case()) {
case kAll: {
if (GetArenaForAllocation() == nullptr) {
delete _impl_.kind_.all_;
}
break;
}
case kTimeRanges: {
if (GetArenaForAllocation() == nullptr) {
delete _impl_.kind_.time_ranges_;
}
break;
}
case KIND_NOT_SET: {
break;
}
}
_impl_._oneof_case_[0] = KIND_NOT_SET;
}
void TruncateRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:greptime.v1.region.TruncateRequest)
uint32_t cached_has_bits = 0;
@@ -8577,6 +8700,7 @@ void TruncateRequest::Clear() {
(void) cached_has_bits;
_impl_.region_id_ = uint64_t{0u};
clear_kind();
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
@@ -8594,6 +8718,22 @@ const char* TruncateRequest::_InternalParse(const char* ptr, ::_pbi::ParseContex
} else
goto handle_unusual;
continue;
// .greptime.v1.region.All all = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
ptr = ctx->ParseMessage(_internal_mutable_all(), ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// .greptime.v1.TimeRanges time_ranges = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
ptr = ctx->ParseMessage(_internal_mutable_time_ranges(), ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
@@ -8629,6 +8769,20 @@ uint8_t* TruncateRequest::_InternalSerialize(
target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_region_id(), target);
}
// .greptime.v1.region.All all = 2;
if (_internal_has_all()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(2, _Internal::all(this),
_Internal::all(this).GetCachedSize(), target, stream);
}
// .greptime.v1.TimeRanges time_ranges = 3;
if (_internal_has_time_ranges()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(3, _Internal::time_ranges(this),
_Internal::time_ranges(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);
@@ -8650,6 +8804,25 @@ size_t TruncateRequest::ByteSizeLong() const {
total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_region_id());
}
switch (kind_case()) {
// .greptime.v1.region.All all = 2;
case kAll: {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*_impl_.kind_.all_);
break;
}
// .greptime.v1.TimeRanges time_ranges = 3;
case kTimeRanges: {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*_impl_.kind_.time_ranges_);
break;
}
case KIND_NOT_SET: {
break;
}
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
@@ -8671,6 +8844,21 @@ void TruncateRequest::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const
if (from._internal_region_id() != 0) {
_this->_internal_set_region_id(from._internal_region_id());
}
switch (from.kind_case()) {
case kAll: {
_this->_internal_mutable_all()->::greptime::v1::region::All::MergeFrom(
from._internal_all());
break;
}
case kTimeRanges: {
_this->_internal_mutable_time_ranges()->::greptime::v1::TimeRanges::MergeFrom(
from._internal_time_ranges());
break;
}
case KIND_NOT_SET: {
break;
}
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
@@ -8689,6 +8877,8 @@ void TruncateRequest::InternalSwap(TruncateRequest* other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_.region_id_, other->_impl_.region_id_);
swap(_impl_.kind_, other->_impl_.kind_);
swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}
::PROTOBUF_NAMESPACE_ID::Metadata TruncateRequest::GetMetadata() const {
@@ -8699,6 +8889,46 @@ void TruncateRequest::InternalSwap(TruncateRequest* other) {
// ===================================================================
class All::_Internal {
public:
};
All::All(::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.region.All)
}
All::All(const All& from)
: ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() {
All* const _this = this; (void)_this;
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:greptime.v1.region.All)
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData All::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl,
::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl,
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*All::GetClassData() const { return &_class_data_; }
::PROTOBUF_NAMESPACE_ID::Metadata All::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once,
file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[30]);
}
// ===================================================================
class RegionColumnDef::_Internal {
public:
static const ::greptime::v1::ColumnDef& column_def(const RegionColumnDef* msg);
@@ -8924,7 +9154,7 @@ void RegionColumnDef::InternalSwap(RegionColumnDef* other) {
::PROTOBUF_NAMESPACE_ID::Metadata RegionColumnDef::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once,
file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[30]);
file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[31]);
}
// ===================================================================
@@ -9207,7 +9437,7 @@ void BulkInsertRequest::InternalSwap(BulkInsertRequest* other) {
::PROTOBUF_NAMESPACE_ID::Metadata BulkInsertRequest::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once,
file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[31]);
file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[32]);
}
// ===================================================================
@@ -9385,7 +9615,7 @@ void MitoManifestInfo::InternalSwap(MitoManifestInfo* other) {
::PROTOBUF_NAMESPACE_ID::Metadata MitoManifestInfo::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once,
file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[32]);
file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[33]);
}
// ===================================================================
@@ -9596,7 +9826,7 @@ void MetricManifestInfo::InternalSwap(MetricManifestInfo* other) {
::PROTOBUF_NAMESPACE_ID::Metadata MetricManifestInfo::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once,
file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[33]);
file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[34]);
}
// ===================================================================
@@ -9928,7 +10158,7 @@ void SyncRequest::InternalSwap(SyncRequest* other) {
::PROTOBUF_NAMESPACE_ID::Metadata SyncRequest::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once,
file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[34]);
file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[35]);
}
// ===================================================================
@@ -10121,7 +10351,7 @@ void ListMetadataRequest::InternalSwap(ListMetadataRequest* other) {
::PROTOBUF_NAMESPACE_ID::Metadata ListMetadataRequest::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_getter, &descriptor_table_greptime_2fv1_2fregion_2fserver_2eproto_once,
file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[35]);
file_level_metadata_greptime_2fv1_2fregion_2fserver_2eproto[36]);
}
// @@protoc_insertion_point(namespace_scope)
@@ -10249,6 +10479,10 @@ template<> PROTOBUF_NOINLINE ::greptime::v1::region::TruncateRequest*
Arena::CreateMaybeMessage< ::greptime::v1::region::TruncateRequest >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::region::TruncateRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::region::All*
Arena::CreateMaybeMessage< ::greptime::v1::region::All >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::region::All >(arena);
}
template<> PROTOBUF_NOINLINE ::greptime::v1::region::RegionColumnDef*
Arena::CreateMaybeMessage< ::greptime::v1::region::RegionColumnDef >(Arena* arena) {
return Arena::CreateMessageInternal< ::greptime::v1::region::RegionColumnDef >(arena);
+345 -9
View File
@@ -60,6 +60,9 @@ extern AddColumnDefaultTypeInternal _AddColumn_default_instance_;
class AddColumns;
struct AddColumnsDefaultTypeInternal;
extern AddColumnsDefaultTypeInternal _AddColumns_default_instance_;
class All;
struct AllDefaultTypeInternal;
extern AllDefaultTypeInternal _All_default_instance_;
class AlterRequest;
struct AlterRequestDefaultTypeInternal;
extern AlterRequestDefaultTypeInternal _AlterRequest_default_instance_;
@@ -168,6 +171,7 @@ extern TruncateRequestDefaultTypeInternal _TruncateRequest_default_instance_;
PROTOBUF_NAMESPACE_OPEN
template<> ::greptime::v1::region::AddColumn* Arena::CreateMaybeMessage<::greptime::v1::region::AddColumn>(Arena*);
template<> ::greptime::v1::region::AddColumns* Arena::CreateMaybeMessage<::greptime::v1::region::AddColumns>(Arena*);
template<> ::greptime::v1::region::All* Arena::CreateMaybeMessage<::greptime::v1::region::All>(Arena*);
template<> ::greptime::v1::region::AlterRequest* Arena::CreateMaybeMessage<::greptime::v1::region::AlterRequest>(Arena*);
template<> ::greptime::v1::region::AlterRequests* Arena::CreateMaybeMessage<::greptime::v1::region::AlterRequests>(Arena*);
template<> ::greptime::v1::region::BulkInsertRequest* Arena::CreateMaybeMessage<::greptime::v1::region::BulkInsertRequest>(Arena*);
@@ -5224,6 +5228,12 @@ class TruncateRequest final :
static const TruncateRequest& default_instance() {
return *internal_default_instance();
}
enum KindCase {
kAll = 2,
kTimeRanges = 3,
KIND_NOT_SET = 0,
};
static inline const TruncateRequest* internal_default_instance() {
return reinterpret_cast<const TruncateRequest*>(
&_TruncateRequest_default_instance_);
@@ -5303,6 +5313,8 @@ class TruncateRequest final :
enum : int {
kRegionIdFieldNumber = 1,
kAllFieldNumber = 2,
kTimeRangesFieldNumber = 3,
};
// uint64 region_id = 1;
void clear_region_id();
@@ -5313,18 +5325,187 @@ class TruncateRequest final :
void _internal_set_region_id(uint64_t value);
public:
// .greptime.v1.region.All all = 2;
bool has_all() const;
private:
bool _internal_has_all() const;
public:
void clear_all();
const ::greptime::v1::region::All& all() const;
PROTOBUF_NODISCARD ::greptime::v1::region::All* release_all();
::greptime::v1::region::All* mutable_all();
void set_allocated_all(::greptime::v1::region::All* all);
private:
const ::greptime::v1::region::All& _internal_all() const;
::greptime::v1::region::All* _internal_mutable_all();
public:
void unsafe_arena_set_allocated_all(
::greptime::v1::region::All* all);
::greptime::v1::region::All* unsafe_arena_release_all();
// .greptime.v1.TimeRanges time_ranges = 3;
bool has_time_ranges() const;
private:
bool _internal_has_time_ranges() const;
public:
void clear_time_ranges();
const ::greptime::v1::TimeRanges& time_ranges() const;
PROTOBUF_NODISCARD ::greptime::v1::TimeRanges* release_time_ranges();
::greptime::v1::TimeRanges* mutable_time_ranges();
void set_allocated_time_ranges(::greptime::v1::TimeRanges* time_ranges);
private:
const ::greptime::v1::TimeRanges& _internal_time_ranges() const;
::greptime::v1::TimeRanges* _internal_mutable_time_ranges();
public:
void unsafe_arena_set_allocated_time_ranges(
::greptime::v1::TimeRanges* time_ranges);
::greptime::v1::TimeRanges* unsafe_arena_release_time_ranges();
void clear_kind();
KindCase kind_case() const;
// @@protoc_insertion_point(class_scope:greptime.v1.region.TruncateRequest)
private:
class _Internal;
void set_has_all();
void set_has_time_ranges();
inline bool has_kind() const;
inline void clear_has_kind();
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
uint64_t region_id_;
union KindUnion {
constexpr KindUnion() : _constinit_{} {}
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_;
::greptime::v1::region::All* all_;
::greptime::v1::TimeRanges* time_ranges_;
} kind_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
uint32_t _oneof_case_[1];
};
union { Impl_ _impl_; };
friend struct ::TableStruct_greptime_2fv1_2fregion_2fserver_2eproto;
};
// -------------------------------------------------------------------
class All final :
public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:greptime.v1.region.All) */ {
public:
inline All() : All(nullptr) {}
explicit PROTOBUF_CONSTEXPR All(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
All(const All& from);
All(All&& from) noexcept
: All() {
*this = ::std::move(from);
}
inline All& operator=(const All& from) {
CopyFrom(from);
return *this;
}
inline All& operator=(All&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const All& default_instance() {
return *internal_default_instance();
}
static inline const All* internal_default_instance() {
return reinterpret_cast<const All*>(
&_All_default_instance_);
}
static constexpr int kIndexInFileMessages =
30;
friend void swap(All& a, All& b) {
a.Swap(&b);
}
inline void Swap(All* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(All* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
All* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<All>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom;
inline void CopyFrom(const All& from) {
::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(*this, from);
}
using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom;
void MergeFrom(const All& from) {
::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(*this, from);
}
public:
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "greptime.v1.region.All";
}
protected:
explicit All(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
public:
static const ClassData _class_data_;
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:greptime.v1.region.All)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
uint64_t region_id_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_greptime_2fv1_2fregion_2fserver_2eproto;
};
// -------------------------------------------------------------------
@@ -5377,7 +5558,7 @@ class RegionColumnDef final :
&_RegionColumnDef_default_instance_);
}
static constexpr int kIndexInFileMessages =
30;
31;
friend void swap(RegionColumnDef& a, RegionColumnDef& b) {
a.Swap(&b);
@@ -5550,7 +5731,7 @@ class BulkInsertRequest final :
&_BulkInsertRequest_default_instance_);
}
static constexpr int kIndexInFileMessages =
31;
32;
friend void swap(BulkInsertRequest& a, BulkInsertRequest& b) {
a.Swap(&b);
@@ -5730,7 +5911,7 @@ class MitoManifestInfo final :
&_MitoManifestInfo_default_instance_);
}
static constexpr int kIndexInFileMessages =
32;
33;
friend void swap(MitoManifestInfo& a, MitoManifestInfo& b) {
a.Swap(&b);
@@ -5878,7 +6059,7 @@ class MetricManifestInfo final :
&_MetricManifestInfo_default_instance_);
}
static constexpr int kIndexInFileMessages =
33;
34;
friend void swap(MetricManifestInfo& a, MetricManifestInfo& b) {
a.Swap(&b);
@@ -6043,7 +6224,7 @@ class SyncRequest final :
&_SyncRequest_default_instance_);
}
static constexpr int kIndexInFileMessages =
34;
35;
friend void swap(SyncRequest& a, SyncRequest& b) {
a.Swap(&b);
@@ -6244,7 +6425,7 @@ class ListMetadataRequest final :
&_ListMetadataRequest_default_instance_);
}
static constexpr int kIndexInFileMessages =
35;
36;
friend void swap(ListMetadataRequest& a, ListMetadataRequest& b) {
a.Swap(&b);
@@ -10568,6 +10749,159 @@ inline void TruncateRequest::set_region_id(uint64_t value) {
// @@protoc_insertion_point(field_set:greptime.v1.region.TruncateRequest.region_id)
}
// .greptime.v1.region.All all = 2;
inline bool TruncateRequest::_internal_has_all() const {
return kind_case() == kAll;
}
inline bool TruncateRequest::has_all() const {
return _internal_has_all();
}
inline void TruncateRequest::set_has_all() {
_impl_._oneof_case_[0] = kAll;
}
inline void TruncateRequest::clear_all() {
if (_internal_has_all()) {
if (GetArenaForAllocation() == nullptr) {
delete _impl_.kind_.all_;
}
clear_has_kind();
}
}
inline ::greptime::v1::region::All* TruncateRequest::release_all() {
// @@protoc_insertion_point(field_release:greptime.v1.region.TruncateRequest.all)
if (_internal_has_all()) {
clear_has_kind();
::greptime::v1::region::All* temp = _impl_.kind_.all_;
if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
}
_impl_.kind_.all_ = nullptr;
return temp;
} else {
return nullptr;
}
}
inline const ::greptime::v1::region::All& TruncateRequest::_internal_all() const {
return _internal_has_all()
? *_impl_.kind_.all_
: reinterpret_cast< ::greptime::v1::region::All&>(::greptime::v1::region::_All_default_instance_);
}
inline const ::greptime::v1::region::All& TruncateRequest::all() const {
// @@protoc_insertion_point(field_get:greptime.v1.region.TruncateRequest.all)
return _internal_all();
}
inline ::greptime::v1::region::All* TruncateRequest::unsafe_arena_release_all() {
// @@protoc_insertion_point(field_unsafe_arena_release:greptime.v1.region.TruncateRequest.all)
if (_internal_has_all()) {
clear_has_kind();
::greptime::v1::region::All* temp = _impl_.kind_.all_;
_impl_.kind_.all_ = nullptr;
return temp;
} else {
return nullptr;
}
}
inline void TruncateRequest::unsafe_arena_set_allocated_all(::greptime::v1::region::All* all) {
clear_kind();
if (all) {
set_has_all();
_impl_.kind_.all_ = all;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:greptime.v1.region.TruncateRequest.all)
}
inline ::greptime::v1::region::All* TruncateRequest::_internal_mutable_all() {
if (!_internal_has_all()) {
clear_kind();
set_has_all();
_impl_.kind_.all_ = CreateMaybeMessage< ::greptime::v1::region::All >(GetArenaForAllocation());
}
return _impl_.kind_.all_;
}
inline ::greptime::v1::region::All* TruncateRequest::mutable_all() {
::greptime::v1::region::All* _msg = _internal_mutable_all();
// @@protoc_insertion_point(field_mutable:greptime.v1.region.TruncateRequest.all)
return _msg;
}
// .greptime.v1.TimeRanges time_ranges = 3;
inline bool TruncateRequest::_internal_has_time_ranges() const {
return kind_case() == kTimeRanges;
}
inline bool TruncateRequest::has_time_ranges() const {
return _internal_has_time_ranges();
}
inline void TruncateRequest::set_has_time_ranges() {
_impl_._oneof_case_[0] = kTimeRanges;
}
inline ::greptime::v1::TimeRanges* TruncateRequest::release_time_ranges() {
// @@protoc_insertion_point(field_release:greptime.v1.region.TruncateRequest.time_ranges)
if (_internal_has_time_ranges()) {
clear_has_kind();
::greptime::v1::TimeRanges* temp = _impl_.kind_.time_ranges_;
if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
}
_impl_.kind_.time_ranges_ = nullptr;
return temp;
} else {
return nullptr;
}
}
inline const ::greptime::v1::TimeRanges& TruncateRequest::_internal_time_ranges() const {
return _internal_has_time_ranges()
? *_impl_.kind_.time_ranges_
: reinterpret_cast< ::greptime::v1::TimeRanges&>(::greptime::v1::_TimeRanges_default_instance_);
}
inline const ::greptime::v1::TimeRanges& TruncateRequest::time_ranges() const {
// @@protoc_insertion_point(field_get:greptime.v1.region.TruncateRequest.time_ranges)
return _internal_time_ranges();
}
inline ::greptime::v1::TimeRanges* TruncateRequest::unsafe_arena_release_time_ranges() {
// @@protoc_insertion_point(field_unsafe_arena_release:greptime.v1.region.TruncateRequest.time_ranges)
if (_internal_has_time_ranges()) {
clear_has_kind();
::greptime::v1::TimeRanges* temp = _impl_.kind_.time_ranges_;
_impl_.kind_.time_ranges_ = nullptr;
return temp;
} else {
return nullptr;
}
}
inline void TruncateRequest::unsafe_arena_set_allocated_time_ranges(::greptime::v1::TimeRanges* time_ranges) {
clear_kind();
if (time_ranges) {
set_has_time_ranges();
_impl_.kind_.time_ranges_ = time_ranges;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:greptime.v1.region.TruncateRequest.time_ranges)
}
inline ::greptime::v1::TimeRanges* TruncateRequest::_internal_mutable_time_ranges() {
if (!_internal_has_time_ranges()) {
clear_kind();
set_has_time_ranges();
_impl_.kind_.time_ranges_ = CreateMaybeMessage< ::greptime::v1::TimeRanges >(GetArenaForAllocation());
}
return _impl_.kind_.time_ranges_;
}
inline ::greptime::v1::TimeRanges* TruncateRequest::mutable_time_ranges() {
::greptime::v1::TimeRanges* _msg = _internal_mutable_time_ranges();
// @@protoc_insertion_point(field_mutable:greptime.v1.region.TruncateRequest.time_ranges)
return _msg;
}
inline bool TruncateRequest::has_kind() const {
return kind_case() != KIND_NOT_SET;
}
inline void TruncateRequest::clear_has_kind() {
_impl_._oneof_case_[0] = KIND_NOT_SET;
}
inline TruncateRequest::KindCase TruncateRequest::kind_case() const {
return TruncateRequest::KindCase(_impl_._oneof_case_[0]);
}
// -------------------------------------------------------------------
// All
// -------------------------------------------------------------------
// RegionColumnDef
@@ -11149,6 +11483,8 @@ ListMetadataRequest::mutable_region_ids() {
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope)