mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Add collectionID and partitionID into SegmentIndexInfo (#6289)
* add collectionID and partitionID into SegmentIndexInfo Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * add partID2SegID into meta table Signed-off-by: yudong.cai <yudong.cai@zilliz.com> * update DropIndex Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
This commit is contained in:
parent
f8fa025dcc
commit
bc8392eb1e
@ -211,6 +211,8 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_etcd_5fmeta_2eproto::offsets[]
|
||||
~0u, // no _extensions_
|
||||
~0u, // no _oneof_case_
|
||||
~0u, // no _weak_field_map_
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::proto::etcd::SegmentIndexInfo, collectionid_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::proto::etcd::SegmentIndexInfo, partitionid_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::proto::etcd::SegmentIndexInfo, segmentid_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::proto::etcd::SegmentIndexInfo, fieldid_),
|
||||
PROTOBUF_FIELD_OFFSET(::milvus::proto::etcd::SegmentIndexInfo, indexid_),
|
||||
@ -235,7 +237,7 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOB
|
||||
{ 25, -1, sizeof(::milvus::proto::etcd::FieldIndexInfo)},
|
||||
{ 32, -1, sizeof(::milvus::proto::etcd::CollectionInfo)},
|
||||
{ 45, -1, sizeof(::milvus::proto::etcd::SegmentIndexInfo)},
|
||||
{ 55, -1, sizeof(::milvus::proto::etcd::CollectionMeta)},
|
||||
{ 57, -1, sizeof(::milvus::proto::etcd::CollectionMeta)},
|
||||
};
|
||||
|
||||
static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
|
||||
@ -266,16 +268,17 @@ const char descriptor_table_protodef_etcd_5fmeta_2eproto[] PROTOBUF_SECTION_VARI
|
||||
"rtitonNames\030\005 \003(\t\0228\n\rfield_indexes\030\006 \003(\013"
|
||||
"2!.milvus.proto.etcd.FieldIndexInfo\022\035\n\025v"
|
||||
"irtual_channel_names\030\007 \003(\t\022\036\n\026physical_c"
|
||||
"hannel_names\030\010 \003(\t\"n\n\020SegmentIndexInfo\022\021"
|
||||
"\n\tsegmentID\030\001 \001(\003\022\017\n\007fieldID\030\002 \001(\003\022\017\n\007in"
|
||||
"dexID\030\003 \001(\003\022\017\n\007buildID\030\004 \001(\003\022\024\n\014enable_i"
|
||||
"ndex\030\005 \001(\010\"\252\001\n\016CollectionMeta\022\n\n\002ID\030\001 \001("
|
||||
"\003\0225\n\006schema\030\002 \001(\0132%.milvus.proto.schema."
|
||||
"CollectionSchema\022\023\n\013create_time\030\003 \001(\004\022\022\n"
|
||||
"\nsegmentIDs\030\004 \003(\003\022\026\n\016partition_tags\030\005 \003("
|
||||
"\t\022\024\n\014partitionIDs\030\006 \003(\003B3Z1github.com/mi"
|
||||
"lvus-io/milvus/internal/proto/etcdpbb\006pr"
|
||||
"oto3"
|
||||
"hannel_names\030\010 \003(\t\"\231\001\n\020SegmentIndexInfo\022"
|
||||
"\024\n\014collectionID\030\001 \001(\003\022\023\n\013partitionID\030\002 \001"
|
||||
"(\003\022\021\n\tsegmentID\030\003 \001(\003\022\017\n\007fieldID\030\004 \001(\003\022\017"
|
||||
"\n\007indexID\030\005 \001(\003\022\017\n\007buildID\030\006 \001(\003\022\024\n\014enab"
|
||||
"le_index\030\007 \001(\010\"\252\001\n\016CollectionMeta\022\n\n\002ID\030"
|
||||
"\001 \001(\003\0225\n\006schema\030\002 \001(\0132%.milvus.proto.sch"
|
||||
"ema.CollectionSchema\022\023\n\013create_time\030\003 \001("
|
||||
"\004\022\022\n\nsegmentIDs\030\004 \003(\003\022\026\n\016partition_tags\030"
|
||||
"\005 \003(\t\022\024\n\014partitionIDs\030\006 \003(\003B3Z1github.co"
|
||||
"m/milvus-io/milvus/internal/proto/etcdpb"
|
||||
"b\006proto3"
|
||||
;
|
||||
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_etcd_5fmeta_2eproto_deps[2] = {
|
||||
&::descriptor_table_common_2eproto,
|
||||
@ -293,7 +296,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_etc
|
||||
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_etcd_5fmeta_2eproto_once;
|
||||
static bool descriptor_table_etcd_5fmeta_2eproto_initialized = false;
|
||||
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_etcd_5fmeta_2eproto = {
|
||||
&descriptor_table_etcd_5fmeta_2eproto_initialized, descriptor_table_protodef_etcd_5fmeta_2eproto, "etcd_meta.proto", 1044,
|
||||
&descriptor_table_etcd_5fmeta_2eproto_initialized, descriptor_table_protodef_etcd_5fmeta_2eproto, "etcd_meta.proto", 1088,
|
||||
&descriptor_table_etcd_5fmeta_2eproto_once, descriptor_table_etcd_5fmeta_2eproto_sccs, descriptor_table_etcd_5fmeta_2eproto_deps, 7, 2,
|
||||
schemas, file_default_instances, TableStruct_etcd_5fmeta_2eproto::offsets,
|
||||
file_level_metadata_etcd_5fmeta_2eproto, 7, file_level_enum_descriptors_etcd_5fmeta_2eproto, file_level_service_descriptors_etcd_5fmeta_2eproto,
|
||||
@ -2452,16 +2455,16 @@ SegmentIndexInfo::SegmentIndexInfo(const SegmentIndexInfo& from)
|
||||
: ::PROTOBUF_NAMESPACE_ID::Message(),
|
||||
_internal_metadata_(nullptr) {
|
||||
_internal_metadata_.MergeFrom(from._internal_metadata_);
|
||||
::memcpy(&segmentid_, &from.segmentid_,
|
||||
::memcpy(&collectionid_, &from.collectionid_,
|
||||
static_cast<size_t>(reinterpret_cast<char*>(&enable_index_) -
|
||||
reinterpret_cast<char*>(&segmentid_)) + sizeof(enable_index_));
|
||||
reinterpret_cast<char*>(&collectionid_)) + sizeof(enable_index_));
|
||||
// @@protoc_insertion_point(copy_constructor:milvus.proto.etcd.SegmentIndexInfo)
|
||||
}
|
||||
|
||||
void SegmentIndexInfo::SharedCtor() {
|
||||
::memset(&segmentid_, 0, static_cast<size_t>(
|
||||
::memset(&collectionid_, 0, static_cast<size_t>(
|
||||
reinterpret_cast<char*>(&enable_index_) -
|
||||
reinterpret_cast<char*>(&segmentid_)) + sizeof(enable_index_));
|
||||
reinterpret_cast<char*>(&collectionid_)) + sizeof(enable_index_));
|
||||
}
|
||||
|
||||
SegmentIndexInfo::~SegmentIndexInfo() {
|
||||
@ -2487,9 +2490,9 @@ void SegmentIndexInfo::Clear() {
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
::memset(&segmentid_, 0, static_cast<size_t>(
|
||||
::memset(&collectionid_, 0, static_cast<size_t>(
|
||||
reinterpret_cast<char*>(&enable_index_) -
|
||||
reinterpret_cast<char*>(&segmentid_)) + sizeof(enable_index_));
|
||||
reinterpret_cast<char*>(&collectionid_)) + sizeof(enable_index_));
|
||||
_internal_metadata_.Clear();
|
||||
}
|
||||
|
||||
@ -2501,37 +2504,51 @@ const char* SegmentIndexInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA
|
||||
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
|
||||
CHK_(ptr);
|
||||
switch (tag >> 3) {
|
||||
// int64 segmentID = 1;
|
||||
// int64 collectionID = 1;
|
||||
case 1:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
|
||||
collectionid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// int64 partitionID = 2;
|
||||
case 2:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
|
||||
partitionid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// int64 segmentID = 3;
|
||||
case 3:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
|
||||
segmentid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// int64 fieldID = 2;
|
||||
case 2:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
|
||||
// int64 fieldID = 4;
|
||||
case 4:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
|
||||
fieldid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// int64 indexID = 3;
|
||||
case 3:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
|
||||
// int64 indexID = 5;
|
||||
case 5:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
|
||||
indexid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// int64 buildID = 4;
|
||||
case 4:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
|
||||
// int64 buildID = 6;
|
||||
case 6:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
|
||||
buildid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
continue;
|
||||
// bool enable_index = 5;
|
||||
case 5:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
|
||||
// bool enable_index = 7;
|
||||
case 7:
|
||||
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
|
||||
enable_index_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
|
||||
CHK_(ptr);
|
||||
} else goto handle_unusual;
|
||||
@ -2566,10 +2583,36 @@ bool SegmentIndexInfo::MergePartialFromCodedStream(
|
||||
tag = p.first;
|
||||
if (!p.second) goto handle_unusual;
|
||||
switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
||||
// int64 segmentID = 1;
|
||||
// int64 collectionID = 1;
|
||||
case 1: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
|
||||
|
||||
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
|
||||
::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
|
||||
input, &collectionid_)));
|
||||
} else {
|
||||
goto handle_unusual;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// int64 partitionID = 2;
|
||||
case 2: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
|
||||
|
||||
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
|
||||
::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
|
||||
input, &partitionid_)));
|
||||
} else {
|
||||
goto handle_unusual;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// int64 segmentID = 3;
|
||||
case 3: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
|
||||
|
||||
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
|
||||
::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
|
||||
input, &segmentid_)));
|
||||
@ -2579,9 +2622,9 @@ bool SegmentIndexInfo::MergePartialFromCodedStream(
|
||||
break;
|
||||
}
|
||||
|
||||
// int64 fieldID = 2;
|
||||
case 2: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
|
||||
// int64 fieldID = 4;
|
||||
case 4: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
|
||||
|
||||
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
|
||||
::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
|
||||
@ -2592,9 +2635,9 @@ bool SegmentIndexInfo::MergePartialFromCodedStream(
|
||||
break;
|
||||
}
|
||||
|
||||
// int64 indexID = 3;
|
||||
case 3: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
|
||||
// int64 indexID = 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>(
|
||||
@ -2605,9 +2648,9 @@ bool SegmentIndexInfo::MergePartialFromCodedStream(
|
||||
break;
|
||||
}
|
||||
|
||||
// int64 buildID = 4;
|
||||
case 4: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
|
||||
// int64 buildID = 6;
|
||||
case 6: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) {
|
||||
|
||||
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
|
||||
::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
|
||||
@ -2618,9 +2661,9 @@ bool SegmentIndexInfo::MergePartialFromCodedStream(
|
||||
break;
|
||||
}
|
||||
|
||||
// bool enable_index = 5;
|
||||
case 5: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
|
||||
// bool enable_index = 7;
|
||||
case 7: {
|
||||
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) {
|
||||
|
||||
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
|
||||
bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
|
||||
@ -2658,29 +2701,39 @@ void SegmentIndexInfo::SerializeWithCachedSizes(
|
||||
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// int64 segmentID = 1;
|
||||
// int64 collectionID = 1;
|
||||
if (this->collectionid() != 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(1, this->collectionid(), output);
|
||||
}
|
||||
|
||||
// int64 partitionID = 2;
|
||||
if (this->partitionid() != 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(2, this->partitionid(), output);
|
||||
}
|
||||
|
||||
// int64 segmentID = 3;
|
||||
if (this->segmentid() != 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(1, this->segmentid(), output);
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->segmentid(), output);
|
||||
}
|
||||
|
||||
// int64 fieldID = 2;
|
||||
// int64 fieldID = 4;
|
||||
if (this->fieldid() != 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(2, this->fieldid(), output);
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(4, this->fieldid(), output);
|
||||
}
|
||||
|
||||
// int64 indexID = 3;
|
||||
// int64 indexID = 5;
|
||||
if (this->indexid() != 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->indexid(), output);
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(5, this->indexid(), output);
|
||||
}
|
||||
|
||||
// int64 buildID = 4;
|
||||
// int64 buildID = 6;
|
||||
if (this->buildid() != 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(4, this->buildid(), output);
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(6, this->buildid(), output);
|
||||
}
|
||||
|
||||
// bool enable_index = 5;
|
||||
// bool enable_index = 7;
|
||||
if (this->enable_index() != 0) {
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(5, this->enable_index(), output);
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(7, this->enable_index(), output);
|
||||
}
|
||||
|
||||
if (_internal_metadata_.have_unknown_fields()) {
|
||||
@ -2696,29 +2749,39 @@ void SegmentIndexInfo::SerializeWithCachedSizes(
|
||||
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
// int64 segmentID = 1;
|
||||
// int64 collectionID = 1;
|
||||
if (this->collectionid() != 0) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->collectionid(), target);
|
||||
}
|
||||
|
||||
// int64 partitionID = 2;
|
||||
if (this->partitionid() != 0) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->partitionid(), target);
|
||||
}
|
||||
|
||||
// int64 segmentID = 3;
|
||||
if (this->segmentid() != 0) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->segmentid(), target);
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->segmentid(), target);
|
||||
}
|
||||
|
||||
// int64 fieldID = 2;
|
||||
// int64 fieldID = 4;
|
||||
if (this->fieldid() != 0) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->fieldid(), target);
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->fieldid(), target);
|
||||
}
|
||||
|
||||
// int64 indexID = 3;
|
||||
// int64 indexID = 5;
|
||||
if (this->indexid() != 0) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->indexid(), target);
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(5, this->indexid(), target);
|
||||
}
|
||||
|
||||
// int64 buildID = 4;
|
||||
// int64 buildID = 6;
|
||||
if (this->buildid() != 0) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(4, this->buildid(), target);
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(6, this->buildid(), target);
|
||||
}
|
||||
|
||||
// bool enable_index = 5;
|
||||
// bool enable_index = 7;
|
||||
if (this->enable_index() != 0) {
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->enable_index(), target);
|
||||
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->enable_index(), target);
|
||||
}
|
||||
|
||||
if (_internal_metadata_.have_unknown_fields()) {
|
||||
@ -2742,35 +2805,49 @@ size_t SegmentIndexInfo::ByteSizeLong() const {
|
||||
// Prevent compiler warnings about cached_has_bits being unused
|
||||
(void) cached_has_bits;
|
||||
|
||||
// int64 segmentID = 1;
|
||||
// int64 collectionID = 1;
|
||||
if (this->collectionid() != 0) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
|
||||
this->collectionid());
|
||||
}
|
||||
|
||||
// int64 partitionID = 2;
|
||||
if (this->partitionid() != 0) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
|
||||
this->partitionid());
|
||||
}
|
||||
|
||||
// int64 segmentID = 3;
|
||||
if (this->segmentid() != 0) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
|
||||
this->segmentid());
|
||||
}
|
||||
|
||||
// int64 fieldID = 2;
|
||||
// int64 fieldID = 4;
|
||||
if (this->fieldid() != 0) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
|
||||
this->fieldid());
|
||||
}
|
||||
|
||||
// int64 indexID = 3;
|
||||
// int64 indexID = 5;
|
||||
if (this->indexid() != 0) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
|
||||
this->indexid());
|
||||
}
|
||||
|
||||
// int64 buildID = 4;
|
||||
// int64 buildID = 6;
|
||||
if (this->buildid() != 0) {
|
||||
total_size += 1 +
|
||||
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
|
||||
this->buildid());
|
||||
}
|
||||
|
||||
// bool enable_index = 5;
|
||||
// bool enable_index = 7;
|
||||
if (this->enable_index() != 0) {
|
||||
total_size += 1 + 1;
|
||||
}
|
||||
@ -2802,6 +2879,12 @@ void SegmentIndexInfo::MergeFrom(const SegmentIndexInfo& from) {
|
||||
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
|
||||
(void) cached_has_bits;
|
||||
|
||||
if (from.collectionid() != 0) {
|
||||
set_collectionid(from.collectionid());
|
||||
}
|
||||
if (from.partitionid() != 0) {
|
||||
set_partitionid(from.partitionid());
|
||||
}
|
||||
if (from.segmentid() != 0) {
|
||||
set_segmentid(from.segmentid());
|
||||
}
|
||||
@ -2840,6 +2923,8 @@ bool SegmentIndexInfo::IsInitialized() const {
|
||||
void SegmentIndexInfo::InternalSwap(SegmentIndexInfo* other) {
|
||||
using std::swap;
|
||||
_internal_metadata_.Swap(&other->_internal_metadata_);
|
||||
swap(collectionid_, other->collectionid_);
|
||||
swap(partitionid_, other->partitionid_);
|
||||
swap(segmentid_, other->segmentid_);
|
||||
swap(fieldid_, other->fieldid_);
|
||||
swap(indexid_, other->indexid_);
|
||||
|
||||
@ -1068,33 +1068,45 @@ class SegmentIndexInfo :
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
enum : int {
|
||||
kSegmentIDFieldNumber = 1,
|
||||
kFieldIDFieldNumber = 2,
|
||||
kIndexIDFieldNumber = 3,
|
||||
kBuildIDFieldNumber = 4,
|
||||
kEnableIndexFieldNumber = 5,
|
||||
kCollectionIDFieldNumber = 1,
|
||||
kPartitionIDFieldNumber = 2,
|
||||
kSegmentIDFieldNumber = 3,
|
||||
kFieldIDFieldNumber = 4,
|
||||
kIndexIDFieldNumber = 5,
|
||||
kBuildIDFieldNumber = 6,
|
||||
kEnableIndexFieldNumber = 7,
|
||||
};
|
||||
// int64 segmentID = 1;
|
||||
// int64 collectionID = 1;
|
||||
void clear_collectionid();
|
||||
::PROTOBUF_NAMESPACE_ID::int64 collectionid() const;
|
||||
void set_collectionid(::PROTOBUF_NAMESPACE_ID::int64 value);
|
||||
|
||||
// int64 partitionID = 2;
|
||||
void clear_partitionid();
|
||||
::PROTOBUF_NAMESPACE_ID::int64 partitionid() const;
|
||||
void set_partitionid(::PROTOBUF_NAMESPACE_ID::int64 value);
|
||||
|
||||
// int64 segmentID = 3;
|
||||
void clear_segmentid();
|
||||
::PROTOBUF_NAMESPACE_ID::int64 segmentid() const;
|
||||
void set_segmentid(::PROTOBUF_NAMESPACE_ID::int64 value);
|
||||
|
||||
// int64 fieldID = 2;
|
||||
// int64 fieldID = 4;
|
||||
void clear_fieldid();
|
||||
::PROTOBUF_NAMESPACE_ID::int64 fieldid() const;
|
||||
void set_fieldid(::PROTOBUF_NAMESPACE_ID::int64 value);
|
||||
|
||||
// int64 indexID = 3;
|
||||
// int64 indexID = 5;
|
||||
void clear_indexid();
|
||||
::PROTOBUF_NAMESPACE_ID::int64 indexid() const;
|
||||
void set_indexid(::PROTOBUF_NAMESPACE_ID::int64 value);
|
||||
|
||||
// int64 buildID = 4;
|
||||
// int64 buildID = 6;
|
||||
void clear_buildid();
|
||||
::PROTOBUF_NAMESPACE_ID::int64 buildid() const;
|
||||
void set_buildid(::PROTOBUF_NAMESPACE_ID::int64 value);
|
||||
|
||||
// bool enable_index = 5;
|
||||
// bool enable_index = 7;
|
||||
void clear_enable_index();
|
||||
bool enable_index() const;
|
||||
void set_enable_index(bool value);
|
||||
@ -1104,6 +1116,8 @@ class SegmentIndexInfo :
|
||||
class _Internal;
|
||||
|
||||
::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_;
|
||||
::PROTOBUF_NAMESPACE_ID::int64 collectionid_;
|
||||
::PROTOBUF_NAMESPACE_ID::int64 partitionid_;
|
||||
::PROTOBUF_NAMESPACE_ID::int64 segmentid_;
|
||||
::PROTOBUF_NAMESPACE_ID::int64 fieldid_;
|
||||
::PROTOBUF_NAMESPACE_ID::int64 indexid_;
|
||||
@ -2054,7 +2068,35 @@ CollectionInfo::mutable_physical_channel_names() {
|
||||
|
||||
// SegmentIndexInfo
|
||||
|
||||
// int64 segmentID = 1;
|
||||
// int64 collectionID = 1;
|
||||
inline void SegmentIndexInfo::clear_collectionid() {
|
||||
collectionid_ = PROTOBUF_LONGLONG(0);
|
||||
}
|
||||
inline ::PROTOBUF_NAMESPACE_ID::int64 SegmentIndexInfo::collectionid() const {
|
||||
// @@protoc_insertion_point(field_get:milvus.proto.etcd.SegmentIndexInfo.collectionID)
|
||||
return collectionid_;
|
||||
}
|
||||
inline void SegmentIndexInfo::set_collectionid(::PROTOBUF_NAMESPACE_ID::int64 value) {
|
||||
|
||||
collectionid_ = value;
|
||||
// @@protoc_insertion_point(field_set:milvus.proto.etcd.SegmentIndexInfo.collectionID)
|
||||
}
|
||||
|
||||
// int64 partitionID = 2;
|
||||
inline void SegmentIndexInfo::clear_partitionid() {
|
||||
partitionid_ = PROTOBUF_LONGLONG(0);
|
||||
}
|
||||
inline ::PROTOBUF_NAMESPACE_ID::int64 SegmentIndexInfo::partitionid() const {
|
||||
// @@protoc_insertion_point(field_get:milvus.proto.etcd.SegmentIndexInfo.partitionID)
|
||||
return partitionid_;
|
||||
}
|
||||
inline void SegmentIndexInfo::set_partitionid(::PROTOBUF_NAMESPACE_ID::int64 value) {
|
||||
|
||||
partitionid_ = value;
|
||||
// @@protoc_insertion_point(field_set:milvus.proto.etcd.SegmentIndexInfo.partitionID)
|
||||
}
|
||||
|
||||
// int64 segmentID = 3;
|
||||
inline void SegmentIndexInfo::clear_segmentid() {
|
||||
segmentid_ = PROTOBUF_LONGLONG(0);
|
||||
}
|
||||
@ -2068,7 +2110,7 @@ inline void SegmentIndexInfo::set_segmentid(::PROTOBUF_NAMESPACE_ID::int64 value
|
||||
// @@protoc_insertion_point(field_set:milvus.proto.etcd.SegmentIndexInfo.segmentID)
|
||||
}
|
||||
|
||||
// int64 fieldID = 2;
|
||||
// int64 fieldID = 4;
|
||||
inline void SegmentIndexInfo::clear_fieldid() {
|
||||
fieldid_ = PROTOBUF_LONGLONG(0);
|
||||
}
|
||||
@ -2082,7 +2124,7 @@ inline void SegmentIndexInfo::set_fieldid(::PROTOBUF_NAMESPACE_ID::int64 value)
|
||||
// @@protoc_insertion_point(field_set:milvus.proto.etcd.SegmentIndexInfo.fieldID)
|
||||
}
|
||||
|
||||
// int64 indexID = 3;
|
||||
// int64 indexID = 5;
|
||||
inline void SegmentIndexInfo::clear_indexid() {
|
||||
indexid_ = PROTOBUF_LONGLONG(0);
|
||||
}
|
||||
@ -2096,7 +2138,7 @@ inline void SegmentIndexInfo::set_indexid(::PROTOBUF_NAMESPACE_ID::int64 value)
|
||||
// @@protoc_insertion_point(field_set:milvus.proto.etcd.SegmentIndexInfo.indexID)
|
||||
}
|
||||
|
||||
// int64 buildID = 4;
|
||||
// int64 buildID = 6;
|
||||
inline void SegmentIndexInfo::clear_buildid() {
|
||||
buildid_ = PROTOBUF_LONGLONG(0);
|
||||
}
|
||||
@ -2110,7 +2152,7 @@ inline void SegmentIndexInfo::set_buildid(::PROTOBUF_NAMESPACE_ID::int64 value)
|
||||
// @@protoc_insertion_point(field_set:milvus.proto.etcd.SegmentIndexInfo.buildID)
|
||||
}
|
||||
|
||||
// bool enable_index = 5;
|
||||
// bool enable_index = 7;
|
||||
inline void SegmentIndexInfo::clear_enable_index() {
|
||||
enable_index_ = false;
|
||||
}
|
||||
|
||||
@ -41,11 +41,13 @@ message CollectionInfo {
|
||||
}
|
||||
|
||||
message SegmentIndexInfo {
|
||||
int64 segmentID = 1;
|
||||
int64 fieldID = 2;
|
||||
int64 indexID = 3;
|
||||
int64 buildID = 4;
|
||||
bool enable_index = 5;
|
||||
int64 collectionID = 1;
|
||||
int64 partitionID = 2;
|
||||
int64 segmentID = 3;
|
||||
int64 fieldID = 4;
|
||||
int64 indexID = 5;
|
||||
int64 buildID = 6;
|
||||
bool enable_index = 7;
|
||||
}
|
||||
|
||||
message CollectionMeta {
|
||||
|
||||
@ -338,11 +338,13 @@ func (m *CollectionInfo) GetPhysicalChannelNames() []string {
|
||||
}
|
||||
|
||||
type SegmentIndexInfo struct {
|
||||
SegmentID int64 `protobuf:"varint,1,opt,name=segmentID,proto3" json:"segmentID,omitempty"`
|
||||
FieldID int64 `protobuf:"varint,2,opt,name=fieldID,proto3" json:"fieldID,omitempty"`
|
||||
IndexID int64 `protobuf:"varint,3,opt,name=indexID,proto3" json:"indexID,omitempty"`
|
||||
BuildID int64 `protobuf:"varint,4,opt,name=buildID,proto3" json:"buildID,omitempty"`
|
||||
EnableIndex bool `protobuf:"varint,5,opt,name=enable_index,json=enableIndex,proto3" json:"enable_index,omitempty"`
|
||||
CollectionID int64 `protobuf:"varint,1,opt,name=collectionID,proto3" json:"collectionID,omitempty"`
|
||||
PartitionID int64 `protobuf:"varint,2,opt,name=partitionID,proto3" json:"partitionID,omitempty"`
|
||||
SegmentID int64 `protobuf:"varint,3,opt,name=segmentID,proto3" json:"segmentID,omitempty"`
|
||||
FieldID int64 `protobuf:"varint,4,opt,name=fieldID,proto3" json:"fieldID,omitempty"`
|
||||
IndexID int64 `protobuf:"varint,5,opt,name=indexID,proto3" json:"indexID,omitempty"`
|
||||
BuildID int64 `protobuf:"varint,6,opt,name=buildID,proto3" json:"buildID,omitempty"`
|
||||
EnableIndex bool `protobuf:"varint,7,opt,name=enable_index,json=enableIndex,proto3" json:"enable_index,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
@ -373,6 +375,20 @@ func (m *SegmentIndexInfo) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_SegmentIndexInfo proto.InternalMessageInfo
|
||||
|
||||
func (m *SegmentIndexInfo) GetCollectionID() int64 {
|
||||
if m != nil {
|
||||
return m.CollectionID
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SegmentIndexInfo) GetPartitionID() int64 {
|
||||
if m != nil {
|
||||
return m.PartitionID
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SegmentIndexInfo) GetSegmentID() int64 {
|
||||
if m != nil {
|
||||
return m.SegmentID
|
||||
@ -500,46 +516,47 @@ func init() {
|
||||
func init() { proto.RegisterFile("etcd_meta.proto", fileDescriptor_975d306d62b73e88) }
|
||||
|
||||
var fileDescriptor_975d306d62b73e88 = []byte{
|
||||
// 642 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x41, 0x6f, 0xd3, 0x4c,
|
||||
0x10, 0x95, 0x93, 0x34, 0xa9, 0x27, 0x69, 0xda, 0xee, 0xf7, 0x81, 0xac, 0xaa, 0x40, 0x6a, 0x51,
|
||||
0x88, 0x84, 0x48, 0x44, 0x8b, 0xb8, 0x71, 0x80, 0x5a, 0x95, 0x22, 0x44, 0x55, 0xdc, 0x8a, 0x03,
|
||||
0x17, 0x6b, 0x63, 0x4f, 0x92, 0x95, 0xbc, 0xeb, 0xe0, 0x5d, 0x57, 0xcd, 0x8d, 0x33, 0x3f, 0x81,
|
||||
0x1b, 0xbf, 0x8f, 0xbf, 0xc0, 0x01, 0x79, 0xd7, 0x76, 0x92, 0x36, 0x1c, 0xb9, 0xf9, 0xbd, 0xd9,
|
||||
0xf1, 0xbe, 0x79, 0xf3, 0x16, 0x76, 0x51, 0x85, 0x51, 0xc0, 0x51, 0xd1, 0xc1, 0x3c, 0x4d, 0x54,
|
||||
0x42, 0xf6, 0x39, 0x8b, 0x6f, 0x32, 0x69, 0xd0, 0x20, 0xaf, 0x1e, 0x74, 0xc2, 0x84, 0xf3, 0x44,
|
||||
0x18, 0xea, 0xa0, 0x23, 0xc3, 0x19, 0xf2, 0xe2, 0xb8, 0xfb, 0xc3, 0x02, 0xb8, 0x46, 0x41, 0x85,
|
||||
0xfa, 0x88, 0x8a, 0x92, 0x2e, 0xd4, 0x46, 0x9e, 0x63, 0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69, 0x5b, 0x37, 0xfd, 0x5f, 0x56, 0x57, 0xbb, 0xdc, 0x9f, 0x16, 0xec, 0x5d,
|
||||
0xe1, 0x94, 0xa3, 0x50, 0xcb, 0x3d, 0x1e, 0x82, 0x2d, 0x0b, 0xae, 0xdc, 0xc3, 0x92, 0x30, 0x5b,
|
||||
0xce, 0xc5, 0x56, 0xbb, 0x2c, 0xe0, 0xea, 0x96, 0xeb, 0xeb, 0x89, 0x73, 0xa0, 0x35, 0xce, 0x98,
|
||||
0xee, 0x69, 0x98, 0x4a, 0x01, 0xc9, 0x11, 0x74, 0x50, 0xd0, 0x71, 0x8c, 0xc6, 0x33, 0x67, 0xab,
|
||||
0x67, 0xf5, 0xb7, 0xfd, 0xb6, 0xe1, 0xb4, 0x24, 0xf7, 0x97, 0xb5, 0x1a, 0x91, 0x8d, 0xaf, 0xef,
|
||||
0x5f, 0x47, 0xe4, 0x31, 0x40, 0x65, 0x40, 0x19, 0x90, 0x15, 0x86, 0x1c, 0x43, 0xb7, 0x8a, 0x4b,
|
||||
0xa0, 0xe8, 0xf4, 0x4e, 0x3e, 0x58, 0x22, 0xae, 0xe9, 0x54, 0xde, 0x4b, 0x5a, 0xf3, 0x7e, 0xd2,
|
||||
0xde, 0x9f, 0x7e, 0x79, 0x35, 0x65, 0x6a, 0x96, 0x8d, 0xf3, 0x17, 0x38, 0x34, 0x63, 0xbc, 0x64,
|
||||
0x49, 0xf1, 0x35, 0x64, 0x42, 0x61, 0x2a, 0x68, 0x3c, 0xd4, 0x93, 0x0d, 0xf3, 0x2c, 0xcd, 0xc7,
|
||||
0xe3, 0xa6, 0x46, 0xa7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x7b, 0xc7, 0x82, 0x43, 0x81, 0x05,
|
||||
0x00, 0x00,
|
||||
// 666 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xcd, 0x6e, 0xd3, 0x4c,
|
||||
0x14, 0x95, 0x93, 0x36, 0xa9, 0x6f, 0xdc, 0xb4, 0x9d, 0xef, 0x47, 0x56, 0xd5, 0xef, 0xc3, 0xb5,
|
||||
0x28, 0x44, 0x42, 0x24, 0xa2, 0x45, 0xec, 0x58, 0x40, 0xad, 0x4a, 0x11, 0xa2, 0x2a, 0x6e, 0xc5,
|
||||
0x82, 0x8d, 0x35, 0xb1, 0x6f, 0x92, 0x91, 0xec, 0x71, 0xf0, 0x8c, 0xab, 0x66, 0xc7, 0x9a, 0x47,
|
||||
0xe0, 0x05, 0x59, 0xf0, 0x0a, 0x2c, 0x90, 0x67, 0x6c, 0x27, 0x6e, 0xc3, 0x92, 0x9d, 0xcf, 0xb9,
|
||||
0x73, 0xc7, 0xe7, 0x9e, 0x7b, 0x06, 0xf6, 0x50, 0x86, 0x51, 0x90, 0xa0, 0xa4, 0xc3, 0x45, 0x96,
|
||||
0xca, 0x94, 0x1c, 0x24, 0x2c, 0xbe, 0xcd, 0x85, 0x46, 0xc3, 0xa2, 0x7a, 0x68, 0x85, 0x69, 0x92,
|
||||
0xa4, 0x5c, 0x53, 0x87, 0x96, 0x08, 0xe7, 0x98, 0x94, 0xc7, 0xdd, 0x6f, 0x06, 0xc0, 0x0d, 0x72,
|
||||
0xca, 0xe5, 0x7b, 0x94, 0x94, 0xf4, 0xa1, 0x35, 0xf6, 0x6c, 0xc3, 0x31, 0x06, 0x6d, 0xbf, 0x35,
|
||||
0xf6, 0xc8, 0x13, 0xd8, 0xe3, 0x79, 0x12, 0x7c, 0xce, 0x31, 0x5b, 0x06, 0x3c, 0x8d, 0x50, 0xd8,
|
||||
0x2d, 0x55, 0xdc, 0xe5, 0x79, 0xf2, 0xa1, 0x60, 0x2f, 0x0b, 0x92, 0x3c, 0x83, 0x03, 0xc6, 0x05,
|
||||
0x66, 0x32, 0x08, 0xe7, 0x94, 0x73, 0x8c, 0xc7, 0x9e, 0xb0, 0xdb, 0x4e, 0x7b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x7e, 0x6e, 0x2a, 0x2b, 0x0a, 0xae, 0x67,
|
||||
0x65, 0xbb, 0x99, 0x5b, 0x1b, 0xba, 0x93, 0x9c, 0xa9, 0x9e, 0x8e, 0xae, 0x94, 0x90, 0x1c, 0x83,
|
||||
0x85, 0x9c, 0x4e, 0x62, 0xd4, 0xce, 0xdb, 0x5d, 0xc7, 0x18, 0xec, 0xf8, 0x3d, 0xcd, 0xa9, 0xc1,
|
||||
0xdc, 0x1f, 0xc6, 0x7a, 0xd0, 0x36, 0xbe, 0xe1, 0x3f, 0x1d, 0xb4, 0xff, 0x01, 0x6a, 0x03, 0xaa,
|
||||
0x98, 0xad, 0x31, 0xe4, 0x04, 0xfa, 0xb5, 0x81, 0x81, 0xa4, 0xb3, 0x7b, 0x29, 0x63, 0x29, 0xbf,
|
||||
0xa1, 0x33, 0xf1, 0x20, 0xaf, 0x9d, 0x87, 0x79, 0x7d, 0x7b, 0xf6, 0xe9, 0xc5, 0x8c, 0xc9, 0x79,
|
||||
0x3e, 0x29, 0xde, 0xf1, 0x48, 0x8f, 0xf1, 0x9c, 0xa5, 0xe5, 0xd7, 0x88, 0x71, 0x89, 0x19, 0xa7,
|
||||
0xf1, 0x48, 0x4d, 0x36, 0x2a, 0x12, 0xb9, 0x98, 0x4c, 0x3a, 0x0a, 0x9d, 0xfd, 0x0a, 0x00, 0x00,
|
||||
0xff, 0xff, 0x4d, 0x6b, 0x68, 0xa8, 0xc7, 0x05, 0x00, 0x00,
|
||||
}
|
||||
|
||||
@ -54,6 +54,7 @@ type metaTable struct {
|
||||
proxyID2Meta map[typeutil.UniqueID]pb.ProxyMeta // proxy id to proxy meta
|
||||
collID2Meta map[typeutil.UniqueID]pb.CollectionInfo // collection_id -> meta
|
||||
collName2ID map[string]typeutil.UniqueID // collection name to collection id
|
||||
partID2SegID map[typeutil.UniqueID]map[typeutil.UniqueID]bool // partition_id -> segment_id -> bool
|
||||
segID2IndexMeta map[typeutil.UniqueID]map[typeutil.UniqueID]pb.SegmentIndexInfo // collection_id/index_id/partition_id/segment_id -> meta
|
||||
indexID2Meta map[typeutil.UniqueID]pb.IndexInfo // collection_id/index_id -> meta
|
||||
|
||||
@ -82,6 +83,7 @@ func (mt *metaTable) reloadFromKV() error {
|
||||
mt.proxyID2Meta = make(map[typeutil.UniqueID]pb.ProxyMeta)
|
||||
mt.collID2Meta = make(map[typeutil.UniqueID]pb.CollectionInfo)
|
||||
mt.collName2ID = make(map[string]typeutil.UniqueID)
|
||||
mt.partID2SegID = make(map[typeutil.UniqueID]map[typeutil.UniqueID]bool)
|
||||
mt.segID2IndexMeta = make(map[typeutil.UniqueID]map[typeutil.UniqueID]pb.SegmentIndexInfo)
|
||||
mt.indexID2Meta = make(map[typeutil.UniqueID]pb.IndexInfo)
|
||||
|
||||
@ -138,6 +140,18 @@ func (mt *metaTable) reloadFromKV() error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("RootCoord UnmarshalText pb.SegmentIndexInfo err:%w", err)
|
||||
}
|
||||
|
||||
// update partID2SegID
|
||||
segIDMap, ok := mt.partID2SegID[segmentIndexInfo.PartitionID]
|
||||
if ok {
|
||||
segIDMap[segmentIndexInfo.SegmentID] = true
|
||||
} else {
|
||||
idMap := make(map[typeutil.UniqueID]bool)
|
||||
idMap[segmentIndexInfo.SegmentID] = true
|
||||
mt.partID2SegID[segmentIndexInfo.PartitionID] = idMap
|
||||
}
|
||||
|
||||
// update segID2IndexMeta
|
||||
idx, ok := mt.segID2IndexMeta[segmentIndexInfo.SegmentID]
|
||||
if ok {
|
||||
idx[segmentIndexInfo.IndexID] = segmentIndexInfo
|
||||
@ -251,7 +265,7 @@ func (mt *metaTable) AddCollection(coll *pb.CollectionInfo, partID typeutil.Uniq
|
||||
return ts, nil
|
||||
}
|
||||
|
||||
func (mt *metaTable) DeleteCollection(collID typeutil.UniqueID, segIDs []typeutil.UniqueID, ddOpStr func(ts typeutil.Timestamp) (string, error)) (typeutil.Timestamp, error) {
|
||||
func (mt *metaTable) DeleteCollection(collID typeutil.UniqueID, ddOpStr func(ts typeutil.Timestamp) (string, error)) (typeutil.Timestamp, error) {
|
||||
mt.ddLock.Lock()
|
||||
defer mt.ddLock.Unlock()
|
||||
|
||||
@ -262,14 +276,21 @@ func (mt *metaTable) DeleteCollection(collID typeutil.UniqueID, segIDs []typeuti
|
||||
|
||||
delete(mt.collID2Meta, collID)
|
||||
delete(mt.collName2ID, collMeta.Schema.Name)
|
||||
for _, segID := range segIDs {
|
||||
_, ok := mt.segID2IndexMeta[segID]
|
||||
if !ok {
|
||||
log.Warn("segment id not exist", zap.Int64("segment id", segID))
|
||||
continue
|
||||
|
||||
// update segID2IndexMeta
|
||||
for partID := range collMeta.PartitionIDs {
|
||||
if segIDMap, ok := mt.partID2SegID[typeutil.UniqueID(partID)]; ok {
|
||||
for segID := range segIDMap {
|
||||
delete(mt.segID2IndexMeta, segID)
|
||||
}
|
||||
}
|
||||
delete(mt.segID2IndexMeta, segID)
|
||||
}
|
||||
|
||||
// update partID2SegID
|
||||
for partID := range collMeta.PartitionIDs {
|
||||
delete(mt.partID2SegID, typeutil.UniqueID(partID))
|
||||
}
|
||||
|
||||
for _, idxInfo := range collMeta.FieldIndexes {
|
||||
_, ok := mt.indexID2Meta[idxInfo.IndexID]
|
||||
if !ok {
|
||||
@ -542,7 +563,7 @@ func (mt *metaTable) HasPartition(collID typeutil.UniqueID, partitionName string
|
||||
}
|
||||
|
||||
//return timestamp, partitionid, error
|
||||
func (mt *metaTable) DeletePartition(collID typeutil.UniqueID, partitionName string, segIDs []typeutil.UniqueID, ddOpStr func(ts typeutil.Timestamp) (string, error)) (typeutil.Timestamp, typeutil.UniqueID, error) {
|
||||
func (mt *metaTable) DeletePartition(collID typeutil.UniqueID, partitionName string, ddOpStr func(ts typeutil.Timestamp) (string, error)) (typeutil.Timestamp, typeutil.UniqueID, error) {
|
||||
mt.ddLock.Lock()
|
||||
defer mt.ddLock.Unlock()
|
||||
|
||||
@ -577,14 +598,14 @@ func (mt *metaTable) DeletePartition(collID typeutil.UniqueID, partitionName str
|
||||
collMeta.PartitonNames = pn
|
||||
mt.collID2Meta[collID] = collMeta
|
||||
|
||||
for _, segID := range segIDs {
|
||||
_, ok := mt.segID2IndexMeta[segID]
|
||||
if !ok {
|
||||
log.Warn("segment has no index meta", zap.Int64("segment id", segID))
|
||||
continue
|
||||
// update segID2IndexMeta and partID2SegID
|
||||
if segIDMap, ok := mt.partID2SegID[partID]; ok {
|
||||
for segID := range segIDMap {
|
||||
delete(mt.segID2IndexMeta, segID)
|
||||
}
|
||||
delete(mt.segID2IndexMeta, segID)
|
||||
}
|
||||
delete(mt.partID2SegID, partID)
|
||||
|
||||
meta := map[string]string{path.Join(CollectionMetaPrefix, strconv.FormatInt(collID, 10)): proto.MarshalTextString(&collMeta)}
|
||||
delMetaKeys := []string{}
|
||||
for _, idxInfo := range collMeta.FieldIndexes {
|
||||
@ -626,6 +647,9 @@ func (mt *metaTable) AddIndex(segIdxInfo *pb.SegmentIndexInfo, collID, partID ty
|
||||
if !ok {
|
||||
idxMap := map[typeutil.UniqueID]pb.SegmentIndexInfo{segIdxInfo.IndexID: *segIdxInfo}
|
||||
mt.segID2IndexMeta[segIdxInfo.SegmentID] = idxMap
|
||||
|
||||
segIDMap := map[typeutil.UniqueID]bool{segIdxInfo.SegmentID: true}
|
||||
mt.partID2SegID[segIdxInfo.PartitionID] = segIDMap
|
||||
} else {
|
||||
tmpInfo, ok := segIdxMap[segIdxInfo.IndexID]
|
||||
if ok {
|
||||
@ -640,6 +664,8 @@ func (mt *metaTable) AddIndex(segIdxInfo *pb.SegmentIndexInfo, collID, partID ty
|
||||
}
|
||||
|
||||
mt.segID2IndexMeta[segIdxInfo.SegmentID][segIdxInfo.IndexID] = *segIdxInfo
|
||||
mt.partID2SegID[segIdxInfo.PartitionID][segIdxInfo.SegmentID] = true
|
||||
|
||||
k := fmt.Sprintf("%s/%d/%d/%d/%d", SegmentIndexMetaPrefix, collID, segIdxInfo.IndexID, partID, segIdxInfo.SegmentID)
|
||||
v := proto.MarshalTextString(segIdxInfo)
|
||||
|
||||
@ -653,7 +679,7 @@ func (mt *metaTable) AddIndex(segIdxInfo *pb.SegmentIndexInfo, collID, partID ty
|
||||
}
|
||||
|
||||
//return timestamp, index id, is dropped, error
|
||||
func (mt *metaTable) DropIndex(collName, fieldName, indexName string, segIDs []typeutil.UniqueID) (typeutil.Timestamp, typeutil.UniqueID, bool, error) {
|
||||
func (mt *metaTable) DropIndex(collName, fieldName, indexName string) (typeutil.Timestamp, typeutil.UniqueID, bool, error) {
|
||||
mt.ddLock.Lock()
|
||||
defer mt.ddLock.Unlock()
|
||||
|
||||
@ -700,15 +726,17 @@ func (mt *metaTable) DropIndex(collName, fieldName, indexName string, segIDs []t
|
||||
|
||||
delete(mt.indexID2Meta, dropIdxID)
|
||||
|
||||
for _, segID := range segIDs {
|
||||
segInfo, ok := mt.segID2IndexMeta[segID]
|
||||
if ok {
|
||||
_, ok := segInfo[dropIdxID]
|
||||
if ok {
|
||||
delete(segInfo, dropIdxID)
|
||||
// update segID2IndexMeta
|
||||
for partID := range collMeta.PartitionIDs {
|
||||
if segIDMap, ok := mt.partID2SegID[typeutil.UniqueID(partID)]; ok {
|
||||
for segID := range segIDMap {
|
||||
if segIndexInfos, ok := mt.segID2IndexMeta[segID]; ok {
|
||||
delete(segIndexInfos, dropIdxID)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delMeta := []string{
|
||||
fmt.Sprintf("%s/%d/%d", SegmentIndexMetaPrefix, collMeta.ID, dropIdxID),
|
||||
fmt.Sprintf("%s/%d/%d", IndexMetaPrefix, collMeta.ID, dropIdxID),
|
||||
|
||||
@ -390,12 +390,12 @@ func TestMetaTable(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("drop index", func(t *testing.T) {
|
||||
_, idx, ok, err := mt.DropIndex("testColl", "field110", "field110", nil)
|
||||
_, idx, ok, err := mt.DropIndex("testColl", "field110", "field110")
|
||||
assert.Nil(t, err)
|
||||
assert.True(t, ok)
|
||||
assert.Equal(t, indexID, idx)
|
||||
|
||||
_, _, ok, err = mt.DropIndex("testColl", "field110", "field110-error", nil)
|
||||
_, _, ok, err = mt.DropIndex("testColl", "field110", "field110-error")
|
||||
assert.Nil(t, err)
|
||||
assert.False(t, ok)
|
||||
|
||||
@ -413,7 +413,7 @@ func TestMetaTable(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("drop partition", func(t *testing.T) {
|
||||
_, id, err := mt.DeletePartition(collID, partName, nil, nil)
|
||||
_, id, err := mt.DeletePartition(collID, partName, nil)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, partID, id)
|
||||
|
||||
@ -424,9 +424,9 @@ func TestMetaTable(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("drop collection", func(t *testing.T) {
|
||||
_, err = mt.DeleteCollection(collIDInvalid, nil, nil)
|
||||
_, err = mt.DeleteCollection(collIDInvalid, nil)
|
||||
assert.NotNil(t, err)
|
||||
_, err = mt.DeleteCollection(collID, nil, nil)
|
||||
_, err = mt.DeleteCollection(collID, nil)
|
||||
assert.Nil(t, err)
|
||||
|
||||
// check DD operation flag
|
||||
@ -465,7 +465,7 @@ func TestMetaTable(t *testing.T) {
|
||||
_, err := mt.AddCollection(collInfo, partID, partName, idxInfo, nil)
|
||||
assert.Nil(t, err)
|
||||
mt.indexID2Meta = make(map[int64]pb.IndexInfo)
|
||||
_, err = mt.DeleteCollection(collInfo.ID, nil, nil)
|
||||
_, err = mt.DeleteCollection(collInfo.ID, nil)
|
||||
assert.NotNil(t, err)
|
||||
assert.EqualError(t, err, "milti save and remove with prefix error")
|
||||
})
|
||||
@ -575,23 +575,23 @@ func TestMetaTable(t *testing.T) {
|
||||
_, err = mt.AddCollection(collInfo, partID, partName, idxInfo, nil)
|
||||
assert.Nil(t, err)
|
||||
|
||||
_, _, err = mt.DeletePartition(collInfo.ID, Params.DefaultPartitionName, nil, nil)
|
||||
_, _, err = mt.DeletePartition(collInfo.ID, Params.DefaultPartitionName, nil)
|
||||
assert.NotNil(t, err)
|
||||
assert.EqualError(t, err, "default partition cannot be deleted")
|
||||
|
||||
_, _, err = mt.DeletePartition(collInfo.ID, "abc", nil, nil)
|
||||
_, _, err = mt.DeletePartition(collInfo.ID, "abc", nil)
|
||||
assert.NotNil(t, err)
|
||||
assert.EqualError(t, err, "partition abc does not exist")
|
||||
|
||||
mockKV.multiSaveAndRemoveWithPrefix = func(saves map[string]string, removals []string, addition func(ts typeutil.Timestamp) (string, string, error)) (typeutil.Timestamp, error) {
|
||||
return 0, fmt.Errorf("multi save and remove with prefix error")
|
||||
}
|
||||
_, _, err = mt.DeletePartition(collInfo.ID, partName, nil, nil)
|
||||
_, _, err = mt.DeletePartition(collInfo.ID, partName, nil)
|
||||
assert.NotNil(t, err)
|
||||
assert.EqualError(t, err, "multi save and remove with prefix error")
|
||||
|
||||
mt.collID2Meta = make(map[int64]pb.CollectionInfo)
|
||||
_, _, err = mt.DeletePartition(collInfo.ID, "abc", nil, nil)
|
||||
_, _, err = mt.DeletePartition(collInfo.ID, "abc", nil)
|
||||
assert.NotNil(t, err)
|
||||
assert.EqualError(t, err, fmt.Sprintf("can't find collection id = %d", collInfo.ID))
|
||||
})
|
||||
@ -664,16 +664,16 @@ func TestMetaTable(t *testing.T) {
|
||||
_, err = mt.AddCollection(collInfo, partID, partName, idxInfo, nil)
|
||||
assert.Nil(t, err)
|
||||
|
||||
_, _, _, err = mt.DropIndex("abc", "abc", "abc", nil)
|
||||
_, _, _, err = mt.DropIndex("abc", "abc", "abc")
|
||||
assert.NotNil(t, err)
|
||||
assert.EqualError(t, err, "collection name = abc not exist")
|
||||
|
||||
mt.collName2ID["abc"] = 2
|
||||
_, _, _, err = mt.DropIndex("abc", "abc", "abc", nil)
|
||||
_, _, _, err = mt.DropIndex("abc", "abc", "abc")
|
||||
assert.NotNil(t, err)
|
||||
assert.EqualError(t, err, "collection name = abc not has meta")
|
||||
|
||||
_, _, _, err = mt.DropIndex(collInfo.Schema.Name, "abc", "abc", nil)
|
||||
_, _, _, err = mt.DropIndex(collInfo.Schema.Name, "abc", "abc")
|
||||
assert.NotNil(t, err)
|
||||
assert.EqualError(t, err, fmt.Sprintf("collection %s doesn't have filed abc", collInfo.Schema.Name))
|
||||
|
||||
@ -690,7 +690,7 @@ func TestMetaTable(t *testing.T) {
|
||||
}
|
||||
mt.collID2Meta[coll.ID] = coll
|
||||
mt.indexID2Meta = make(map[int64]pb.IndexInfo)
|
||||
_, idxID, isDroped, err := mt.DropIndex(collInfo.Schema.Name, collInfo.Schema.Fields[0].Name, idxInfo[0].IndexName, nil)
|
||||
_, idxID, isDroped, err := mt.DropIndex(collInfo.Schema.Name, collInfo.Schema.Fields[0].Name, idxInfo[0].IndexName)
|
||||
assert.Zero(t, idxID)
|
||||
assert.False(t, isDroped)
|
||||
assert.Nil(t, err)
|
||||
@ -704,7 +704,7 @@ func TestMetaTable(t *testing.T) {
|
||||
mockKV.multiSaveAndRemoveWithPrefix = func(saves map[string]string, removals []string, addition func(ts typeutil.Timestamp) (string, string, error)) (typeutil.Timestamp, error) {
|
||||
return 0, fmt.Errorf("multi save and remove with prefix error")
|
||||
}
|
||||
_, _, _, err = mt.DropIndex(collInfo.Schema.Name, collInfo.Schema.Fields[0].Name, idxInfo[0].IndexName, nil)
|
||||
_, _, _, err = mt.DropIndex(collInfo.Schema.Name, collInfo.Schema.Fields[0].Name, idxInfo[0].IndexName)
|
||||
assert.NotNil(t, err)
|
||||
assert.EqualError(t, err, "multi save and remove with prefix error")
|
||||
})
|
||||
|
||||
@ -226,54 +226,6 @@ func clearMsgChan(timeout time.Duration, targetChan <-chan *msgstream.MsgPack) {
|
||||
}
|
||||
}
|
||||
|
||||
func GenSegInfoMsgPack(seg *datapb.SegmentInfo) *msgstream.MsgPack {
|
||||
msgPack := msgstream.MsgPack{}
|
||||
baseMsg := msgstream.BaseMsg{
|
||||
BeginTimestamp: 0,
|
||||
EndTimestamp: 0,
|
||||
HashValues: []uint32{0},
|
||||
}
|
||||
segMsg := &msgstream.SegmentInfoMsg{
|
||||
BaseMsg: baseMsg,
|
||||
SegmentMsg: datapb.SegmentMsg{
|
||||
Base: &commonpb.MsgBase{
|
||||
MsgType: commonpb.MsgType_SegmentInfo,
|
||||
MsgID: 0,
|
||||
Timestamp: 0,
|
||||
SourceID: 0,
|
||||
},
|
||||
Segment: seg,
|
||||
},
|
||||
}
|
||||
msgPack.Msgs = append(msgPack.Msgs, segMsg)
|
||||
return &msgPack
|
||||
}
|
||||
|
||||
func GenFlushedSegMsgPack(segID typeutil.UniqueID) *msgstream.MsgPack {
|
||||
msgPack := msgstream.MsgPack{}
|
||||
baseMsg := msgstream.BaseMsg{
|
||||
BeginTimestamp: 0,
|
||||
EndTimestamp: 0,
|
||||
HashValues: []uint32{0},
|
||||
}
|
||||
segMsg := &msgstream.FlushCompletedMsg{
|
||||
BaseMsg: baseMsg,
|
||||
SegmentFlushCompletedMsg: datapb.SegmentFlushCompletedMsg{
|
||||
Base: &commonpb.MsgBase{
|
||||
MsgType: commonpb.MsgType_SegmentFlushDone,
|
||||
MsgID: 0,
|
||||
Timestamp: 0,
|
||||
SourceID: 0,
|
||||
},
|
||||
Segment: &datapb.SegmentInfo{
|
||||
ID: segID,
|
||||
},
|
||||
},
|
||||
}
|
||||
msgPack.Msgs = append(msgPack.Msgs, segMsg)
|
||||
return &msgPack
|
||||
}
|
||||
|
||||
func getNotTtMsg(ctx context.Context, n int, ch <-chan *msgstream.MsgPack) []msgstream.TsMsg {
|
||||
ret := make([]msgstream.TsMsg, 0, n)
|
||||
for {
|
||||
|
||||
@ -260,10 +260,6 @@ func (t *DropCollectionReqTask) Execute(ctx context.Context) error {
|
||||
DbID: 0, //not used
|
||||
CollectionID: collMeta.ID,
|
||||
}
|
||||
segIDs, err := t.core.CallGetFlushedSegmentsService(ctx, collMeta.ID, -1)
|
||||
if err != nil {
|
||||
log.Debug("Get flushed segment from data coords failed", zap.String("collection_name", t.Req.CollectionName), zap.Error(err))
|
||||
}
|
||||
|
||||
// build DdOperation and save it into etcd, when ddmsg send fail,
|
||||
// system can restore ddmsg from etcd and re-send
|
||||
@ -272,7 +268,7 @@ func (t *DropCollectionReqTask) Execute(ctx context.Context) error {
|
||||
return EncodeDdOperation(&ddReq, nil, DropCollectionDDType)
|
||||
}
|
||||
|
||||
ts, err := t.core.MetaTable.DeleteCollection(collMeta.ID, segIDs, ddOp)
|
||||
ts, err := t.core.MetaTable.DeleteCollection(collMeta.ID, ddOp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -492,10 +488,6 @@ func (t *DropPartitionReqTask) Execute(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
segIDs, err := t.core.CallGetFlushedSegmentsService(ctx, collInfo.ID, partID)
|
||||
if err != nil {
|
||||
log.Debug("get flushed segments from data coord failed", zap.String("collection_name", t.Req.CollectionName), zap.String("partition_name", t.Req.PartitionName))
|
||||
}
|
||||
|
||||
ddReq := internalpb.DropPartitionRequest{
|
||||
Base: t.Req.Base,
|
||||
@ -514,7 +506,7 @@ func (t *DropPartitionReqTask) Execute(ctx context.Context) error {
|
||||
return EncodeDdOperation(&ddReq, nil, DropPartitionDDType)
|
||||
}
|
||||
|
||||
ts, _, err := t.core.MetaTable.DeletePartition(collInfo.ID, t.Req.PartitionName, segIDs, ddOp)
|
||||
ts, _, err := t.core.MetaTable.DeletePartition(collInfo.ID, t.Req.PartitionName, ddOp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -737,10 +729,12 @@ func (t *CreateIndexReqTask) Execute(ctx context.Context) error {
|
||||
|
||||
for _, segID := range segIDs {
|
||||
info := etcdpb.SegmentIndexInfo{
|
||||
SegmentID: segID,
|
||||
FieldID: field.FieldID,
|
||||
IndexID: idxInfo.IndexID,
|
||||
EnableIndex: false,
|
||||
CollectionID: collMeta.ID,
|
||||
PartitionID: segID2PartID[segID],
|
||||
SegmentID: segID,
|
||||
FieldID: field.FieldID,
|
||||
IndexID: idxInfo.IndexID,
|
||||
EnableIndex: false,
|
||||
}
|
||||
info.BuildID, err = t.core.BuildIndex(ctx, segID, &field, idxInfo, false)
|
||||
if err != nil {
|
||||
@ -806,7 +800,7 @@ func (t *DropIndexReqTask) Execute(ctx context.Context) error {
|
||||
if t.Type() != commonpb.MsgType_DropIndex {
|
||||
return fmt.Errorf("drop index, msg type = %s", commonpb.MsgType_name[int32(t.Type())])
|
||||
}
|
||||
collInfo, info, err := t.core.MetaTable.GetIndexByName(t.Req.CollectionName, t.Req.IndexName)
|
||||
_, info, err := t.core.MetaTable.GetIndexByName(t.Req.CollectionName, t.Req.IndexName)
|
||||
if err != nil {
|
||||
log.Warn("GetIndexByName failed,", zap.String("collection name", t.Req.CollectionName), zap.String("field name", t.Req.FieldName), zap.String("index name", t.Req.IndexName), zap.Error(err))
|
||||
return err
|
||||
@ -817,15 +811,10 @@ func (t *DropIndexReqTask) Execute(ctx context.Context) error {
|
||||
if len(info) != 1 {
|
||||
return fmt.Errorf("len(index) = %d", len(info))
|
||||
}
|
||||
segIDs, err := t.core.CallGetFlushedSegmentsService(t.ctx, collInfo.ID, -1)
|
||||
if err != nil {
|
||||
log.Debug("call get flushed segments from data coord failed", zap.String("collection_name", collInfo.Schema.Name), zap.Error(err))
|
||||
}
|
||||
|
||||
err = t.core.CallDropIndexService(ctx, info[0].IndexID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, _, _, err = t.core.MetaTable.DropIndex(t.Req.CollectionName, t.Req.FieldName, t.Req.IndexName, segIDs)
|
||||
_, _, _, err = t.core.MetaTable.DropIndex(t.Req.CollectionName, t.Req.FieldName, t.Req.IndexName)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -93,7 +93,9 @@ func DecodeDdOperation(str string, ddOp *DdOperation) error {
|
||||
|
||||
// SegmentIndexInfoEqual return true if SegmentIndexInfos are identical
|
||||
func SegmentIndexInfoEqual(info1 *etcdpb.SegmentIndexInfo, info2 *etcdpb.SegmentIndexInfo) bool {
|
||||
return info1.SegmentID == info2.SegmentID &&
|
||||
return info1.CollectionID == info2.CollectionID &&
|
||||
info1.PartitionID == info2.PartitionID &&
|
||||
info1.SegmentID == info2.SegmentID &&
|
||||
info1.FieldID == info2.FieldID &&
|
||||
info1.IndexID == info2.IndexID &&
|
||||
info1.EnableIndex == info2.EnableIndex
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user