未验证 提交 67c1fdd2 编写于 作者: D dragondriver 提交者: GitHub

Show/Describe collections/partitions with created timestamp (#6700)

Signed-off-by: Ndragondriver <jiquan.long@zilliz.com>
上级 fd84cf7c
......@@ -206,6 +206,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_etcd_5fmeta_2eproto::offsets[]
PROTOBUF_FIELD_OFFSET(::milvus::proto::etcd::CollectionInfo, field_indexes_),
PROTOBUF_FIELD_OFFSET(::milvus::proto::etcd::CollectionInfo, virtual_channel_names_),
PROTOBUF_FIELD_OFFSET(::milvus::proto::etcd::CollectionInfo, physical_channel_names_),
PROTOBUF_FIELD_OFFSET(::milvus::proto::etcd::CollectionInfo, partition_created_timestamps_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::milvus::proto::etcd::SegmentIndexInfo, _internal_metadata_),
~0u, // no _extensions_
......@@ -236,8 +237,8 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOB
{ 17, -1, sizeof(::milvus::proto::etcd::IndexInfo)},
{ 25, -1, sizeof(::milvus::proto::etcd::FieldIndexInfo)},
{ 32, -1, sizeof(::milvus::proto::etcd::CollectionInfo)},
{ 45, -1, sizeof(::milvus::proto::etcd::SegmentIndexInfo)},
{ 57, -1, sizeof(::milvus::proto::etcd::CollectionMeta)},
{ 46, -1, sizeof(::milvus::proto::etcd::SegmentIndexInfo)},
{ 58, -1, sizeof(::milvus::proto::etcd::CollectionMeta)},
};
static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
......@@ -261,24 +262,25 @@ const char descriptor_table_protodef_etcd_5fmeta_2eproto[] PROTOBUF_SECTION_VARI
"\022\n\nindex_name\030\001 \001(\t\022\017\n\007indexID\030\002 \001(\003\0227\n\014"
"index_params\030\003 \003(\0132!.milvus.proto.common"
".KeyValuePair\"2\n\016FieldIndexInfo\022\017\n\007filed"
"ID\030\001 \001(\003\022\017\n\007indexID\030\002 \001(\003\"\217\002\n\016Collection"
"ID\030\001 \001(\003\022\017\n\007indexID\030\002 \001(\003\"\265\002\n\016Collection"
"Info\022\n\n\002ID\030\001 \001(\003\0225\n\006schema\030\002 \001(\0132%.milvu"
"s.proto.schema.CollectionSchema\022\023\n\013creat"
"e_time\030\003 \001(\004\022\024\n\014partitionIDs\030\004 \003(\003\022\026\n\016pa"
"rtitionNames\030\005 \003(\t\0228\n\rfield_indexes\030\006 \003("
"\0132!.milvus.proto.etcd.FieldIndexInfo\022\035\n\025"
"virtual_channel_names\030\007 \003(\t\022\036\n\026physical_"
"channel_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\014ena"
"ble_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.sc"
"hema.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.c"
"om/milvus-io/milvus/internal/proto/etcdp"
"bb\006proto3"
"channel_names\030\010 \003(\t\022$\n\034partition_created"
"_timestamps\030\t \003(\004\"\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\014enabl"
"e_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.sche"
"ma.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"
"/milvus-io/milvus/internal/proto/etcdpbb"
"\006proto3"
;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_etcd_5fmeta_2eproto_deps[2] = {
&::descriptor_table_common_2eproto,
......@@ -296,7 +298,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", 1089,
&descriptor_table_etcd_5fmeta_2eproto_initialized, descriptor_table_protodef_etcd_5fmeta_2eproto, "etcd_meta.proto", 1127,
&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,
......@@ -1805,7 +1807,8 @@ CollectionInfo::CollectionInfo(const CollectionInfo& from)
partitionnames_(from.partitionnames_),
field_indexes_(from.field_indexes_),
virtual_channel_names_(from.virtual_channel_names_),
physical_channel_names_(from.physical_channel_names_) {
physical_channel_names_(from.physical_channel_names_),
partition_created_timestamps_(from.partition_created_timestamps_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from.has_schema()) {
schema_ = new ::milvus::proto::schema::CollectionSchema(*from.schema_);
......@@ -1854,6 +1857,7 @@ void CollectionInfo::Clear() {
field_indexes_.Clear();
virtual_channel_names_.Clear();
physical_channel_names_.Clear();
partition_created_timestamps_.Clear();
if (GetArenaNoVirtual() == nullptr && schema_ != nullptr) {
delete schema_;
}
......@@ -1951,6 +1955,16 @@ const char* CollectionInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE
} while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 66);
} else goto handle_unusual;
continue;
// repeated uint64 partition_created_timestamps = 9;
case 9:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(mutable_partition_created_timestamps(), ptr, ctx);
CHK_(ptr);
} else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72) {
add_partition_created_timestamps(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr));
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
......@@ -2093,6 +2107,22 @@ bool CollectionInfo::MergePartialFromCodedStream(
break;
}
// repeated uint64 partition_created_timestamps = 9;
case 9: {
if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (74 & 0xFF)) {
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPackedPrimitive<
::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>(
input, this->mutable_partition_created_timestamps())));
} else if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (72 & 0xFF)) {
DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>(
1, 74u, input, this->mutable_partition_created_timestamps())));
} else {
goto handle_unusual;
}
break;
}
default: {
handle_unusual:
if (tag == 0) {
......@@ -2186,6 +2216,17 @@ void CollectionInfo::SerializeWithCachedSizes(
8, this->physical_channel_names(i), output);
}
// repeated uint64 partition_created_timestamps = 9;
if (this->partition_created_timestamps_size() > 0) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTag(9, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
output->WriteVarint32(_partition_created_timestamps_cached_byte_size_.load(
std::memory_order_relaxed));
}
for (int i = 0, n = this->partition_created_timestamps_size(); i < n; i++) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64NoTag(
this->partition_created_timestamps(i), output);
}
if (_internal_metadata_.have_unknown_fields()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
_internal_metadata_.unknown_fields(), output);
......@@ -2267,6 +2308,19 @@ void CollectionInfo::SerializeWithCachedSizes(
WriteStringToArray(8, this->physical_channel_names(i), target);
}
// repeated uint64 partition_created_timestamps = 9;
if (this->partition_created_timestamps_size() > 0) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteTagToArray(
9,
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
target);
target = ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream::WriteVarint32ToArray(
_partition_created_timestamps_cached_byte_size_.load(std::memory_order_relaxed),
target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
WriteUInt64NoTagToArray(this->partition_created_timestamps_, target);
}
if (_internal_metadata_.have_unknown_fields()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target);
......@@ -2338,6 +2392,21 @@ size_t CollectionInfo::ByteSizeLong() const {
this->physical_channel_names(i));
}
// repeated uint64 partition_created_timestamps = 9;
{
size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
UInt64Size(this->partition_created_timestamps_);
if (data_size > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
_partition_created_timestamps_cached_byte_size_.store(cached_size,
std::memory_order_relaxed);
total_size += data_size;
}
// .milvus.proto.schema.CollectionSchema schema = 2;
if (this->has_schema()) {
total_size += 1 +
......@@ -2391,6 +2460,7 @@ void CollectionInfo::MergeFrom(const CollectionInfo& from) {
field_indexes_.MergeFrom(from.field_indexes_);
virtual_channel_names_.MergeFrom(from.virtual_channel_names_);
physical_channel_names_.MergeFrom(from.physical_channel_names_);
partition_created_timestamps_.MergeFrom(from.partition_created_timestamps_);
if (from.has_schema()) {
mutable_schema()->::milvus::proto::schema::CollectionSchema::MergeFrom(from.schema());
}
......@@ -2428,6 +2498,7 @@ void CollectionInfo::InternalSwap(CollectionInfo* other) {
CastToBase(&field_indexes_)->InternalSwap(CastToBase(&other->field_indexes_));
virtual_channel_names_.InternalSwap(CastToBase(&other->virtual_channel_names_));
physical_channel_names_.InternalSwap(CastToBase(&other->physical_channel_names_));
partition_created_timestamps_.InternalSwap(&other->partition_created_timestamps_);
swap(schema_, other->schema_);
swap(id_, other->id_);
swap(create_time_, other->create_time_);
......
......@@ -841,6 +841,7 @@ class CollectionInfo :
kFieldIndexesFieldNumber = 6,
kVirtualChannelNamesFieldNumber = 7,
kPhysicalChannelNamesFieldNumber = 8,
kPartitionCreatedTimestampsFieldNumber = 9,
kSchemaFieldNumber = 2,
kIDFieldNumber = 1,
kCreateTimeFieldNumber = 3,
......@@ -918,6 +919,17 @@ class CollectionInfo :
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& physical_channel_names() const;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_physical_channel_names();
// repeated uint64 partition_created_timestamps = 9;
int partition_created_timestamps_size() const;
void clear_partition_created_timestamps();
::PROTOBUF_NAMESPACE_ID::uint64 partition_created_timestamps(int index) const;
void set_partition_created_timestamps(int index, ::PROTOBUF_NAMESPACE_ID::uint64 value);
void add_partition_created_timestamps(::PROTOBUF_NAMESPACE_ID::uint64 value);
const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >&
partition_created_timestamps() const;
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >*
mutable_partition_created_timestamps();
// .milvus.proto.schema.CollectionSchema schema = 2;
bool has_schema() const;
void clear_schema();
......@@ -947,6 +959,8 @@ class CollectionInfo :
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::milvus::proto::etcd::FieldIndexInfo > field_indexes_;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> virtual_channel_names_;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> physical_channel_names_;
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 > partition_created_timestamps_;
mutable std::atomic<int> _partition_created_timestamps_cached_byte_size_;
::milvus::proto::schema::CollectionSchema* schema_;
::PROTOBUF_NAMESPACE_ID::int64 id_;
::PROTOBUF_NAMESPACE_ID::uint64 create_time_;
......@@ -2064,6 +2078,36 @@ CollectionInfo::mutable_physical_channel_names() {
return &physical_channel_names_;
}
// repeated uint64 partition_created_timestamps = 9;
inline int CollectionInfo::partition_created_timestamps_size() const {
return partition_created_timestamps_.size();
}
inline void CollectionInfo::clear_partition_created_timestamps() {
partition_created_timestamps_.Clear();
}
inline ::PROTOBUF_NAMESPACE_ID::uint64 CollectionInfo::partition_created_timestamps(int index) const {
// @@protoc_insertion_point(field_get:milvus.proto.etcd.CollectionInfo.partition_created_timestamps)
return partition_created_timestamps_.Get(index);
}
inline void CollectionInfo::set_partition_created_timestamps(int index, ::PROTOBUF_NAMESPACE_ID::uint64 value) {
partition_created_timestamps_.Set(index, value);
// @@protoc_insertion_point(field_set:milvus.proto.etcd.CollectionInfo.partition_created_timestamps)
}
inline void CollectionInfo::add_partition_created_timestamps(::PROTOBUF_NAMESPACE_ID::uint64 value) {
partition_created_timestamps_.Add(value);
// @@protoc_insertion_point(field_add:milvus.proto.etcd.CollectionInfo.partition_created_timestamps)
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >&
CollectionInfo::partition_created_timestamps() const {
// @@protoc_insertion_point(field_list:milvus.proto.etcd.CollectionInfo.partition_created_timestamps)
return partition_created_timestamps_;
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >*
CollectionInfo::mutable_partition_created_timestamps() {
// @@protoc_insertion_point(field_mutable_list:milvus.proto.etcd.CollectionInfo.partition_created_timestamps)
return &partition_created_timestamps_;
}
// -------------------------------------------------------------------
// SegmentIndexInfo
......
此差异已折叠。
......@@ -1464,6 +1464,8 @@ class DescribeCollectionResponse :
kStatusFieldNumber = 1,
kSchemaFieldNumber = 2,
kCollectionIDFieldNumber = 3,
kCreatedTimestampFieldNumber = 6,
kCreatedUtcTimestampFieldNumber = 7,
};
// repeated string virtual_channel_names = 4;
int virtual_channel_names_size() const;
......@@ -1520,6 +1522,16 @@ class DescribeCollectionResponse :
::PROTOBUF_NAMESPACE_ID::int64 collectionid() const;
void set_collectionid(::PROTOBUF_NAMESPACE_ID::int64 value);
// uint64 created_timestamp = 6;
void clear_created_timestamp();
::PROTOBUF_NAMESPACE_ID::uint64 created_timestamp() const;
void set_created_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value);
// uint64 created_utc_timestamp = 7;
void clear_created_utc_timestamp();
::PROTOBUF_NAMESPACE_ID::uint64 created_utc_timestamp() const;
void set_created_utc_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value);
// @@protoc_insertion_point(class_scope:milvus.proto.milvus.DescribeCollectionResponse)
private:
class _Internal;
......@@ -1530,6 +1542,8 @@ class DescribeCollectionResponse :
::milvus::proto::common::Status* status_;
::milvus::proto::schema::CollectionSchema* schema_;
::PROTOBUF_NAMESPACE_ID::int64 collectionid_;
::PROTOBUF_NAMESPACE_ID::uint64 created_timestamp_;
::PROTOBUF_NAMESPACE_ID::uint64 created_utc_timestamp_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_milvus_2eproto;
};
......@@ -2438,6 +2452,8 @@ class ShowCollectionsResponse :
enum : int {
kCollectionNamesFieldNumber = 2,
kCollectionIdsFieldNumber = 3,
kCreatedTimestampsFieldNumber = 4,
kCreatedUtcTimestampsFieldNumber = 5,
kStatusFieldNumber = 1,
};
// repeated string collection_names = 2;
......@@ -2468,6 +2484,28 @@ class ShowCollectionsResponse :
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >*
mutable_collection_ids();
// repeated uint64 created_timestamps = 4;
int created_timestamps_size() const;
void clear_created_timestamps();
::PROTOBUF_NAMESPACE_ID::uint64 created_timestamps(int index) const;
void set_created_timestamps(int index, ::PROTOBUF_NAMESPACE_ID::uint64 value);
void add_created_timestamps(::PROTOBUF_NAMESPACE_ID::uint64 value);
const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >&
created_timestamps() const;
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >*
mutable_created_timestamps();
// repeated uint64 created_utc_timestamps = 5;
int created_utc_timestamps_size() const;
void clear_created_utc_timestamps();
::PROTOBUF_NAMESPACE_ID::uint64 created_utc_timestamps(int index) const;
void set_created_utc_timestamps(int index, ::PROTOBUF_NAMESPACE_ID::uint64 value);
void add_created_utc_timestamps(::PROTOBUF_NAMESPACE_ID::uint64 value);
const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >&
created_utc_timestamps() const;
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >*
mutable_created_utc_timestamps();
// .milvus.proto.common.Status status = 1;
bool has_status() const;
void clear_status();
......@@ -2484,6 +2522,10 @@ class ShowCollectionsResponse :
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> collection_names_;
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > collection_ids_;
mutable std::atomic<int> _collection_ids_cached_byte_size_;
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 > created_timestamps_;
mutable std::atomic<int> _created_timestamps_cached_byte_size_;
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 > created_utc_timestamps_;
mutable std::atomic<int> _created_utc_timestamps_cached_byte_size_;
::milvus::proto::common::Status* status_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_milvus_2eproto;
......@@ -3969,6 +4011,8 @@ class ShowPartitionsResponse :
enum : int {
kPartitionNamesFieldNumber = 2,
kPartitionIDsFieldNumber = 3,
kCreatedTimestampsFieldNumber = 4,
kCreatedUtcTimestampsFieldNumber = 5,
kStatusFieldNumber = 1,
};
// repeated string partition_names = 2;
......@@ -3999,6 +4043,28 @@ class ShowPartitionsResponse :
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >*
mutable_partitionids();
// repeated uint64 created_timestamps = 4;
int created_timestamps_size() const;
void clear_created_timestamps();
::PROTOBUF_NAMESPACE_ID::uint64 created_timestamps(int index) const;
void set_created_timestamps(int index, ::PROTOBUF_NAMESPACE_ID::uint64 value);
void add_created_timestamps(::PROTOBUF_NAMESPACE_ID::uint64 value);
const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >&
created_timestamps() const;
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >*
mutable_created_timestamps();
// repeated uint64 created_utc_timestamps = 5;
int created_utc_timestamps_size() const;
void clear_created_utc_timestamps();
::PROTOBUF_NAMESPACE_ID::uint64 created_utc_timestamps(int index) const;
void set_created_utc_timestamps(int index, ::PROTOBUF_NAMESPACE_ID::uint64 value);
void add_created_utc_timestamps(::PROTOBUF_NAMESPACE_ID::uint64 value);
const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >&
created_utc_timestamps() const;
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >*
mutable_created_utc_timestamps();
// .milvus.proto.common.Status status = 1;
bool has_status() const;
void clear_status();
......@@ -4015,6 +4081,10 @@ class ShowPartitionsResponse :
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> partition_names_;
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > partitionids_;
mutable std::atomic<int> _partitionids_cached_byte_size_;
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 > created_timestamps_;
mutable std::atomic<int> _created_timestamps_cached_byte_size_;
::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 > created_utc_timestamps_;
mutable std::atomic<int> _created_utc_timestamps_cached_byte_size_;
::milvus::proto::common::Status* status_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_milvus_2eproto;
......@@ -11830,6 +11900,34 @@ DescribeCollectionResponse::mutable_physical_channel_names() {
return &physical_channel_names_;
}
// uint64 created_timestamp = 6;
inline void DescribeCollectionResponse::clear_created_timestamp() {
created_timestamp_ = PROTOBUF_ULONGLONG(0);
}
inline ::PROTOBUF_NAMESPACE_ID::uint64 DescribeCollectionResponse::created_timestamp() const {
// @@protoc_insertion_point(field_get:milvus.proto.milvus.DescribeCollectionResponse.created_timestamp)
return created_timestamp_;
}
inline void DescribeCollectionResponse::set_created_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value) {
created_timestamp_ = value;
// @@protoc_insertion_point(field_set:milvus.proto.milvus.DescribeCollectionResponse.created_timestamp)
}
// uint64 created_utc_timestamp = 7;
inline void DescribeCollectionResponse::clear_created_utc_timestamp() {
created_utc_timestamp_ = PROTOBUF_ULONGLONG(0);
}
inline ::PROTOBUF_NAMESPACE_ID::uint64 DescribeCollectionResponse::created_utc_timestamp() const {
// @@protoc_insertion_point(field_get:milvus.proto.milvus.DescribeCollectionResponse.created_utc_timestamp)
return created_utc_timestamp_;
}
inline void DescribeCollectionResponse::set_created_utc_timestamp(::PROTOBUF_NAMESPACE_ID::uint64 value) {
created_utc_timestamp_ = value;
// @@protoc_insertion_point(field_set:milvus.proto.milvus.DescribeCollectionResponse.created_utc_timestamp)
}
// -------------------------------------------------------------------
// LoadCollectionRequest
......@@ -12631,6 +12729,66 @@ ShowCollectionsResponse::mutable_collection_ids() {
return &collection_ids_;
}
// repeated uint64 created_timestamps = 4;
inline int ShowCollectionsResponse::created_timestamps_size() const {
return created_timestamps_.size();
}
inline void ShowCollectionsResponse::clear_created_timestamps() {
created_timestamps_.Clear();
}
inline ::PROTOBUF_NAMESPACE_ID::uint64 ShowCollectionsResponse::created_timestamps(int index) const {
// @@protoc_insertion_point(field_get:milvus.proto.milvus.ShowCollectionsResponse.created_timestamps)
return created_timestamps_.Get(index);
}
inline void ShowCollectionsResponse::set_created_timestamps(int index, ::PROTOBUF_NAMESPACE_ID::uint64 value) {
created_timestamps_.Set(index, value);
// @@protoc_insertion_point(field_set:milvus.proto.milvus.ShowCollectionsResponse.created_timestamps)
}
inline void ShowCollectionsResponse::add_created_timestamps(::PROTOBUF_NAMESPACE_ID::uint64 value) {
created_timestamps_.Add(value);
// @@protoc_insertion_point(field_add:milvus.proto.milvus.ShowCollectionsResponse.created_timestamps)
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >&
ShowCollectionsResponse::created_timestamps() const {
// @@protoc_insertion_point(field_list:milvus.proto.milvus.ShowCollectionsResponse.created_timestamps)
return created_timestamps_;
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >*
ShowCollectionsResponse::mutable_created_timestamps() {
// @@protoc_insertion_point(field_mutable_list:milvus.proto.milvus.ShowCollectionsResponse.created_timestamps)
return &created_timestamps_;
}
// repeated uint64 created_utc_timestamps = 5;
inline int ShowCollectionsResponse::created_utc_timestamps_size() const {
return created_utc_timestamps_.size();
}
inline void ShowCollectionsResponse::clear_created_utc_timestamps() {
created_utc_timestamps_.Clear();
}
inline ::PROTOBUF_NAMESPACE_ID::uint64 ShowCollectionsResponse::created_utc_timestamps(int index) const {
// @@protoc_insertion_point(field_get:milvus.proto.milvus.ShowCollectionsResponse.created_utc_timestamps)
return created_utc_timestamps_.Get(index);
}
inline void ShowCollectionsResponse::set_created_utc_timestamps(int index, ::PROTOBUF_NAMESPACE_ID::uint64 value) {
created_utc_timestamps_.Set(index, value);
// @@protoc_insertion_point(field_set:milvus.proto.milvus.ShowCollectionsResponse.created_utc_timestamps)
}
inline void ShowCollectionsResponse::add_created_utc_timestamps(::PROTOBUF_NAMESPACE_ID::uint64 value) {
created_utc_timestamps_.Add(value);
// @@protoc_insertion_point(field_add:milvus.proto.milvus.ShowCollectionsResponse.created_utc_timestamps)
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >&
ShowCollectionsResponse::created_utc_timestamps() const {
// @@protoc_insertion_point(field_list:milvus.proto.milvus.ShowCollectionsResponse.created_utc_timestamps)
return created_utc_timestamps_;
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >*
ShowCollectionsResponse::mutable_created_utc_timestamps() {
// @@protoc_insertion_point(field_mutable_list:milvus.proto.milvus.ShowCollectionsResponse.created_utc_timestamps)
return &created_utc_timestamps_;
}
// -------------------------------------------------------------------
// CreatePartitionRequest
......@@ -14256,6 +14414,66 @@ ShowPartitionsResponse::mutable_partitionids() {
return &partitionids_;
}
// repeated uint64 created_timestamps = 4;
inline int ShowPartitionsResponse::created_timestamps_size() const {
return created_timestamps_.size();
}
inline void ShowPartitionsResponse::clear_created_timestamps() {
created_timestamps_.Clear();
}
inline ::PROTOBUF_NAMESPACE_ID::uint64 ShowPartitionsResponse::created_timestamps(int index) const {
// @@protoc_insertion_point(field_get:milvus.proto.milvus.ShowPartitionsResponse.created_timestamps)
return created_timestamps_.Get(index);
}
inline void ShowPartitionsResponse::set_created_timestamps(int index, ::PROTOBUF_NAMESPACE_ID::uint64 value) {
created_timestamps_.Set(index, value);
// @@protoc_insertion_point(field_set:milvus.proto.milvus.ShowPartitionsResponse.created_timestamps)
}
inline void ShowPartitionsResponse::add_created_timestamps(::PROTOBUF_NAMESPACE_ID::uint64 value) {
created_timestamps_.Add(value);
// @@protoc_insertion_point(field_add:milvus.proto.milvus.ShowPartitionsResponse.created_timestamps)
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >&
ShowPartitionsResponse::created_timestamps() const {
// @@protoc_insertion_point(field_list:milvus.proto.milvus.ShowPartitionsResponse.created_timestamps)
return created_timestamps_;
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >*
ShowPartitionsResponse::mutable_created_timestamps() {
// @@protoc_insertion_point(field_mutable_list:milvus.proto.milvus.ShowPartitionsResponse.created_timestamps)
return &created_timestamps_;
}
// repeated uint64 created_utc_timestamps = 5;
inline int ShowPartitionsResponse::created_utc_timestamps_size() const {
return created_utc_timestamps_.size();
}
inline void ShowPartitionsResponse::clear_created_utc_timestamps() {
created_utc_timestamps_.Clear();
}
inline ::PROTOBUF_NAMESPACE_ID::uint64 ShowPartitionsResponse::created_utc_timestamps(int index) const {
// @@protoc_insertion_point(field_get:milvus.proto.milvus.ShowPartitionsResponse.created_utc_timestamps)
return created_utc_timestamps_.Get(index);
}
inline void ShowPartitionsResponse::set_created_utc_timestamps(int index, ::PROTOBUF_NAMESPACE_ID::uint64 value) {
created_utc_timestamps_.Set(index, value);
// @@protoc_insertion_point(field_set:milvus.proto.milvus.ShowPartitionsResponse.created_utc_timestamps)
}
inline void ShowPartitionsResponse::add_created_utc_timestamps(::PROTOBUF_NAMESPACE_ID::uint64 value) {
created_utc_timestamps_.Add(value);
// @@protoc_insertion_point(field_add:milvus.proto.milvus.ShowPartitionsResponse.created_utc_timestamps)
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >&
ShowPartitionsResponse::created_utc_timestamps() const {
// @@protoc_insertion_point(field_list:milvus.proto.milvus.ShowPartitionsResponse.created_utc_timestamps)
return created_utc_timestamps_;
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::uint64 >*
ShowPartitionsResponse::mutable_created_utc_timestamps() {
// @@protoc_insertion_point(field_mutable_list:milvus.proto.milvus.ShowPartitionsResponse.created_utc_timestamps)
return &created_utc_timestamps_;
}
// -------------------------------------------------------------------
// DescribeSegmentRequest
......
......@@ -38,6 +38,7 @@ message CollectionInfo {
repeated FieldIndexInfo field_indexes = 6;
repeated string virtual_channel_names = 7;
repeated string physical_channel_names = 8;
repeated uint64 partition_created_timestamps = 9;
}
message SegmentIndexInfo {
......
......@@ -243,17 +243,18 @@ func (m *FieldIndexInfo) GetIndexID() int64 {
}
type CollectionInfo struct {
ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
Schema *schemapb.CollectionSchema `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"`
CreateTime uint64 `protobuf:"varint,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
PartitionIDs []int64 `protobuf:"varint,4,rep,packed,name=partitionIDs,proto3" json:"partitionIDs,omitempty"`
PartitionNames []string `protobuf:"bytes,5,rep,name=partitionNames,proto3" json:"partitionNames,omitempty"`
FieldIndexes []*FieldIndexInfo `protobuf:"bytes,6,rep,name=field_indexes,json=fieldIndexes,proto3" json:"field_indexes,omitempty"`
VirtualChannelNames []string `protobuf:"bytes,7,rep,name=virtual_channel_names,json=virtualChannelNames,proto3" json:"virtual_channel_names,omitempty"`
PhysicalChannelNames []string `protobuf:"bytes,8,rep,name=physical_channel_names,json=physicalChannelNames,proto3" json:"physical_channel_names,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
Schema *schemapb.CollectionSchema `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"`
CreateTime uint64 `protobuf:"varint,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
PartitionIDs []int64 `protobuf:"varint,4,rep,packed,name=partitionIDs,proto3" json:"partitionIDs,omitempty"`
PartitionNames []string `protobuf:"bytes,5,rep,name=partitionNames,proto3" json:"partitionNames,omitempty"`
FieldIndexes []*FieldIndexInfo `protobuf:"bytes,6,rep,name=field_indexes,json=fieldIndexes,proto3" json:"field_indexes,omitempty"`
VirtualChannelNames []string `protobuf:"bytes,7,rep,name=virtual_channel_names,json=virtualChannelNames,proto3" json:"virtual_channel_names,omitempty"`
PhysicalChannelNames []string `protobuf:"bytes,8,rep,name=physical_channel_names,json=physicalChannelNames,proto3" json:"physical_channel_names,omitempty"`
PartitionCreatedTimestamps []uint64 `protobuf:"varint,9,rep,packed,name=partition_created_timestamps,json=partitionCreatedTimestamps,proto3" json:"partition_created_timestamps,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CollectionInfo) Reset() { *m = CollectionInfo{} }
......@@ -337,6 +338,13 @@ func (m *CollectionInfo) GetPhysicalChannelNames() []string {
return nil
}
func (m *CollectionInfo) GetPartitionCreatedTimestamps() []uint64 {
if m != nil {
return m.PartitionCreatedTimestamps
}
return nil
}
type SegmentIndexInfo struct {
CollectionID int64 `protobuf:"varint,1,opt,name=collectionID,proto3" json:"collectionID,omitempty"`
PartitionID int64 `protobuf:"varint,2,opt,name=partitionID,proto3" json:"partitionID,omitempty"`
......@@ -516,47 +524,49 @@ func init() {
func init() { proto.RegisterFile("etcd_meta.proto", fileDescriptor_975d306d62b73e88) }
var fileDescriptor_975d306d62b73e88 = []byte{
// 664 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,
0xd4, 0x12, 0x09, 0x91, 0x88, 0x16, 0xb1, 0x63, 0x01, 0xb5, 0x2a, 0x45, 0x88, 0xaa, 0xb8, 0x15,
0x0b, 0x36, 0xd6, 0xc4, 0xbe, 0x49, 0x46, 0xb2, 0xc7, 0xc1, 0x33, 0xae, 0x9a, 0x1d, 0x6b, 0x1e,
0x81, 0x17, 0x64, 0xc1, 0x3b, 0x20, 0xe4, 0x19, 0xdb, 0x71, 0xda, 0xb0, 0x64, 0xe7, 0x73, 0xee,
0xdc, 0xf1, 0xb9, 0xe7, 0x9e, 0x81, 0x3d, 0x94, 0x61, 0x14, 0x24, 0x28, 0xe9, 0x70, 0x91, 0xa5,
0x32, 0x25, 0x07, 0x09, 0x8b, 0xef, 0x72, 0xa1,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0xff, 0xff,
0x06, 0xbe, 0x60, 0xc9, 0xc9, 0x05, 0x00, 0x00,
// 693 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xcf, 0x6e, 0xd3, 0x4e,
0x10, 0x96, 0xeb, 0x34, 0xa9, 0x27, 0x69, 0xda, 0xee, 0xef, 0x8f, 0xac, 0xaa, 0x80, 0x6b, 0xa9,
0x25, 0x12, 0x22, 0x11, 0x2d, 0xe2, 0x86, 0x04, 0xd4, 0xaa, 0x14, 0x21, 0xaa, 0xe2, 0x46, 0x1c,
0xb8, 0x58, 0x1b, 0x7b, 0x92, 0xac, 0x64, 0xaf, 0x83, 0x77, 0x5d, 0x35, 0x37, 0xce, 0x3c, 0x02,
0x4f, 0xc3, 0xdb, 0x70, 0xe0, 0x25, 0x90, 0x77, 0x6d, 0x27, 0x69, 0xc3, 0x91, 0x9b, 0xe7, 0x9b,
0x99, 0xdd, 0x6f, 0xbe, 0xf9, 0xbc, 0xb0, 0x87, 0x32, 0x8c, 0x82, 0x04, 0x25, 0xed, 0xcf, 0xb3,
0x54, 0xa6, 0xe4, 0x20, 0x61, 0xf1, 0x6d, 0x2e, 0x74, 0xd4, 0x2f, 0xb2, 0x87, 0x9d, 0x30, 0x4d,
0x92, 0x94, 0x6b, 0xe8, 0xb0, 0x23, 0xc2, 0x19, 0x26, 0x65, 0xb9, 0xfb, 0xdd, 0x00, 0x18, 0x21,
0xa7, 0x5c, 0x7e, 0x40, 0x49, 0x49, 0x17, 0xb6, 0x86, 0x9e, 0x6d, 0x38, 0x46, 0xcf, 0xf4, 0xb7,
0x86, 0x1e, 0x39, 0x85, 0x3d, 0x9e, 0x27, 0xc1, 0x97, 0x1c, 0xb3, 0x45, 0xc0, 0xd3, 0x08, 0x85,
0xbd, 0xa5, 0x92, 0xbb, 0x3c, 0x4f, 0x3e, 0x16, 0xe8, 0x55, 0x01, 0x92, 0x67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, 0x03, 0xed, 0x15, 0x91,
0x4b, 0x67, 0xac, 0x42, 0xe4, 0x08, 0x2c, 0x51, 0x9e, 0xec, 0xa9, 0xcd, 0x99, 0xfe, 0x12, 0xd0,
0x7e, 0x2b, 0x44, 0xd3, 0xbf, 0xac, 0xf2, 0x9b, 0x0a, 0x57, 0xfd, 0xb6, 0xbd, 0xee, 0x7d, 0x1b,
0x5a, 0xe3, 0x9c, 0xa9, 0x9e, 0xa6, 0xce, 0x94, 0x21, 0x39, 0x86, 0x0e, 0x72, 0x3a, 0x8e, 0x51,
0xef, 0xce, 0x6e, 0x39, 0x46, 0x6f, 0xc7, 0x6f, 0x6b, 0x4c, 0x0d, 0xe6, 0xfe, 0x32, 0x56, 0xcd,
0xba, 0xf1, 0x1d, 0xf8, 0xdb, 0x66, 0x7d, 0x0c, 0x50, 0x0b, 0x50, 0x59, 0x75, 0x05, 0x21, 0x27,
0x2b, 0x46, 0x0d, 0x24, 0x9d, 0x56, 0x46, 0xdd, 0xad, 0xd1, 0x11, 0x9d, 0x8a, 0x07, 0x9e, 0x6f,
0x3e, 0xf4, 0xfc, 0xbb, 0xf3, 0xcf, 0x2f, 0xa6, 0x4c, 0xce, 0xf2, 0x71, 0xf1, 0x16, 0x0c, 0xf4,
0x18, 0xcf, 0x59, 0x5a, 0x7e, 0x0d, 0x18, 0x97, 0x98, 0x71, 0x1a, 0x0f, 0xd4, 0x64, 0x83, 0xc2,
0xd3, 0xf3, 0xf1, 0xb8, 0xa9, 0xa2, 0xf3, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbd, 0xeb, 0x22,
0x81, 0x0b, 0x06, 0x00, 0x00,
}
......@@ -92,6 +92,8 @@ message DescribeCollectionResponse {
int64 collectionID = 3;
repeated string virtual_channel_names = 4;
repeated string physical_channel_names = 5;
uint64 created_timestamp = 6; // hybrid timestamp
uint64 created_utc_timestamp = 7; // physical timestamp
}
message LoadCollectionRequest {
......@@ -133,6 +135,8 @@ message ShowCollectionsResponse {
common.Status status = 1;
repeated string collection_names = 2;
repeated int64 collection_ids = 3;
repeated uint64 created_timestamps = 4; // hybrid timestamps
repeated uint64 created_utc_timestamps = 5; // physical timestamps
}
message CreatePartitionRequest {
......@@ -193,6 +197,8 @@ message ShowPartitionsResponse {
common.Status status = 1;
repeated string partition_names = 2;
repeated int64 partitionIDs = 3;
repeated uint64 created_timestamps = 4; // hybrid timestamps
repeated uint64 created_utc_timestamps = 5; // physical timestamps
}
message DescribeSegmentRequest {
......
......@@ -2579,6 +2579,8 @@ func (dct *DescribeCollectionTask) Execute(ctx context.Context) error {
dct.result.CollectionID = result.CollectionID
dct.result.VirtualChannelNames = result.VirtualChannelNames
dct.result.PhysicalChannelNames = result.PhysicalChannelNames
dct.result.CreatedTimestamp = result.CreatedTimestamp
dct.result.CreatedUtcTimestamp = result.CreatedUtcTimestamp
for _, field := range result.Schema.Fields {
if field.FieldID >= 100 { // TODO(dragondriver): use StartOfUserFieldID replacing 100
......@@ -2875,19 +2877,24 @@ func (sct *ShowCollectionsTask) Execute(ctx context.Context) error {
}
sct.result = &milvuspb.ShowCollectionsResponse{
Status: resp.Status,
CollectionNames: make([]string, 0, len(resp.CollectionIDs)),
CollectionIds: make([]int64, 0, len(resp.CollectionIDs)),
Status: resp.Status,
CollectionNames: make([]string, 0, len(resp.CollectionIDs)),
CollectionIds: make([]int64, 0, len(resp.CollectionIDs)),
CreatedTimestamps: make([]uint64, 0, len(resp.CollectionIDs)),
CreatedUtcTimestamps: make([]uint64, 0, len(resp.CollectionIDs)),
}
idMap := make(map[int64]string)
for i, name := range respFromRootCoord.CollectionNames {
idMap[respFromRootCoord.CollectionIds[i]] = name
idMap := make(map[int64]int) // id -> location of respFromRootCoord
for i := range respFromRootCoord.CollectionNames {
idMap[respFromRootCoord.CollectionIds[i]] = i
}
for _, id := range resp.CollectionIDs {
loc := idMap[id]
sct.result.CollectionIds = append(sct.result.CollectionIds, id)
sct.result.CollectionNames = append(sct.result.CollectionNames, idMap[id])
sct.result.CollectionNames = append(sct.result.CollectionNames, respFromRootCoord.CollectionNames[loc])
sct.result.CreatedTimestamps = append(sct.result.CreatedTimestamps, respFromRootCoord.CreatedTimestamps[loc])
sct.result.CreatedUtcTimestamps = append(sct.result.CreatedUtcTimestamps, respFromRootCoord.CreatedUtcTimestamps[loc])
}
} else {
sct.result = respFromRootCoord
......
......@@ -225,8 +225,10 @@ func (mt *metaTable) AddCollection(coll *pb.CollectionInfo, idx []*pb.IndexInfo,
mt.ddLock.Lock()
defer mt.ddLock.Unlock()
if len(coll.PartitionIDs) != len(coll.PartitionNames) {
return 0, fmt.Errorf("PartitionIDs and PartitionNames' length mis-match when creating collection")
if len(coll.PartitionIDs) != len(coll.PartitionNames) ||
len(coll.PartitionIDs) != len(coll.PartitionCreatedTimestamps) ||
len(coll.PartitionNames) != len(coll.PartitionCreatedTimestamps) {
return 0, fmt.Errorf("PartitionIDs, PartitionNames and PartitionCreatedTimestmaps' length mis-match when creating collection")
}
if _, ok := mt.collName2ID[coll.Schema.Name]; ok {
return 0, fmt.Errorf("collection %s exist", coll.Schema.Name)
......@@ -386,14 +388,16 @@ func (mt *metaTable) GetCollectionByName(collectionName string, ts typeutil.Time
return nil, fmt.Errorf("can't find collection: %s, at timestamp = %d", collectionName, ts)
}
func (mt *metaTable) ListCollections(ts typeutil.Timestamp) (map[string]typeutil.UniqueID, error) {
func (mt *metaTable) ListCollections(ts typeutil.Timestamp) (map[string]*pb.CollectionInfo, error) {
mt.ddLock.RLock()
defer mt.ddLock.RUnlock()
colls := make(map[string]typeutil.UniqueID)
colls := make(map[string]*pb.CollectionInfo)
if ts == 0 {
for k, v := range mt.collName2ID {
colls[k] = v
for collName, collID := range mt.collName2ID {
coll := mt.collID2Meta[collID]
colCopy := proto.Clone(&coll)
colls[collName] = colCopy.(*pb.CollectionInfo)
}
return colls, nil
}
......@@ -408,7 +412,7 @@ func (mt *metaTable) ListCollections(ts typeutil.Timestamp) (map[string]typeutil
if err != nil {
log.Debug("unmarshal collection info failed", zap.Error(err))
}
colls[collMeta.Schema.Name] = collMeta.ID
colls[collMeta.Schema.Name] = &collMeta
}
return colls, nil
}
......@@ -437,7 +441,7 @@ func (mt *metaTable) ListCollectionPhysicalChannels() []string {
return plist
}
func (mt *metaTable) AddPartition(collID typeutil.UniqueID, partitionName string, partitionID typeutil.UniqueID, ddOpStr func(ts typeutil.Timestamp) (string, error)) (typeutil.Timestamp, error) {
func (mt *metaTable) AddPartition(collID typeutil.UniqueID, partitionName string, partitionID typeutil.UniqueID, createdTimestamp uint64, ddOpStr func(ts typeutil.Timestamp) (string, error)) (typeutil.Timestamp, error) {
mt.ddLock.Lock()
defer mt.ddLock.Unlock()
coll, ok := mt.collID2Meta[collID]
......@@ -454,6 +458,14 @@ func (mt *metaTable) AddPartition(collID typeutil.UniqueID, partitionName string
return 0, fmt.Errorf("len(coll.PartitionIDs)=%d, len(coll.PartitionNames)=%d", len(coll.PartitionIDs), len(coll.PartitionNames))
}
if len(coll.PartitionIDs) != len(coll.PartitionCreatedTimestamps) {
return 0, fmt.Errorf("len(coll.PartitionIDs)=%d, len(coll.PartitionCreatedTimestamps)=%d", len(coll.PartitionIDs), len(coll.PartitionCreatedTimestamps))
}
if len(coll.PartitionNames) != len(coll.PartitionCreatedTimestamps) {
return 0, fmt.Errorf("len(coll.PartitionNames)=%d, len(coll.PartitionCreatedTimestamps)=%d", len(coll.PartitionNames), len(coll.PartitionCreatedTimestamps))
}
for idx := range coll.PartitionIDs {
if coll.PartitionIDs[idx] == partitionID {
return 0, fmt.Errorf("partition id = %d already exists", partitionID)
......@@ -461,10 +473,11 @@ func (mt *metaTable) AddPartition(collID typeutil.UniqueID, partitionName string
if coll.PartitionNames[idx] == partitionName {
return 0, fmt.Errorf("partition name = %s already exists", partitionName)
}
// no necessary to check created timestamp
}
coll.PartitionIDs = append(coll.PartitionIDs, partitionID)
coll.PartitionNames = append(coll.PartitionNames, partitionName)
coll.PartitionCreatedTimestamps = append(coll.PartitionCreatedTimestamps, createdTimestamp)
mt.collID2Meta[collID] = coll
k1 := fmt.Sprintf("%s/%d", CollectionMetaPrefix, collID)
......@@ -578,6 +591,7 @@ func (mt *metaTable) DeletePartition(collID typeutil.UniqueID, partitionName str
pd := make([]typeutil.UniqueID, 0, len(collMeta.PartitionIDs))
pn := make([]string, 0, len(collMeta.PartitionNames))
pts := make([]uint64, 0, len(collMeta.PartitionCreatedTimestamps))
var partID typeutil.UniqueID
for idx := range collMeta.PartitionIDs {
if collMeta.PartitionNames[idx] == partitionName {
......@@ -586,6 +600,7 @@ func (mt *metaTable) DeletePartition(collID typeutil.UniqueID, partitionName str
} else {
pd = append(pd, collMeta.PartitionIDs[idx])
pn = append(pn, collMeta.PartitionNames[idx])
pts = append(pts, collMeta.PartitionCreatedTimestamps[idx])
}
}
if !exist {
......@@ -593,6 +608,7 @@ func (mt *metaTable) DeletePartition(collID typeutil.UniqueID, partitionName str
}
collMeta.PartitionIDs = pd
collMeta.PartitionNames = pn
collMeta.PartitionCreatedTimestamps = pts
mt.collID2Meta[collID] = collMeta
// update segID2IndexMeta and partID2SegID
......
......@@ -213,9 +213,10 @@ func TestMetaTable(t *testing.T) {
IndexID: indexID,
},
},
CreateTime: 0,
PartitionIDs: []typeutil.UniqueID{partIDDefault},
PartitionNames: []string{Params.DefaultPartitionName},
CreateTime: 0,
PartitionIDs: []typeutil.UniqueID{partIDDefault},
PartitionNames: []string{Params.DefaultPartitionName},
PartitionCreatedTimestamps: []uint64{0},
}
idxInfo := []*pb.IndexInfo{
{
......@@ -262,7 +263,7 @@ func TestMetaTable(t *testing.T) {
})
t.Run("add partition", func(t *testing.T) {
_, err := mt.AddPartition(collID, partName, partID, ddOp)
_, err := mt.AddPartition(collID, partName, partID, ftso(), ddOp)
assert.Nil(t, err)
// check DD operation flag
......@@ -445,6 +446,7 @@ func TestMetaTable(t *testing.T) {
}
collInfo.PartitionIDs = nil
collInfo.PartitionNames = nil
collInfo.PartitionCreatedTimestamps = nil
_, err := mt.AddCollection(collInfo, idxInfo, nil)
assert.NotNil(t, err)
assert.EqualError(t, err, "multi save error")
......@@ -499,24 +501,25 @@ func TestMetaTable(t *testing.T) {
_, err = mt.AddCollection(collInfo, idxInfo, nil)
assert.Nil(t, err)
_, err = mt.AddPartition(2, "no-part", 22, nil)
_, err = mt.AddPartition(2, "no-part", 22, ftso(), nil)
assert.NotNil(t, err)
assert.EqualError(t, err, "can't find collection. id = 2")
coll := mt.collID2Meta[collInfo.ID]
coll.PartitionIDs = make([]int64, Params.MaxPartitionNum)
mt.collID2Meta[coll.ID] = coll
_, err = mt.AddPartition(coll.ID, "no-part", 22, nil)
_, err = mt.AddPartition(coll.ID, "no-part", 22, ftso(), nil)
assert.NotNil(t, err)
assert.EqualError(t, err, fmt.Sprintf("maximum partition's number should be limit to %d", Params.MaxPartitionNum))
coll.PartitionIDs = []int64{partID}
coll.PartitionNames = []string{partName}
coll.PartitionCreatedTimestamps = []uint64{ftso()}
mt.collID2Meta[coll.ID] = coll
mockKV.multiSave = func(kvs map[string]string, addition func(ts typeutil.Timestamp) (string, string, error)) (typeutil.Timestamp, error) {
return 0, fmt.Errorf("multi save error")
}
_, err = mt.AddPartition(coll.ID, "no-part", 22, nil)
_, err = mt.AddPartition(coll.ID, "no-part", 22, ftso(), nil)
assert.NotNil(t, err)
assert.EqualError(t, err, "multi save error")
......@@ -527,12 +530,12 @@ func TestMetaTable(t *testing.T) {
collInfo.PartitionNames = nil
_, err = mt.AddCollection(collInfo, idxInfo, nil)
assert.Nil(t, err)
_, err = mt.AddPartition(coll.ID, partName, partID, nil)
_, err = mt.AddPartition(coll.ID, partName, partID, ftso(), nil)
assert.Nil(t, err)
_, err = mt.AddPartition(coll.ID, partName, 22, nil)
_, err = mt.AddPartition(coll.ID, partName, 22, ftso(), nil)
assert.NotNil(t, err)
assert.EqualError(t, err, fmt.Sprintf("partition name = %s already exists", partName))
_, err = mt.AddPartition(coll.ID, "no-part", partID, nil)
_, err = mt.AddPartition(coll.ID, "no-part", partID, ftso(), nil)
assert.NotNil(t, err)
assert.EqualError(t, err, fmt.Sprintf("partition id = %d already exists", partID))
})
......@@ -570,6 +573,7 @@ func TestMetaTable(t *testing.T) {
collInfo.PartitionIDs = []int64{partID}
collInfo.PartitionNames = []string{partName}
collInfo.PartitionCreatedTimestamps = []uint64{ftso()}
_, err = mt.AddCollection(collInfo, idxInfo, nil)
assert.Nil(t, err)
......@@ -609,6 +613,7 @@ func TestMetaTable(t *testing.T) {
collInfo.PartitionIDs = nil
collInfo.PartitionNames = nil
collInfo.PartitionCreatedTimestamps = nil
_, err = mt.AddCollection(collInfo, idxInfo, nil)
assert.Nil(t, err)
......@@ -634,6 +639,7 @@ func TestMetaTable(t *testing.T) {
collInfo.PartitionIDs = nil
collInfo.PartitionNames = nil
collInfo.PartitionCreatedTimestamps = nil
_, err = mt.AddCollection(collInfo, idxInfo, nil)
assert.Nil(t, err)
......@@ -661,6 +667,7 @@ func TestMetaTable(t *testing.T) {
collInfo.PartitionIDs = nil
collInfo.PartitionNames = nil
collInfo.PartitionCreatedTimestamps = nil
_, err = mt.AddCollection(collInfo, idxInfo, nil)
assert.Nil(t, err)
......@@ -699,6 +706,7 @@ func TestMetaTable(t *testing.T) {
assert.Nil(t, err)
collInfo.PartitionIDs = nil
collInfo.PartitionNames = nil
coll.PartitionCreatedTimestamps = nil
_, err = mt.AddCollection(collInfo, idxInfo, nil)
assert.Nil(t, err)
mockKV.multiSaveAndRemoveWithPrefix = func(saves map[string]string, removals []string, addition func(ts typeutil.Timestamp) (string, string, error)) (typeutil.Timestamp, error) {
......@@ -724,6 +732,7 @@ func TestMetaTable(t *testing.T) {
collInfo.PartitionIDs = nil
collInfo.PartitionNames = nil
collInfo.PartitionCreatedTimestamps = nil
_, err = mt.AddCollection(collInfo, idxInfo, nil)
assert.Nil(t, err)
......@@ -771,6 +780,7 @@ func TestMetaTable(t *testing.T) {
collInfo.PartitionIDs = nil
collInfo.PartitionNames = nil
collInfo.PartitionCreatedTimestamps = nil
_, err = mt.AddCollection(collInfo, idxInfo, nil)
assert.Nil(t, err)
......@@ -841,6 +851,7 @@ func TestMetaTable(t *testing.T) {
collInfo.PartitionIDs = nil
collInfo.PartitionNames = nil
collInfo.PartitionCreatedTimestamps = nil
_, err = mt.AddCollection(collInfo, idxInfo, nil)
assert.Nil(t, err)
......@@ -867,6 +878,7 @@ func TestMetaTable(t *testing.T) {
}
collInfo.PartitionIDs = nil
collInfo.PartitionNames = nil
collInfo.PartitionCreatedTimestamps = nil
_, err = mt.AddCollection(collInfo, idxInfo, nil)
assert.Nil(t, err)
coll := mt.collID2Meta[collInfo.ID]
......@@ -916,6 +928,7 @@ func TestMetaTable(t *testing.T) {
collInfo.PartitionIDs = nil
collInfo.PartitionNames = nil
collInfo.PartitionCreatedTimestamps = nil
_, err = mt.AddCollection(collInfo, idxInfo, nil)
assert.Nil(t, err)
mt.indexID2Meta = make(map[int64]pb.IndexInfo)
......@@ -971,12 +984,14 @@ func TestMetaWithTimestamp(t *testing.T) {
collInfo.PartitionIDs = []int64{partID1}
collInfo.PartitionNames = []string{partName1}
collInfo.PartitionCreatedTimestamps = []uint64{ftso()}
t1, err := mt.AddCollection(collInfo, nil, nil)
assert.Nil(t, err)
collInfo.ID = 2
collInfo.PartitionIDs = []int64{partID2}
collInfo.PartitionNames = []string{partName2}
collInfo.PartitionCreatedTimestamps = []uint64{ftso()}
collInfo.Schema.Name = collName2
t2, err := mt.AddCollection(collInfo, nil, nil)
......@@ -1044,7 +1059,7 @@ func TestMetaWithTimestamp(t *testing.T) {
c2, err = mt.GetCollectionByName(collName2, tsoStart)
assert.NotNil(t, err)
getKeys := func(m map[string]typeutil.UniqueID) []string {
getKeys := func(m map[string]*pb.CollectionInfo) []string {
keys := make([]string, 0, len(m))
for key := range m {
keys = append(keys, key)
......
......@@ -15,6 +15,8 @@ import (
"context"
"fmt"
"github.com/milvus-io/milvus/internal/util/tsoutil"
"github.com/golang/protobuf/proto"
"github.com/milvus-io/milvus/internal/log"
"github.com/milvus-io/milvus/internal/proto/commonpb"
......@@ -130,6 +132,7 @@ func (t *CreateCollectionReqTask) Execute(ctx context.Context) error {
log.Debug("collection name -> id",
zap.String("collection name", t.Req.CollectionName),
zap.Int64("collection_id", collID),
zap.Uint64("collection created ts", collTs),
zap.Int64("default partition id", partID))
vchanNames := make([]string, t.Req.ShardsNum)
......@@ -140,14 +143,15 @@ func (t *CreateCollectionReqTask) Execute(ctx context.Context) error {
}
collInfo := etcdpb.CollectionInfo{
ID: collID,
Schema: &schema,
CreateTime: collTs,
PartitionIDs: []typeutil.UniqueID{partID},
PartitionNames: []string{Params.DefaultPartitionName},
FieldIndexes: make([]*etcdpb.FieldIndexInfo, 0, 16),
VirtualChannelNames: vchanNames,
PhysicalChannelNames: chanNames,
ID: collID,
Schema: &schema,
CreateTime: collTs,
PartitionIDs: []typeutil.UniqueID{partID},
PartitionNames: []string{Params.DefaultPartitionName},
FieldIndexes: make([]*etcdpb.FieldIndexInfo, 0, 16),
VirtualChannelNames: vchanNames,
PhysicalChannelNames: chanNames,
PartitionCreatedTimestamps: []uint64{collTs},
}
idxInfo := make([]*etcdpb.IndexInfo, 0, 16)
......@@ -339,6 +343,11 @@ func (t *DescribeCollectionReqTask) Execute(ctx context.Context) error {
t.Rsp.VirtualChannelNames = collInfo.VirtualChannelNames
t.Rsp.PhysicalChannelNames = collInfo.PhysicalChannelNames
t.Rsp.CreatedTimestamp = collInfo.CreateTime
createdPhysicalTime, _ := tsoutil.ParseHybridTs(collInfo.CreateTime)
t.Rsp.CreatedUtcTimestamp = createdPhysicalTime
return nil
}
......@@ -360,9 +369,12 @@ func (t *ShowCollectionReqTask) Execute(ctx context.Context) error {
if err != nil {
return err
}
for name, id := range coll {
for name, meta := range coll {
t.Rsp.CollectionNames = append(t.Rsp.CollectionNames, name)
t.Rsp.CollectionIds = append(t.Rsp.CollectionIds, id)
t.Rsp.CollectionIds = append(t.Rsp.CollectionIds, meta.ID)
t.Rsp.CreatedTimestamps = append(t.Rsp.CreatedTimestamps, meta.CreateTime)
physical, _ := tsoutil.ParseHybridTs(meta.CreateTime)
t.Rsp.CreatedUtcTimestamps = append(t.Rsp.CreatedUtcTimestamps, physical)
}
return nil
}
......@@ -406,7 +418,8 @@ func (t *CreatePartitionReqTask) Execute(ctx context.Context) error {
return EncodeDdOperation(&ddReq, CreatePartitionDDType)
}
ts, err := t.core.MetaTable.AddPartition(collMeta.ID, t.Req.PartitionName, partID, ddOp)
createdTimestamp := t.Req.Base.Timestamp
ts, err := t.core.MetaTable.AddPartition(collMeta.ID, t.Req.PartitionName, partID, createdTimestamp, ddOp)
if err != nil {
return err
}
......@@ -558,6 +571,12 @@ func (t *ShowPartitionReqTask) Execute(ctx context.Context) error {
}
t.Rsp.PartitionIDs = coll.PartitionIDs
t.Rsp.PartitionNames = coll.PartitionNames
t.Rsp.CreatedTimestamps = coll.PartitionCreatedTimestamps
t.Rsp.CreatedUtcTimestamps = make([]uint64, 0, len(coll.PartitionCreatedTimestamps))
for _, ts := range coll.PartitionCreatedTimestamps {
physical, _ := tsoutil.ParseHybridTs(ts)
t.Rsp.CreatedUtcTimestamps = append(t.Rsp.CreatedUtcTimestamps, physical)
}
return nil
}
......
......@@ -36,6 +36,13 @@ func ParseTS(ts uint64) (time.Time, uint64) {
return physicalTime, logical
}
// ParseHybridTs parses the ts to (physical, logical), physical part is of utc-timestamp format.
func ParseHybridTs(ts uint64) (uint64, uint64) {
logical := ts & logicalBitsMask
physical := ts >> logicalBits
return physical, logical
}
// Mod24H parses the ts to millisecond in one day
func Mod24H(ts uint64) uint64 {
logical := ts & logicalBitsMask
......
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
// or implied. See the License for the specific language governing permissions and limitations under the License.
package tsoutil
import (
"testing"
"time"
"github.com/milvus-io/milvus/internal/log"
"go.uber.org/zap"
)
func TestParseHybridTs(t *testing.T) {
var ts uint64 = 426152581543231492
physical, logical := ParseHybridTs(ts)
physicalTime := time.Unix(int64(physical/1000), int64(physical)%1000*time.Millisecond.Nanoseconds())
log.Debug("TestParseHybridTs",
zap.Uint64("physical", physical),
zap.Uint64("logical", logical),
zap.Any("physical time", physicalTime))
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册