From a3635b9cdc5d1631431af1106588ab7e1b3b8eab Mon Sep 17 00:00:00 2001 From: "zhenshan.cao" Date: Mon, 21 Sep 2020 17:53:59 +0800 Subject: [PATCH] Update proto Signed-off-by: zhenshan.cao --- core/src/pb/master.pb.cc | 240 +++++++++++++++++++++++++--- core/src/pb/master.pb.h | 122 ++++++++++++++ pkg/master/grpc/master/master.proto | 11 ++ proto/master.proto | 12 ++ proxy/src/grpc/master.pb.cc | 240 +++++++++++++++++++++++++--- proxy/src/grpc/master.pb.h | 122 ++++++++++++++ 6 files changed, 701 insertions(+), 46 deletions(-) diff --git a/core/src/pb/master.pb.cc b/core/src/pb/master.pb.cc index 04b1410505..859cabaf9c 100644 --- a/core/src/pb/master.pb.cc +++ b/core/src/pb/master.pb.cc @@ -76,7 +76,7 @@ static void InitDefaultsscc_info_SegmentStat_master_2eproto() { {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_SegmentStat_master_2eproto}, {}}; static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_master_2eproto[3]; -static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_master_2eproto = nullptr; +static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_master_2eproto[1]; static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_master_2eproto = nullptr; const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_master_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { @@ -105,6 +105,8 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_master_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::masterpb::Segment, open_timestamp_), PROTOBUF_FIELD_OFFSET(::masterpb::Segment, close_timestamp_), PROTOBUF_FIELD_OFFSET(::masterpb::Segment, collection_name_), + PROTOBUF_FIELD_OFFSET(::masterpb::Segment, status_), + PROTOBUF_FIELD_OFFSET(::masterpb::Segment, rows_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, _internal_metadata_), ~0u, // no _extensions_ @@ -113,11 +115,13 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_master_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, segment_id_), PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, memory_size_), PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, memory_rate_), + PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, status_), + PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, rows_), }; static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, sizeof(::masterpb::Collection)}, { 12, -1, sizeof(::masterpb::Segment)}, - { 25, -1, sizeof(::masterpb::SegmentStat)}, + { 27, -1, sizeof(::masterpb::SegmentStat)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { @@ -132,18 +136,22 @@ const char descriptor_table_protodef_master_2eproto[] PROTOBUF_SECTION_VARIABLE( "\022#\n\006schema\030\003 \001(\0132\023.milvus.grpc.Schema\022\023\n" "\013create_time\030\004 \001(\004\022\023\n\013segment_ids\030\005 \003(\004\022" "\026\n\016partition_tags\030\006 \003(\t\022(\n\007indexes\030\007 \003(\013" - "2\027.milvus.grpc.IndexParam\"\301\001\n\007Segment\022\022\n" + "2\027.milvus.grpc.IndexParam\"\370\001\n\007Segment\022\022\n" "\nsegment_id\030\001 \001(\004\022\025\n\rcollection_id\030\002 \001(\004" "\022\025\n\rpartition_tag\030\003 \001(\t\022\025\n\rchannel_start" "\030\004 \001(\005\022\023\n\013channel_end\030\005 \001(\005\022\026\n\016open_time" "stamp\030\006 \001(\004\022\027\n\017close_timestamp\030\007 \001(\004\022\027\n\017" - "collection_name\030\010 \001(\t\"K\n\013SegmentStat\022\022\n\n" - "segment_id\030\001 \001(\004\022\023\n\013memory_size\030\002 \001(\004\022\023\n" - "\013memory_rate\030\003 \001(\0022\210\001\n\006Master\022\?\n\020CreateC" - "ollection\022\024.milvus.grpc.Mapping\032\023.milvus" - ".grpc.Status\"\000\022=\n\013CreateIndex\022\027.milvus.g" - "rpc.IndexParam\032\023.milvus.grpc.Status\"\000B\010Z" - "\006masterb\006proto3" + "collection_name\030\010 \001(\t\022\'\n\006status\030\t \001(\0162\027." + "masterpb.SegmentStatus\022\014\n\004rows\030\n \001(\003\"\202\001\n" + "\013SegmentStat\022\022\n\nsegment_id\030\001 \001(\004\022\023\n\013memo" + "ry_size\030\002 \001(\004\022\023\n\013memory_rate\030\003 \001(\002\022\'\n\006st" + "atus\030\004 \001(\0162\027.masterpb.SegmentStatus\022\014\n\004r" + "ows\030\005 \001(\003*B\n\rSegmentStatus\022\n\n\006OPENED\020\000\022\n" + "\n\006CLOSED\020\001\022\014\n\010INDEXING\020\002\022\013\n\007INDEXED\020\0032\210\001" + "\n\006Master\022\?\n\020CreateCollection\022\024.milvus.gr" + "pc.Mapping\032\023.milvus.grpc.Status\"\000\022=\n\013Cre" + "ateIndex\022\027.milvus.grpc.IndexParam\032\023.milv" + "us.grpc.Status\"\000B\010Z\006masterb\006proto3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_master_2eproto_deps[1] = { &::descriptor_table_message_2eproto, @@ -156,7 +164,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_mas static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_master_2eproto_once; static bool descriptor_table_master_2eproto_initialized = false; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_master_2eproto = { - &descriptor_table_master_2eproto_initialized, descriptor_table_protodef_master_2eproto, "master.proto", 655, + &descriptor_table_master_2eproto_initialized, descriptor_table_protodef_master_2eproto, "master.proto", 834, &descriptor_table_master_2eproto_once, descriptor_table_master_2eproto_sccs, descriptor_table_master_2eproto_deps, 3, 1, schemas, file_default_instances, TableStruct_master_2eproto::offsets, file_level_metadata_master_2eproto, 3, file_level_enum_descriptors_master_2eproto, file_level_service_descriptors_master_2eproto, @@ -165,6 +173,22 @@ const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_master // Force running AddDescriptors() at dynamic initialization time. static bool dynamic_init_dummy_master_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_master_2eproto), true); namespace masterpb { +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SegmentStatus_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_master_2eproto); + return file_level_enum_descriptors_master_2eproto[0]; +} +bool SegmentStatus_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + // =================================================================== @@ -804,8 +828,8 @@ Segment::Segment(const Segment& from) collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); } ::memcpy(&segment_id_, &from.segment_id_, - static_cast(reinterpret_cast(&close_timestamp_) - - reinterpret_cast(&segment_id_)) + sizeof(close_timestamp_)); + static_cast(reinterpret_cast(&status_) - + reinterpret_cast(&segment_id_)) + sizeof(status_)); // @@protoc_insertion_point(copy_constructor:masterpb.Segment) } @@ -814,8 +838,8 @@ void Segment::SharedCtor() { partition_tag_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&close_timestamp_) - - reinterpret_cast(&segment_id_)) + sizeof(close_timestamp_)); + reinterpret_cast(&status_) - + reinterpret_cast(&segment_id_)) + sizeof(status_)); } Segment::~Segment() { @@ -846,8 +870,8 @@ void Segment::Clear() { partition_tag_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&close_timestamp_) - - reinterpret_cast(&segment_id_)) + sizeof(close_timestamp_)); + reinterpret_cast(&status_) - + reinterpret_cast(&segment_id_)) + sizeof(status_)); _internal_metadata_.Clear(); } @@ -915,6 +939,21 @@ const char* Segment::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::in CHK_(ptr); } else goto handle_unusual; continue; + // .masterpb.SegmentStatus status = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + set_status(static_cast<::masterpb::SegmentStatus>(val)); + } else goto handle_unusual; + continue; + // int64 rows = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) { + rows_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; default: { handle_unusual: if ((tag & 7) == 4 || tag == 0) { @@ -1053,6 +1092,33 @@ bool Segment::MergePartialFromCodedStream( break; } + // .masterpb.SegmentStatus status = 9; + case 9: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (72 & 0xFF)) { + int value = 0; + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_status(static_cast< ::masterpb::SegmentStatus >(value)); + } else { + goto handle_unusual; + } + break; + } + + // int64 rows = 10; + case 10: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (80 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &rows_))); + } else { + goto handle_unusual; + } + break; + } + default: { handle_unusual: if (tag == 0) { @@ -1130,6 +1196,17 @@ void Segment::SerializeWithCachedSizes( 8, this->collection_name(), output); } + // .masterpb.SegmentStatus status = 9; + if (this->status() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( + 9, this->status(), output); + } + + // int64 rows = 10; + if (this->rows() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(10, this->rows(), output); + } + if (_internal_metadata_.have_unknown_fields()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); @@ -1195,6 +1272,17 @@ void Segment::SerializeWithCachedSizes( 8, this->collection_name(), target); } + // .masterpb.SegmentStatus status = 9; + if (this->status() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 9, this->status(), target); + } + + // int64 rows = 10; + if (this->rows() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(10, this->rows(), target); + } + if (_internal_metadata_.have_unknown_fields()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); @@ -1272,6 +1360,19 @@ size_t Segment::ByteSizeLong() const { this->close_timestamp()); } + // int64 rows = 10; + if (this->rows() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->rows()); + } + + // .masterpb.SegmentStatus status = 9; + if (this->status() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->status()); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; @@ -1325,6 +1426,12 @@ void Segment::MergeFrom(const Segment& from) { if (from.close_timestamp() != 0) { set_close_timestamp(from.close_timestamp()); } + if (from.rows() != 0) { + set_rows(from.rows()); + } + if (from.status() != 0) { + set_status(from.status()); + } } void Segment::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { @@ -1358,6 +1465,8 @@ void Segment::InternalSwap(Segment* other) { swap(channel_end_, other->channel_end_); swap(open_timestamp_, other->open_timestamp_); swap(close_timestamp_, other->close_timestamp_); + swap(rows_, other->rows_); + swap(status_, other->status_); } ::PROTOBUF_NAMESPACE_ID::Metadata Segment::GetMetadata() const { @@ -1383,15 +1492,15 @@ SegmentStat::SegmentStat(const SegmentStat& from) _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); ::memcpy(&segment_id_, &from.segment_id_, - static_cast(reinterpret_cast(&memory_rate_) - - reinterpret_cast(&segment_id_)) + sizeof(memory_rate_)); + static_cast(reinterpret_cast(&rows_) - + reinterpret_cast(&segment_id_)) + sizeof(rows_)); // @@protoc_insertion_point(copy_constructor:masterpb.SegmentStat) } void SegmentStat::SharedCtor() { ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&memory_rate_) - - reinterpret_cast(&segment_id_)) + sizeof(memory_rate_)); + reinterpret_cast(&rows_) - + reinterpret_cast(&segment_id_)) + sizeof(rows_)); } SegmentStat::~SegmentStat() { @@ -1418,8 +1527,8 @@ void SegmentStat::Clear() { (void) cached_has_bits; ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&memory_rate_) - - reinterpret_cast(&segment_id_)) + sizeof(memory_rate_)); + reinterpret_cast(&rows_) - + reinterpret_cast(&segment_id_)) + sizeof(rows_)); _internal_metadata_.Clear(); } @@ -1452,6 +1561,21 @@ const char* SegmentStat::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID ptr += sizeof(float); } else goto handle_unusual; continue; + // .masterpb.SegmentStatus status = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + set_status(static_cast<::masterpb::SegmentStatus>(val)); + } else goto handle_unusual; + continue; + // int64 rows = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + rows_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; default: { handle_unusual: if ((tag & 7) == 4 || tag == 0) { @@ -1521,6 +1645,33 @@ bool SegmentStat::MergePartialFromCodedStream( break; } + // .masterpb.SegmentStatus status = 4; + case 4: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { + int value = 0; + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_status(static_cast< ::masterpb::SegmentStatus >(value)); + } else { + goto handle_unusual; + } + break; + } + + // int64 rows = 5; + case 5: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &rows_))); + } else { + goto handle_unusual; + } + break; + } + default: { handle_unusual: if (tag == 0) { @@ -1563,6 +1714,17 @@ void SegmentStat::SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(3, this->memory_rate(), output); } + // .masterpb.SegmentStatus status = 4; + if (this->status() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( + 4, this->status(), output); + } + + // int64 rows = 5; + if (this->rows() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(5, this->rows(), output); + } + if (_internal_metadata_.have_unknown_fields()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); @@ -1591,6 +1753,17 @@ void SegmentStat::SerializeWithCachedSizes( target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->memory_rate(), target); } + // .masterpb.SegmentStatus status = 4; + if (this->status() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 4, this->status(), target); + } + + // int64 rows = 5; + if (this->rows() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(5, this->rows(), target); + } + if (_internal_metadata_.have_unknown_fields()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); @@ -1631,6 +1804,19 @@ size_t SegmentStat::ByteSizeLong() const { total_size += 1 + 4; } + // .masterpb.SegmentStatus status = 4; + if (this->status() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->status()); + } + + // int64 rows = 5; + if (this->rows() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->rows()); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; @@ -1667,6 +1853,12 @@ void SegmentStat::MergeFrom(const SegmentStat& from) { if (!(from.memory_rate() <= 0 && from.memory_rate() >= 0)) { set_memory_rate(from.memory_rate()); } + if (from.status() != 0) { + set_status(from.status()); + } + if (from.rows() != 0) { + set_rows(from.rows()); + } } void SegmentStat::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { @@ -1693,6 +1885,8 @@ void SegmentStat::InternalSwap(SegmentStat* other) { swap(segment_id_, other->segment_id_); swap(memory_size_, other->memory_size_); swap(memory_rate_, other->memory_rate_); + swap(status_, other->status_); + swap(rows_, other->rows_); } ::PROTOBUF_NAMESPACE_ID::Metadata SegmentStat::GetMetadata() const { diff --git a/core/src/pb/master.pb.h b/core/src/pb/master.pb.h index e4827888c3..a572507692 100644 --- a/core/src/pb/master.pb.h +++ b/core/src/pb/master.pb.h @@ -31,6 +31,7 @@ #include #include // IWYU pragma: export #include // IWYU pragma: export +#include #include #include "message.pb.h" // @@protoc_insertion_point(includes) @@ -73,6 +74,33 @@ template<> ::masterpb::SegmentStat* Arena::CreateMaybeMessage<::masterpb::Segmen PROTOBUF_NAMESPACE_CLOSE namespace masterpb { +enum SegmentStatus : int { + OPENED = 0, + CLOSED = 1, + INDEXING = 2, + INDEXED = 3, + SegmentStatus_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + SegmentStatus_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool SegmentStatus_IsValid(int value); +constexpr SegmentStatus SegmentStatus_MIN = OPENED; +constexpr SegmentStatus SegmentStatus_MAX = INDEXED; +constexpr int SegmentStatus_ARRAYSIZE = SegmentStatus_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SegmentStatus_descriptor(); +template +inline const std::string& SegmentStatus_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function SegmentStatus_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + SegmentStatus_descriptor(), enum_t_value); +} +inline bool SegmentStatus_Parse( + const std::string& name, SegmentStatus* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + SegmentStatus_descriptor(), name, value); +} // =================================================================== class Collection : @@ -403,6 +431,8 @@ class Segment : kChannelEndFieldNumber = 5, kOpenTimestampFieldNumber = 6, kCloseTimestampFieldNumber = 7, + kRowsFieldNumber = 10, + kStatusFieldNumber = 9, }; // string partition_tag = 3; void clear_partition_tag(); @@ -456,6 +486,16 @@ class Segment : ::PROTOBUF_NAMESPACE_ID::uint64 close_timestamp() const; void set_close_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value); + // int64 rows = 10; + void clear_rows(); + ::PROTOBUF_NAMESPACE_ID::int64 rows() const; + void set_rows(::PROTOBUF_NAMESPACE_ID::int64 value); + + // .masterpb.SegmentStatus status = 9; + void clear_status(); + ::masterpb::SegmentStatus status() const; + void set_status(::masterpb::SegmentStatus value); + // @@protoc_insertion_point(class_scope:masterpb.Segment) private: class _Internal; @@ -469,6 +509,8 @@ class Segment : ::PROTOBUF_NAMESPACE_ID::int32 channel_end_; ::PROTOBUF_NAMESPACE_ID::uint64 open_timestamp_; ::PROTOBUF_NAMESPACE_ID::uint64 close_timestamp_; + ::PROTOBUF_NAMESPACE_ID::int64 rows_; + int status_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_master_2eproto; }; @@ -590,6 +632,8 @@ class SegmentStat : kSegmentIdFieldNumber = 1, kMemorySizeFieldNumber = 2, kMemoryRateFieldNumber = 3, + kStatusFieldNumber = 4, + kRowsFieldNumber = 5, }; // uint64 segment_id = 1; void clear_segment_id(); @@ -606,6 +650,16 @@ class SegmentStat : float memory_rate() const; void set_memory_rate(float value); + // .masterpb.SegmentStatus status = 4; + void clear_status(); + ::masterpb::SegmentStatus status() const; + void set_status(::masterpb::SegmentStatus value); + + // int64 rows = 5; + void clear_rows(); + ::PROTOBUF_NAMESPACE_ID::int64 rows() const; + void set_rows(::PROTOBUF_NAMESPACE_ID::int64 value); + // @@protoc_insertion_point(class_scope:masterpb.SegmentStat) private: class _Internal; @@ -614,6 +668,8 @@ class SegmentStat : ::PROTOBUF_NAMESPACE_ID::uint64 segment_id_; ::PROTOBUF_NAMESPACE_ID::uint64 memory_size_; float memory_rate_; + int status_; + ::PROTOBUF_NAMESPACE_ID::int64 rows_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_master_2eproto; }; @@ -1064,6 +1120,34 @@ inline void Segment::set_allocated_collection_name(std::string* collection_name) // @@protoc_insertion_point(field_set_allocated:masterpb.Segment.collection_name) } +// .masterpb.SegmentStatus status = 9; +inline void Segment::clear_status() { + status_ = 0; +} +inline ::masterpb::SegmentStatus Segment::status() const { + // @@protoc_insertion_point(field_get:masterpb.Segment.status) + return static_cast< ::masterpb::SegmentStatus >(status_); +} +inline void Segment::set_status(::masterpb::SegmentStatus value) { + + status_ = value; + // @@protoc_insertion_point(field_set:masterpb.Segment.status) +} + +// int64 rows = 10; +inline void Segment::clear_rows() { + rows_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 Segment::rows() const { + // @@protoc_insertion_point(field_get:masterpb.Segment.rows) + return rows_; +} +inline void Segment::set_rows(::PROTOBUF_NAMESPACE_ID::int64 value) { + + rows_ = value; + // @@protoc_insertion_point(field_set:masterpb.Segment.rows) +} + // ------------------------------------------------------------------- // SegmentStat @@ -1110,6 +1194,34 @@ inline void SegmentStat::set_memory_rate(float value) { // @@protoc_insertion_point(field_set:masterpb.SegmentStat.memory_rate) } +// .masterpb.SegmentStatus status = 4; +inline void SegmentStat::clear_status() { + status_ = 0; +} +inline ::masterpb::SegmentStatus SegmentStat::status() const { + // @@protoc_insertion_point(field_get:masterpb.SegmentStat.status) + return static_cast< ::masterpb::SegmentStatus >(status_); +} +inline void SegmentStat::set_status(::masterpb::SegmentStatus value) { + + status_ = value; + // @@protoc_insertion_point(field_set:masterpb.SegmentStat.status) +} + +// int64 rows = 5; +inline void SegmentStat::clear_rows() { + rows_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 SegmentStat::rows() const { + // @@protoc_insertion_point(field_get:masterpb.SegmentStat.rows) + return rows_; +} +inline void SegmentStat::set_rows(::PROTOBUF_NAMESPACE_ID::int64 value) { + + rows_ = value; + // @@protoc_insertion_point(field_set:masterpb.SegmentStat.rows) +} + #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ @@ -1122,6 +1234,16 @@ inline void SegmentStat::set_memory_rate(float value) { } // namespace masterpb +PROTOBUF_NAMESPACE_OPEN + +template <> struct is_proto_enum< ::masterpb::SegmentStatus> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::masterpb::SegmentStatus>() { + return ::masterpb::SegmentStatus_descriptor(); +} + +PROTOBUF_NAMESPACE_CLOSE + // @@protoc_insertion_point(global_scope) #include diff --git a/pkg/master/grpc/master/master.proto b/pkg/master/grpc/master/master.proto index 94ac32793d..63983dd126 100644 --- a/pkg/master/grpc/master/master.proto +++ b/pkg/master/grpc/master/master.proto @@ -16,6 +16,13 @@ message Collection { repeated milvus.grpc.IndexParam indexes=7; } +enum SegmentStatus { + OPENED = 0; + CLOSED = 1; + INDEXING = 2; + INDEXED = 3; +} + message Segment { uint64 segment_id=1; uint64 collection_id =2; @@ -25,12 +32,16 @@ message Segment { uint64 open_timestamp=6; uint64 close_timestamp=7; string collection_name=8; + SegmentStatus status=9; + int64 rows=10; } message SegmentStat { uint64 segment_id=1; uint64 memory_size=2; float memory_rate=3; + SegmentStatus status=4; + int64 rows=5; } service Master { diff --git a/proto/master.proto b/proto/master.proto index f612efcf9d..eee4a751a9 100644 --- a/proto/master.proto +++ b/proto/master.proto @@ -16,6 +16,13 @@ message Collection { repeated milvus.grpc.IndexParam indexes=7; } +enum SegmentStatus { + OPENED = 0; + CLOSED = 1; + INDEXING = 2; + INDEXED = 3; +} + message Segment { uint64 segment_id=1; uint64 collection_id =2; @@ -25,12 +32,17 @@ message Segment { uint64 open_timestamp=6; uint64 close_timestamp=7; string collection_name=8; + SegmentStatus status=9; + int64 rows=10; } + message SegmentStat { uint64 segment_id=1; uint64 memory_size=2; float memory_rate=3; + SegmentStatus status=4; + int64 rows=5; } service Master { diff --git a/proxy/src/grpc/master.pb.cc b/proxy/src/grpc/master.pb.cc index 04b1410505..859cabaf9c 100644 --- a/proxy/src/grpc/master.pb.cc +++ b/proxy/src/grpc/master.pb.cc @@ -76,7 +76,7 @@ static void InitDefaultsscc_info_SegmentStat_master_2eproto() { {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_SegmentStat_master_2eproto}, {}}; static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_master_2eproto[3]; -static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_master_2eproto = nullptr; +static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_master_2eproto[1]; static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_master_2eproto = nullptr; const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_master_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { @@ -105,6 +105,8 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_master_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::masterpb::Segment, open_timestamp_), PROTOBUF_FIELD_OFFSET(::masterpb::Segment, close_timestamp_), PROTOBUF_FIELD_OFFSET(::masterpb::Segment, collection_name_), + PROTOBUF_FIELD_OFFSET(::masterpb::Segment, status_), + PROTOBUF_FIELD_OFFSET(::masterpb::Segment, rows_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, _internal_metadata_), ~0u, // no _extensions_ @@ -113,11 +115,13 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_master_2eproto::offsets[] PROT PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, segment_id_), PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, memory_size_), PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, memory_rate_), + PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, status_), + PROTOBUF_FIELD_OFFSET(::masterpb::SegmentStat, rows_), }; static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, sizeof(::masterpb::Collection)}, { 12, -1, sizeof(::masterpb::Segment)}, - { 25, -1, sizeof(::masterpb::SegmentStat)}, + { 27, -1, sizeof(::masterpb::SegmentStat)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { @@ -132,18 +136,22 @@ const char descriptor_table_protodef_master_2eproto[] PROTOBUF_SECTION_VARIABLE( "\022#\n\006schema\030\003 \001(\0132\023.milvus.grpc.Schema\022\023\n" "\013create_time\030\004 \001(\004\022\023\n\013segment_ids\030\005 \003(\004\022" "\026\n\016partition_tags\030\006 \003(\t\022(\n\007indexes\030\007 \003(\013" - "2\027.milvus.grpc.IndexParam\"\301\001\n\007Segment\022\022\n" + "2\027.milvus.grpc.IndexParam\"\370\001\n\007Segment\022\022\n" "\nsegment_id\030\001 \001(\004\022\025\n\rcollection_id\030\002 \001(\004" "\022\025\n\rpartition_tag\030\003 \001(\t\022\025\n\rchannel_start" "\030\004 \001(\005\022\023\n\013channel_end\030\005 \001(\005\022\026\n\016open_time" "stamp\030\006 \001(\004\022\027\n\017close_timestamp\030\007 \001(\004\022\027\n\017" - "collection_name\030\010 \001(\t\"K\n\013SegmentStat\022\022\n\n" - "segment_id\030\001 \001(\004\022\023\n\013memory_size\030\002 \001(\004\022\023\n" - "\013memory_rate\030\003 \001(\0022\210\001\n\006Master\022\?\n\020CreateC" - "ollection\022\024.milvus.grpc.Mapping\032\023.milvus" - ".grpc.Status\"\000\022=\n\013CreateIndex\022\027.milvus.g" - "rpc.IndexParam\032\023.milvus.grpc.Status\"\000B\010Z" - "\006masterb\006proto3" + "collection_name\030\010 \001(\t\022\'\n\006status\030\t \001(\0162\027." + "masterpb.SegmentStatus\022\014\n\004rows\030\n \001(\003\"\202\001\n" + "\013SegmentStat\022\022\n\nsegment_id\030\001 \001(\004\022\023\n\013memo" + "ry_size\030\002 \001(\004\022\023\n\013memory_rate\030\003 \001(\002\022\'\n\006st" + "atus\030\004 \001(\0162\027.masterpb.SegmentStatus\022\014\n\004r" + "ows\030\005 \001(\003*B\n\rSegmentStatus\022\n\n\006OPENED\020\000\022\n" + "\n\006CLOSED\020\001\022\014\n\010INDEXING\020\002\022\013\n\007INDEXED\020\0032\210\001" + "\n\006Master\022\?\n\020CreateCollection\022\024.milvus.gr" + "pc.Mapping\032\023.milvus.grpc.Status\"\000\022=\n\013Cre" + "ateIndex\022\027.milvus.grpc.IndexParam\032\023.milv" + "us.grpc.Status\"\000B\010Z\006masterb\006proto3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_master_2eproto_deps[1] = { &::descriptor_table_message_2eproto, @@ -156,7 +164,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_mas static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_master_2eproto_once; static bool descriptor_table_master_2eproto_initialized = false; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_master_2eproto = { - &descriptor_table_master_2eproto_initialized, descriptor_table_protodef_master_2eproto, "master.proto", 655, + &descriptor_table_master_2eproto_initialized, descriptor_table_protodef_master_2eproto, "master.proto", 834, &descriptor_table_master_2eproto_once, descriptor_table_master_2eproto_sccs, descriptor_table_master_2eproto_deps, 3, 1, schemas, file_default_instances, TableStruct_master_2eproto::offsets, file_level_metadata_master_2eproto, 3, file_level_enum_descriptors_master_2eproto, file_level_service_descriptors_master_2eproto, @@ -165,6 +173,22 @@ const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_master // Force running AddDescriptors() at dynamic initialization time. static bool dynamic_init_dummy_master_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_master_2eproto), true); namespace masterpb { +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SegmentStatus_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_master_2eproto); + return file_level_enum_descriptors_master_2eproto[0]; +} +bool SegmentStatus_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + // =================================================================== @@ -804,8 +828,8 @@ Segment::Segment(const Segment& from) collection_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.collection_name_); } ::memcpy(&segment_id_, &from.segment_id_, - static_cast(reinterpret_cast(&close_timestamp_) - - reinterpret_cast(&segment_id_)) + sizeof(close_timestamp_)); + static_cast(reinterpret_cast(&status_) - + reinterpret_cast(&segment_id_)) + sizeof(status_)); // @@protoc_insertion_point(copy_constructor:masterpb.Segment) } @@ -814,8 +838,8 @@ void Segment::SharedCtor() { partition_tag_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); collection_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&close_timestamp_) - - reinterpret_cast(&segment_id_)) + sizeof(close_timestamp_)); + reinterpret_cast(&status_) - + reinterpret_cast(&segment_id_)) + sizeof(status_)); } Segment::~Segment() { @@ -846,8 +870,8 @@ void Segment::Clear() { partition_tag_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); collection_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&close_timestamp_) - - reinterpret_cast(&segment_id_)) + sizeof(close_timestamp_)); + reinterpret_cast(&status_) - + reinterpret_cast(&segment_id_)) + sizeof(status_)); _internal_metadata_.Clear(); } @@ -915,6 +939,21 @@ const char* Segment::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::in CHK_(ptr); } else goto handle_unusual; continue; + // .masterpb.SegmentStatus status = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + set_status(static_cast<::masterpb::SegmentStatus>(val)); + } else goto handle_unusual; + continue; + // int64 rows = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) { + rows_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; default: { handle_unusual: if ((tag & 7) == 4 || tag == 0) { @@ -1053,6 +1092,33 @@ bool Segment::MergePartialFromCodedStream( break; } + // .masterpb.SegmentStatus status = 9; + case 9: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (72 & 0xFF)) { + int value = 0; + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_status(static_cast< ::masterpb::SegmentStatus >(value)); + } else { + goto handle_unusual; + } + break; + } + + // int64 rows = 10; + case 10: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (80 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &rows_))); + } else { + goto handle_unusual; + } + break; + } + default: { handle_unusual: if (tag == 0) { @@ -1130,6 +1196,17 @@ void Segment::SerializeWithCachedSizes( 8, this->collection_name(), output); } + // .masterpb.SegmentStatus status = 9; + if (this->status() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( + 9, this->status(), output); + } + + // int64 rows = 10; + if (this->rows() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(10, this->rows(), output); + } + if (_internal_metadata_.have_unknown_fields()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); @@ -1195,6 +1272,17 @@ void Segment::SerializeWithCachedSizes( 8, this->collection_name(), target); } + // .masterpb.SegmentStatus status = 9; + if (this->status() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 9, this->status(), target); + } + + // int64 rows = 10; + if (this->rows() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(10, this->rows(), target); + } + if (_internal_metadata_.have_unknown_fields()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); @@ -1272,6 +1360,19 @@ size_t Segment::ByteSizeLong() const { this->close_timestamp()); } + // int64 rows = 10; + if (this->rows() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->rows()); + } + + // .masterpb.SegmentStatus status = 9; + if (this->status() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->status()); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; @@ -1325,6 +1426,12 @@ void Segment::MergeFrom(const Segment& from) { if (from.close_timestamp() != 0) { set_close_timestamp(from.close_timestamp()); } + if (from.rows() != 0) { + set_rows(from.rows()); + } + if (from.status() != 0) { + set_status(from.status()); + } } void Segment::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { @@ -1358,6 +1465,8 @@ void Segment::InternalSwap(Segment* other) { swap(channel_end_, other->channel_end_); swap(open_timestamp_, other->open_timestamp_); swap(close_timestamp_, other->close_timestamp_); + swap(rows_, other->rows_); + swap(status_, other->status_); } ::PROTOBUF_NAMESPACE_ID::Metadata Segment::GetMetadata() const { @@ -1383,15 +1492,15 @@ SegmentStat::SegmentStat(const SegmentStat& from) _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); ::memcpy(&segment_id_, &from.segment_id_, - static_cast(reinterpret_cast(&memory_rate_) - - reinterpret_cast(&segment_id_)) + sizeof(memory_rate_)); + static_cast(reinterpret_cast(&rows_) - + reinterpret_cast(&segment_id_)) + sizeof(rows_)); // @@protoc_insertion_point(copy_constructor:masterpb.SegmentStat) } void SegmentStat::SharedCtor() { ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&memory_rate_) - - reinterpret_cast(&segment_id_)) + sizeof(memory_rate_)); + reinterpret_cast(&rows_) - + reinterpret_cast(&segment_id_)) + sizeof(rows_)); } SegmentStat::~SegmentStat() { @@ -1418,8 +1527,8 @@ void SegmentStat::Clear() { (void) cached_has_bits; ::memset(&segment_id_, 0, static_cast( - reinterpret_cast(&memory_rate_) - - reinterpret_cast(&segment_id_)) + sizeof(memory_rate_)); + reinterpret_cast(&rows_) - + reinterpret_cast(&segment_id_)) + sizeof(rows_)); _internal_metadata_.Clear(); } @@ -1452,6 +1561,21 @@ const char* SegmentStat::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID ptr += sizeof(float); } else goto handle_unusual; continue; + // .masterpb.SegmentStatus status = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + set_status(static_cast<::masterpb::SegmentStatus>(val)); + } else goto handle_unusual; + continue; + // int64 rows = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + rows_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; default: { handle_unusual: if ((tag & 7) == 4 || tag == 0) { @@ -1521,6 +1645,33 @@ bool SegmentStat::MergePartialFromCodedStream( break; } + // .masterpb.SegmentStatus status = 4; + case 4: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { + int value = 0; + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_status(static_cast< ::masterpb::SegmentStatus >(value)); + } else { + goto handle_unusual; + } + break; + } + + // int64 rows = 5; + case 5: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>( + input, &rows_))); + } else { + goto handle_unusual; + } + break; + } + default: { handle_unusual: if (tag == 0) { @@ -1563,6 +1714,17 @@ void SegmentStat::SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloat(3, this->memory_rate(), output); } + // .masterpb.SegmentStatus status = 4; + if (this->status() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( + 4, this->status(), output); + } + + // int64 rows = 5; + if (this->rows() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(5, this->rows(), output); + } + if (_internal_metadata_.have_unknown_fields()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); @@ -1591,6 +1753,17 @@ void SegmentStat::SerializeWithCachedSizes( target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->memory_rate(), target); } + // .masterpb.SegmentStatus status = 4; + if (this->status() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 4, this->status(), target); + } + + // int64 rows = 5; + if (this->rows() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(5, this->rows(), target); + } + if (_internal_metadata_.have_unknown_fields()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target); @@ -1631,6 +1804,19 @@ size_t SegmentStat::ByteSizeLong() const { total_size += 1 + 4; } + // .masterpb.SegmentStatus status = 4; + if (this->status() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->status()); + } + + // int64 rows = 5; + if (this->rows() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->rows()); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; @@ -1667,6 +1853,12 @@ void SegmentStat::MergeFrom(const SegmentStat& from) { if (!(from.memory_rate() <= 0 && from.memory_rate() >= 0)) { set_memory_rate(from.memory_rate()); } + if (from.status() != 0) { + set_status(from.status()); + } + if (from.rows() != 0) { + set_rows(from.rows()); + } } void SegmentStat::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { @@ -1693,6 +1885,8 @@ void SegmentStat::InternalSwap(SegmentStat* other) { swap(segment_id_, other->segment_id_); swap(memory_size_, other->memory_size_); swap(memory_rate_, other->memory_rate_); + swap(status_, other->status_); + swap(rows_, other->rows_); } ::PROTOBUF_NAMESPACE_ID::Metadata SegmentStat::GetMetadata() const { diff --git a/proxy/src/grpc/master.pb.h b/proxy/src/grpc/master.pb.h index e4827888c3..a572507692 100644 --- a/proxy/src/grpc/master.pb.h +++ b/proxy/src/grpc/master.pb.h @@ -31,6 +31,7 @@ #include #include // IWYU pragma: export #include // IWYU pragma: export +#include #include #include "message.pb.h" // @@protoc_insertion_point(includes) @@ -73,6 +74,33 @@ template<> ::masterpb::SegmentStat* Arena::CreateMaybeMessage<::masterpb::Segmen PROTOBUF_NAMESPACE_CLOSE namespace masterpb { +enum SegmentStatus : int { + OPENED = 0, + CLOSED = 1, + INDEXING = 2, + INDEXED = 3, + SegmentStatus_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + SegmentStatus_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool SegmentStatus_IsValid(int value); +constexpr SegmentStatus SegmentStatus_MIN = OPENED; +constexpr SegmentStatus SegmentStatus_MAX = INDEXED; +constexpr int SegmentStatus_ARRAYSIZE = SegmentStatus_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SegmentStatus_descriptor(); +template +inline const std::string& SegmentStatus_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function SegmentStatus_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + SegmentStatus_descriptor(), enum_t_value); +} +inline bool SegmentStatus_Parse( + const std::string& name, SegmentStatus* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + SegmentStatus_descriptor(), name, value); +} // =================================================================== class Collection : @@ -403,6 +431,8 @@ class Segment : kChannelEndFieldNumber = 5, kOpenTimestampFieldNumber = 6, kCloseTimestampFieldNumber = 7, + kRowsFieldNumber = 10, + kStatusFieldNumber = 9, }; // string partition_tag = 3; void clear_partition_tag(); @@ -456,6 +486,16 @@ class Segment : ::PROTOBUF_NAMESPACE_ID::uint64 close_timestamp() const; void set_close_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value); + // int64 rows = 10; + void clear_rows(); + ::PROTOBUF_NAMESPACE_ID::int64 rows() const; + void set_rows(::PROTOBUF_NAMESPACE_ID::int64 value); + + // .masterpb.SegmentStatus status = 9; + void clear_status(); + ::masterpb::SegmentStatus status() const; + void set_status(::masterpb::SegmentStatus value); + // @@protoc_insertion_point(class_scope:masterpb.Segment) private: class _Internal; @@ -469,6 +509,8 @@ class Segment : ::PROTOBUF_NAMESPACE_ID::int32 channel_end_; ::PROTOBUF_NAMESPACE_ID::uint64 open_timestamp_; ::PROTOBUF_NAMESPACE_ID::uint64 close_timestamp_; + ::PROTOBUF_NAMESPACE_ID::int64 rows_; + int status_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_master_2eproto; }; @@ -590,6 +632,8 @@ class SegmentStat : kSegmentIdFieldNumber = 1, kMemorySizeFieldNumber = 2, kMemoryRateFieldNumber = 3, + kStatusFieldNumber = 4, + kRowsFieldNumber = 5, }; // uint64 segment_id = 1; void clear_segment_id(); @@ -606,6 +650,16 @@ class SegmentStat : float memory_rate() const; void set_memory_rate(float value); + // .masterpb.SegmentStatus status = 4; + void clear_status(); + ::masterpb::SegmentStatus status() const; + void set_status(::masterpb::SegmentStatus value); + + // int64 rows = 5; + void clear_rows(); + ::PROTOBUF_NAMESPACE_ID::int64 rows() const; + void set_rows(::PROTOBUF_NAMESPACE_ID::int64 value); + // @@protoc_insertion_point(class_scope:masterpb.SegmentStat) private: class _Internal; @@ -614,6 +668,8 @@ class SegmentStat : ::PROTOBUF_NAMESPACE_ID::uint64 segment_id_; ::PROTOBUF_NAMESPACE_ID::uint64 memory_size_; float memory_rate_; + int status_; + ::PROTOBUF_NAMESPACE_ID::int64 rows_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_master_2eproto; }; @@ -1064,6 +1120,34 @@ inline void Segment::set_allocated_collection_name(std::string* collection_name) // @@protoc_insertion_point(field_set_allocated:masterpb.Segment.collection_name) } +// .masterpb.SegmentStatus status = 9; +inline void Segment::clear_status() { + status_ = 0; +} +inline ::masterpb::SegmentStatus Segment::status() const { + // @@protoc_insertion_point(field_get:masterpb.Segment.status) + return static_cast< ::masterpb::SegmentStatus >(status_); +} +inline void Segment::set_status(::masterpb::SegmentStatus value) { + + status_ = value; + // @@protoc_insertion_point(field_set:masterpb.Segment.status) +} + +// int64 rows = 10; +inline void Segment::clear_rows() { + rows_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 Segment::rows() const { + // @@protoc_insertion_point(field_get:masterpb.Segment.rows) + return rows_; +} +inline void Segment::set_rows(::PROTOBUF_NAMESPACE_ID::int64 value) { + + rows_ = value; + // @@protoc_insertion_point(field_set:masterpb.Segment.rows) +} + // ------------------------------------------------------------------- // SegmentStat @@ -1110,6 +1194,34 @@ inline void SegmentStat::set_memory_rate(float value) { // @@protoc_insertion_point(field_set:masterpb.SegmentStat.memory_rate) } +// .masterpb.SegmentStatus status = 4; +inline void SegmentStat::clear_status() { + status_ = 0; +} +inline ::masterpb::SegmentStatus SegmentStat::status() const { + // @@protoc_insertion_point(field_get:masterpb.SegmentStat.status) + return static_cast< ::masterpb::SegmentStatus >(status_); +} +inline void SegmentStat::set_status(::masterpb::SegmentStatus value) { + + status_ = value; + // @@protoc_insertion_point(field_set:masterpb.SegmentStat.status) +} + +// int64 rows = 5; +inline void SegmentStat::clear_rows() { + rows_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 SegmentStat::rows() const { + // @@protoc_insertion_point(field_get:masterpb.SegmentStat.rows) + return rows_; +} +inline void SegmentStat::set_rows(::PROTOBUF_NAMESPACE_ID::int64 value) { + + rows_ = value; + // @@protoc_insertion_point(field_set:masterpb.SegmentStat.rows) +} + #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ @@ -1122,6 +1234,16 @@ inline void SegmentStat::set_memory_rate(float value) { } // namespace masterpb +PROTOBUF_NAMESPACE_OPEN + +template <> struct is_proto_enum< ::masterpb::SegmentStatus> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::masterpb::SegmentStatus>() { + return ::masterpb::SegmentStatus_descriptor(); +} + +PROTOBUF_NAMESPACE_CLOSE + // @@protoc_insertion_point(global_scope) #include