rename createindex (#27903)

Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
This commit is contained in:
Enwei Jiao 2023-10-27 10:12:14 +08:00 committed by GitHub
parent 403c6680cc
commit 4a33391b8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 697 additions and 427 deletions

View File

@ -29,7 +29,7 @@
using namespace milvus; using namespace milvus;
CStatus CStatus
CreateIndex(enum CDataType dtype, CreateIndexV0(enum CDataType dtype,
const char* serialized_type_params, const char* serialized_type_params,
const char* serialized_index_params, const char* serialized_index_params,
CIndex* res_index) { CIndex* res_index) {
@ -73,7 +73,7 @@ CreateIndex(enum CDataType dtype,
} }
CStatus CStatus
CreateIndexV2(CIndex* res_index, CBuildIndexInfo c_build_index_info) { CreateIndex(CIndex* res_index, CBuildIndexInfo c_build_index_info) {
try { try {
auto build_index_info = (BuildIndexInfo*)c_build_index_info; auto build_index_info = (BuildIndexInfo*)c_build_index_info;
auto field_type = build_index_info->field_type; auto field_type = build_index_info->field_type;

View File

@ -21,11 +21,14 @@ extern "C" {
#include "indexbuilder/type_c.h" #include "indexbuilder/type_c.h"
CStatus CStatus
CreateIndex(enum CDataType dtype, CreateIndexV0(enum CDataType dtype,
const char* serialized_type_params, const char* serialized_type_params,
const char* serialized_index_params, const char* serialized_index_params,
CIndex* res_index); CIndex* res_index);
CStatus
CreateIndex(CIndex* res_index, CBuildIndexInfo c_build_index_info);
CStatus CStatus
DeleteIndex(CIndex index); DeleteIndex(CIndex index);
@ -90,9 +93,6 @@ CStatus
AppendIndexEngineVersionToBuildInfo(CBuildIndexInfo c_load_index_info, AppendIndexEngineVersionToBuildInfo(CBuildIndexInfo c_load_index_info,
int32_t c_index_engine_version); int32_t c_index_engine_version);
CStatus
CreateIndexV2(CIndex* res_index, CBuildIndexInfo c_build_index_info);
CStatus CStatus
SerializeIndexAndUpLoad(CIndex index, CBinarySet* c_binary_set); SerializeIndexAndUpLoad(CIndex index, CBinarySet* c_binary_set);

File diff suppressed because it is too large Load Diff

View File

@ -76,6 +76,9 @@ extern KeyValuePairDefaultTypeInternal _KeyValuePair_default_instance_;
class MsgBase; class MsgBase;
struct MsgBaseDefaultTypeInternal; struct MsgBaseDefaultTypeInternal;
extern MsgBaseDefaultTypeInternal _MsgBase_default_instance_; extern MsgBaseDefaultTypeInternal _MsgBase_default_instance_;
class MsgBase_PropertiesEntry_DoNotUse;
struct MsgBase_PropertiesEntry_DoNotUseDefaultTypeInternal;
extern MsgBase_PropertiesEntry_DoNotUseDefaultTypeInternal _MsgBase_PropertiesEntry_DoNotUse_default_instance_;
class MsgHeader; class MsgHeader;
struct MsgHeaderDefaultTypeInternal; struct MsgHeaderDefaultTypeInternal;
extern MsgHeaderDefaultTypeInternal _MsgHeader_default_instance_; extern MsgHeaderDefaultTypeInternal _MsgHeader_default_instance_;
@ -88,9 +91,9 @@ extern PlaceholderValueDefaultTypeInternal _PlaceholderValue_default_instance_;
class PrivilegeExt; class PrivilegeExt;
struct PrivilegeExtDefaultTypeInternal; struct PrivilegeExtDefaultTypeInternal;
extern PrivilegeExtDefaultTypeInternal _PrivilegeExt_default_instance_; extern PrivilegeExtDefaultTypeInternal _PrivilegeExt_default_instance_;
class ReplicateEntity; class ReplicateInfo;
struct ReplicateEntityDefaultTypeInternal; struct ReplicateInfoDefaultTypeInternal;
extern ReplicateEntityDefaultTypeInternal _ReplicateEntity_default_instance_; extern ReplicateInfoDefaultTypeInternal _ReplicateInfo_default_instance_;
class SegmentStats; class SegmentStats;
struct SegmentStatsDefaultTypeInternal; struct SegmentStatsDefaultTypeInternal;
extern SegmentStatsDefaultTypeInternal _SegmentStats_default_instance_; extern SegmentStatsDefaultTypeInternal _SegmentStats_default_instance_;
@ -115,11 +118,12 @@ template<> ::milvus::proto::common::DMLMsgHeader* Arena::CreateMaybeMessage<::mi
template<> ::milvus::proto::common::KeyDataPair* Arena::CreateMaybeMessage<::milvus::proto::common::KeyDataPair>(Arena*); template<> ::milvus::proto::common::KeyDataPair* Arena::CreateMaybeMessage<::milvus::proto::common::KeyDataPair>(Arena*);
template<> ::milvus::proto::common::KeyValuePair* Arena::CreateMaybeMessage<::milvus::proto::common::KeyValuePair>(Arena*); template<> ::milvus::proto::common::KeyValuePair* Arena::CreateMaybeMessage<::milvus::proto::common::KeyValuePair>(Arena*);
template<> ::milvus::proto::common::MsgBase* Arena::CreateMaybeMessage<::milvus::proto::common::MsgBase>(Arena*); template<> ::milvus::proto::common::MsgBase* Arena::CreateMaybeMessage<::milvus::proto::common::MsgBase>(Arena*);
template<> ::milvus::proto::common::MsgBase_PropertiesEntry_DoNotUse* Arena::CreateMaybeMessage<::milvus::proto::common::MsgBase_PropertiesEntry_DoNotUse>(Arena*);
template<> ::milvus::proto::common::MsgHeader* Arena::CreateMaybeMessage<::milvus::proto::common::MsgHeader>(Arena*); template<> ::milvus::proto::common::MsgHeader* Arena::CreateMaybeMessage<::milvus::proto::common::MsgHeader>(Arena*);
template<> ::milvus::proto::common::PlaceholderGroup* Arena::CreateMaybeMessage<::milvus::proto::common::PlaceholderGroup>(Arena*); template<> ::milvus::proto::common::PlaceholderGroup* Arena::CreateMaybeMessage<::milvus::proto::common::PlaceholderGroup>(Arena*);
template<> ::milvus::proto::common::PlaceholderValue* Arena::CreateMaybeMessage<::milvus::proto::common::PlaceholderValue>(Arena*); template<> ::milvus::proto::common::PlaceholderValue* Arena::CreateMaybeMessage<::milvus::proto::common::PlaceholderValue>(Arena*);
template<> ::milvus::proto::common::PrivilegeExt* Arena::CreateMaybeMessage<::milvus::proto::common::PrivilegeExt>(Arena*); template<> ::milvus::proto::common::PrivilegeExt* Arena::CreateMaybeMessage<::milvus::proto::common::PrivilegeExt>(Arena*);
template<> ::milvus::proto::common::ReplicateEntity* Arena::CreateMaybeMessage<::milvus::proto::common::ReplicateEntity>(Arena*); template<> ::milvus::proto::common::ReplicateInfo* Arena::CreateMaybeMessage<::milvus::proto::common::ReplicateInfo>(Arena*);
template<> ::milvus::proto::common::SegmentStats* Arena::CreateMaybeMessage<::milvus::proto::common::SegmentStats>(Arena*); template<> ::milvus::proto::common::SegmentStats* Arena::CreateMaybeMessage<::milvus::proto::common::SegmentStats>(Arena*);
template<> ::milvus::proto::common::ServerInfo* Arena::CreateMaybeMessage<::milvus::proto::common::ServerInfo>(Arena*); template<> ::milvus::proto::common::ServerInfo* Arena::CreateMaybeMessage<::milvus::proto::common::ServerInfo>(Arena*);
template<> ::milvus::proto::common::ServerInfo_ReservedEntry_DoNotUse* Arena::CreateMaybeMessage<::milvus::proto::common::ServerInfo_ReservedEntry_DoNotUse>(Arena*); template<> ::milvus::proto::common::ServerInfo_ReservedEntry_DoNotUse* Arena::CreateMaybeMessage<::milvus::proto::common::ServerInfo_ReservedEntry_DoNotUse>(Arena*);
@ -1854,6 +1858,34 @@ class Address final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class MsgBase_PropertiesEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry<MsgBase_PropertiesEntry_DoNotUse,
std::string, std::string,
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING> {
public:
typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry<MsgBase_PropertiesEntry_DoNotUse,
std::string, std::string,
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING> SuperType;
MsgBase_PropertiesEntry_DoNotUse();
explicit PROTOBUF_CONSTEXPR MsgBase_PropertiesEntry_DoNotUse(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
explicit MsgBase_PropertiesEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena);
void MergeFrom(const MsgBase_PropertiesEntry_DoNotUse& other);
static const MsgBase_PropertiesEntry_DoNotUse* internal_default_instance() { return reinterpret_cast<const MsgBase_PropertiesEntry_DoNotUse*>(&_MsgBase_PropertiesEntry_DoNotUse_default_instance_); }
static bool ValidateKey(std::string* s) {
return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast<int>(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "milvus.proto.common.MsgBase.PropertiesEntry.key");
}
static bool ValidateValue(std::string* s) {
return ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(s->data(), static_cast<int>(s->size()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "milvus.proto.common.MsgBase.PropertiesEntry.value");
}
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
friend struct ::TableStruct_common_2eproto;
};
// -------------------------------------------------------------------
class MsgBase final : class MsgBase final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.proto.common.MsgBase) */ { public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.proto.common.MsgBase) */ {
public: public:
@ -1902,7 +1934,7 @@ class MsgBase final :
&_MsgBase_default_instance_); &_MsgBase_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
7; 8;
friend void swap(MsgBase& a, MsgBase& b) { friend void swap(MsgBase& a, MsgBase& b) {
a.Swap(&b); a.Swap(&b);
@ -1963,6 +1995,8 @@ class MsgBase final :
protected: protected:
explicit MsgBase(::PROTOBUF_NAMESPACE_ID::Arena* arena, explicit MsgBase(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false); bool is_message_owned = false);
private:
static void ArenaDtor(void* object);
public: public:
static const ClassData _class_data_; static const ClassData _class_data_;
@ -1972,33 +2006,52 @@ class MsgBase final :
// nested types ---------------------------------------------------- // nested types ----------------------------------------------------
// accessors ------------------------------------------------------- // accessors -------------------------------------------------------
enum : int { enum : int {
kReplicateFieldNumber = 6, kPropertiesFieldNumber = 6,
kReplicateInfoFieldNumber = 7,
kMsgIDFieldNumber = 2, kMsgIDFieldNumber = 2,
kTimestampFieldNumber = 3, kTimestampFieldNumber = 3,
kSourceIDFieldNumber = 4, kSourceIDFieldNumber = 4,
kTargetIDFieldNumber = 5, kTargetIDFieldNumber = 5,
kMsgTypeFieldNumber = 1, kMsgTypeFieldNumber = 1,
}; };
// .milvus.proto.common.ReplicateEntity replicate = 6; // map<string, string> properties = 6;
bool has_replicate() const; int properties_size() const;
private: private:
bool _internal_has_replicate() const; int _internal_properties_size() const;
public: public:
void clear_replicate(); void clear_properties();
const ::milvus::proto::common::ReplicateEntity& replicate() const;
PROTOBUF_NODISCARD ::milvus::proto::common::ReplicateEntity* release_replicate();
::milvus::proto::common::ReplicateEntity* mutable_replicate();
void set_allocated_replicate(::milvus::proto::common::ReplicateEntity* replicate);
private: private:
const ::milvus::proto::common::ReplicateEntity& _internal_replicate() const; const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >&
::milvus::proto::common::ReplicateEntity* _internal_mutable_replicate(); _internal_properties() const;
::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >*
_internal_mutable_properties();
public: public:
void unsafe_arena_set_allocated_replicate( const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >&
::milvus::proto::common::ReplicateEntity* replicate); properties() const;
::milvus::proto::common::ReplicateEntity* unsafe_arena_release_replicate(); ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >*
mutable_properties();
// .milvus.proto.common.ReplicateInfo replicateInfo = 7;
bool has_replicateinfo() const;
private:
bool _internal_has_replicateinfo() const;
public:
void clear_replicateinfo();
const ::milvus::proto::common::ReplicateInfo& replicateinfo() const;
PROTOBUF_NODISCARD ::milvus::proto::common::ReplicateInfo* release_replicateinfo();
::milvus::proto::common::ReplicateInfo* mutable_replicateinfo();
void set_allocated_replicateinfo(::milvus::proto::common::ReplicateInfo* replicateinfo);
private:
const ::milvus::proto::common::ReplicateInfo& _internal_replicateinfo() const;
::milvus::proto::common::ReplicateInfo* _internal_mutable_replicateinfo();
public:
void unsafe_arena_set_allocated_replicateinfo(
::milvus::proto::common::ReplicateInfo* replicateinfo);
::milvus::proto::common::ReplicateInfo* unsafe_arena_release_replicateinfo();
// int64 msgID = 2; // int64 msgID = 2;
void clear_msgid(); void clear_msgid();
@ -2053,7 +2106,12 @@ class MsgBase final :
typedef void InternalArenaConstructable_; typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_; typedef void DestructorSkippable_;
struct Impl_ { struct Impl_ {
::milvus::proto::common::ReplicateEntity* replicate_; ::PROTOBUF_NAMESPACE_ID::internal::MapField<
MsgBase_PropertiesEntry_DoNotUse,
std::string, std::string,
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING> properties_;
::milvus::proto::common::ReplicateInfo* replicateinfo_;
int64_t msgid_; int64_t msgid_;
uint64_t timestamp_; uint64_t timestamp_;
int64_t sourceid_; int64_t sourceid_;
@ -2066,24 +2124,24 @@ class MsgBase final :
}; };
// ------------------------------------------------------------------- // -------------------------------------------------------------------
class ReplicateEntity final : class ReplicateInfo final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.proto.common.ReplicateEntity) */ { public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:milvus.proto.common.ReplicateInfo) */ {
public: public:
inline ReplicateEntity() : ReplicateEntity(nullptr) {} inline ReplicateInfo() : ReplicateInfo(nullptr) {}
~ReplicateEntity() override; ~ReplicateInfo() override;
explicit PROTOBUF_CONSTEXPR ReplicateEntity(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); explicit PROTOBUF_CONSTEXPR ReplicateInfo(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
ReplicateEntity(const ReplicateEntity& from); ReplicateInfo(const ReplicateInfo& from);
ReplicateEntity(ReplicateEntity&& from) noexcept ReplicateInfo(ReplicateInfo&& from) noexcept
: ReplicateEntity() { : ReplicateInfo() {
*this = ::std::move(from); *this = ::std::move(from);
} }
inline ReplicateEntity& operator=(const ReplicateEntity& from) { inline ReplicateInfo& operator=(const ReplicateInfo& from) {
CopyFrom(from); CopyFrom(from);
return *this; return *this;
} }
inline ReplicateEntity& operator=(ReplicateEntity&& from) noexcept { inline ReplicateInfo& operator=(ReplicateInfo&& from) noexcept {
if (this == &from) return *this; if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena() if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
@ -2106,20 +2164,20 @@ class ReplicateEntity final :
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection; return default_instance().GetMetadata().reflection;
} }
static const ReplicateEntity& default_instance() { static const ReplicateInfo& default_instance() {
return *internal_default_instance(); return *internal_default_instance();
} }
static inline const ReplicateEntity* internal_default_instance() { static inline const ReplicateInfo* internal_default_instance() {
return reinterpret_cast<const ReplicateEntity*>( return reinterpret_cast<const ReplicateInfo*>(
&_ReplicateEntity_default_instance_); &_ReplicateInfo_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
8; 9;
friend void swap(ReplicateEntity& a, ReplicateEntity& b) { friend void swap(ReplicateInfo& a, ReplicateInfo& b) {
a.Swap(&b); a.Swap(&b);
} }
inline void Swap(ReplicateEntity* other) { inline void Swap(ReplicateInfo* other) {
if (other == this) return; if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr && if (GetOwningArena() != nullptr &&
@ -2132,7 +2190,7 @@ class ReplicateEntity final :
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
} }
} }
void UnsafeArenaSwap(ReplicateEntity* other) { void UnsafeArenaSwap(ReplicateInfo* other) {
if (other == this) return; if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other); InternalSwap(other);
@ -2140,14 +2198,14 @@ class ReplicateEntity final :
// implements Message ---------------------------------------------- // implements Message ----------------------------------------------
ReplicateEntity* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { ReplicateInfo* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<ReplicateEntity>(arena); return CreateMaybeMessage<ReplicateInfo>(arena);
} }
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
void CopyFrom(const ReplicateEntity& from); void CopyFrom(const ReplicateInfo& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
void MergeFrom( const ReplicateEntity& from) { void MergeFrom( const ReplicateInfo& from) {
ReplicateEntity::MergeImpl(*this, from); ReplicateInfo::MergeImpl(*this, from);
} }
private: private:
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
@ -2165,15 +2223,15 @@ class ReplicateEntity final :
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedDtor(); void SharedDtor();
void SetCachedSize(int size) const final; void SetCachedSize(int size) const final;
void InternalSwap(ReplicateEntity* other); void InternalSwap(ReplicateInfo* other);
private: private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "milvus.proto.common.ReplicateEntity"; return "milvus.proto.common.ReplicateInfo";
} }
protected: protected:
explicit ReplicateEntity(::PROTOBUF_NAMESPACE_ID::Arena* arena, explicit ReplicateInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false); bool is_message_owned = false);
public: public:
@ -2187,8 +2245,18 @@ class ReplicateEntity final :
// accessors ------------------------------------------------------- // accessors -------------------------------------------------------
enum : int { enum : int {
kMsgTimestampFieldNumber = 2,
kIsReplicateFieldNumber = 1, kIsReplicateFieldNumber = 1,
}; };
// uint64 msgTimestamp = 2;
void clear_msgtimestamp();
uint64_t msgtimestamp() const;
void set_msgtimestamp(uint64_t value);
private:
uint64_t _internal_msgtimestamp() const;
void _internal_set_msgtimestamp(uint64_t value);
public:
// bool isReplicate = 1; // bool isReplicate = 1;
void clear_isreplicate(); void clear_isreplicate();
bool isreplicate() const; bool isreplicate() const;
@ -2198,7 +2266,7 @@ class ReplicateEntity final :
void _internal_set_isreplicate(bool value); void _internal_set_isreplicate(bool value);
public: public:
// @@protoc_insertion_point(class_scope:milvus.proto.common.ReplicateEntity) // @@protoc_insertion_point(class_scope:milvus.proto.common.ReplicateInfo)
private: private:
class _Internal; class _Internal;
@ -2206,6 +2274,7 @@ class ReplicateEntity final :
typedef void InternalArenaConstructable_; typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_; typedef void DestructorSkippable_;
struct Impl_ { struct Impl_ {
uint64_t msgtimestamp_;
bool isreplicate_; bool isreplicate_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
}; };
@ -2262,7 +2331,7 @@ class MsgHeader final :
&_MsgHeader_default_instance_); &_MsgHeader_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
9; 10;
friend void swap(MsgHeader& a, MsgHeader& b) { friend void swap(MsgHeader& a, MsgHeader& b) {
a.Swap(&b); a.Swap(&b);
@ -2419,7 +2488,7 @@ class DMLMsgHeader final :
&_DMLMsgHeader_default_instance_); &_DMLMsgHeader_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
10; 11;
friend void swap(DMLMsgHeader& a, DMLMsgHeader& b) { friend void swap(DMLMsgHeader& a, DMLMsgHeader& b) {
a.Swap(&b); a.Swap(&b);
@ -2592,7 +2661,7 @@ class PrivilegeExt final :
&_PrivilegeExt_default_instance_); &_PrivilegeExt_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
11; 12;
friend void swap(PrivilegeExt& a, PrivilegeExt& b) { friend void swap(PrivilegeExt& a, PrivilegeExt& b) {
a.Swap(&b); a.Swap(&b);
@ -2773,7 +2842,7 @@ class SegmentStats final :
&_SegmentStats_default_instance_); &_SegmentStats_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
12; 13;
friend void swap(SegmentStats& a, SegmentStats& b) { friend void swap(SegmentStats& a, SegmentStats& b) {
a.Swap(&b); a.Swap(&b);
@ -2960,7 +3029,7 @@ class ClientInfo final :
&_ClientInfo_default_instance_); &_ClientInfo_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
14; 15;
friend void swap(ClientInfo& a, ClientInfo& b) { friend void swap(ClientInfo& a, ClientInfo& b) {
a.Swap(&b); a.Swap(&b);
@ -3231,7 +3300,7 @@ class ServerInfo final :
&_ServerInfo_default_instance_); &_ServerInfo_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
16; 17;
friend void swap(ServerInfo& a, ServerInfo& b) { friend void swap(ServerInfo& a, ServerInfo& b) {
a.Swap(&b); a.Swap(&b);
@ -4060,6 +4129,8 @@ inline void Address::set_port(int64_t value) {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// -------------------------------------------------------------------
// MsgBase // MsgBase
// .milvus.proto.common.MsgType msg_type = 1; // .milvus.proto.common.MsgType msg_type = 1;
@ -4162,45 +4233,74 @@ inline void MsgBase::set_targetid(int64_t value) {
// @@protoc_insertion_point(field_set:milvus.proto.common.MsgBase.targetID) // @@protoc_insertion_point(field_set:milvus.proto.common.MsgBase.targetID)
} }
// .milvus.proto.common.ReplicateEntity replicate = 6; // map<string, string> properties = 6;
inline bool MsgBase::_internal_has_replicate() const { inline int MsgBase::_internal_properties_size() const {
return this != internal_default_instance() && _impl_.replicate_ != nullptr; return _impl_.properties_.size();
} }
inline bool MsgBase::has_replicate() const { inline int MsgBase::properties_size() const {
return _internal_has_replicate(); return _internal_properties_size();
} }
inline void MsgBase::clear_replicate() { inline void MsgBase::clear_properties() {
if (GetArenaForAllocation() == nullptr && _impl_.replicate_ != nullptr) { _impl_.properties_.Clear();
delete _impl_.replicate_; }
inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >&
MsgBase::_internal_properties() const {
return _impl_.properties_.GetMap();
}
inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >&
MsgBase::properties() const {
// @@protoc_insertion_point(field_map:milvus.proto.common.MsgBase.properties)
return _internal_properties();
}
inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >*
MsgBase::_internal_mutable_properties() {
return _impl_.properties_.MutableMap();
}
inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >*
MsgBase::mutable_properties() {
// @@protoc_insertion_point(field_mutable_map:milvus.proto.common.MsgBase.properties)
return _internal_mutable_properties();
}
// .milvus.proto.common.ReplicateInfo replicateInfo = 7;
inline bool MsgBase::_internal_has_replicateinfo() const {
return this != internal_default_instance() && _impl_.replicateinfo_ != nullptr;
}
inline bool MsgBase::has_replicateinfo() const {
return _internal_has_replicateinfo();
}
inline void MsgBase::clear_replicateinfo() {
if (GetArenaForAllocation() == nullptr && _impl_.replicateinfo_ != nullptr) {
delete _impl_.replicateinfo_;
} }
_impl_.replicate_ = nullptr; _impl_.replicateinfo_ = nullptr;
} }
inline const ::milvus::proto::common::ReplicateEntity& MsgBase::_internal_replicate() const { inline const ::milvus::proto::common::ReplicateInfo& MsgBase::_internal_replicateinfo() const {
const ::milvus::proto::common::ReplicateEntity* p = _impl_.replicate_; const ::milvus::proto::common::ReplicateInfo* p = _impl_.replicateinfo_;
return p != nullptr ? *p : reinterpret_cast<const ::milvus::proto::common::ReplicateEntity&>( return p != nullptr ? *p : reinterpret_cast<const ::milvus::proto::common::ReplicateInfo&>(
::milvus::proto::common::_ReplicateEntity_default_instance_); ::milvus::proto::common::_ReplicateInfo_default_instance_);
} }
inline const ::milvus::proto::common::ReplicateEntity& MsgBase::replicate() const { inline const ::milvus::proto::common::ReplicateInfo& MsgBase::replicateinfo() const {
// @@protoc_insertion_point(field_get:milvus.proto.common.MsgBase.replicate) // @@protoc_insertion_point(field_get:milvus.proto.common.MsgBase.replicateInfo)
return _internal_replicate(); return _internal_replicateinfo();
} }
inline void MsgBase::unsafe_arena_set_allocated_replicate( inline void MsgBase::unsafe_arena_set_allocated_replicateinfo(
::milvus::proto::common::ReplicateEntity* replicate) { ::milvus::proto::common::ReplicateInfo* replicateinfo) {
if (GetArenaForAllocation() == nullptr) { if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.replicate_); delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.replicateinfo_);
} }
_impl_.replicate_ = replicate; _impl_.replicateinfo_ = replicateinfo;
if (replicate) { if (replicateinfo) {
} else { } else {
} }
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:milvus.proto.common.MsgBase.replicate) // @@protoc_insertion_point(field_unsafe_arena_set_allocated:milvus.proto.common.MsgBase.replicateInfo)
} }
inline ::milvus::proto::common::ReplicateEntity* MsgBase::release_replicate() { inline ::milvus::proto::common::ReplicateInfo* MsgBase::release_replicateinfo() {
::milvus::proto::common::ReplicateEntity* temp = _impl_.replicate_; ::milvus::proto::common::ReplicateInfo* temp = _impl_.replicateinfo_;
_impl_.replicate_ = nullptr; _impl_.replicateinfo_ = nullptr;
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
@ -4212,68 +4312,88 @@ inline ::milvus::proto::common::ReplicateEntity* MsgBase::release_replicate() {
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return temp; return temp;
} }
inline ::milvus::proto::common::ReplicateEntity* MsgBase::unsafe_arena_release_replicate() { inline ::milvus::proto::common::ReplicateInfo* MsgBase::unsafe_arena_release_replicateinfo() {
// @@protoc_insertion_point(field_release:milvus.proto.common.MsgBase.replicate) // @@protoc_insertion_point(field_release:milvus.proto.common.MsgBase.replicateInfo)
::milvus::proto::common::ReplicateEntity* temp = _impl_.replicate_; ::milvus::proto::common::ReplicateInfo* temp = _impl_.replicateinfo_;
_impl_.replicate_ = nullptr; _impl_.replicateinfo_ = nullptr;
return temp; return temp;
} }
inline ::milvus::proto::common::ReplicateEntity* MsgBase::_internal_mutable_replicate() { inline ::milvus::proto::common::ReplicateInfo* MsgBase::_internal_mutable_replicateinfo() {
if (_impl_.replicate_ == nullptr) { if (_impl_.replicateinfo_ == nullptr) {
auto* p = CreateMaybeMessage<::milvus::proto::common::ReplicateEntity>(GetArenaForAllocation()); auto* p = CreateMaybeMessage<::milvus::proto::common::ReplicateInfo>(GetArenaForAllocation());
_impl_.replicate_ = p; _impl_.replicateinfo_ = p;
} }
return _impl_.replicate_; return _impl_.replicateinfo_;
} }
inline ::milvus::proto::common::ReplicateEntity* MsgBase::mutable_replicate() { inline ::milvus::proto::common::ReplicateInfo* MsgBase::mutable_replicateinfo() {
::milvus::proto::common::ReplicateEntity* _msg = _internal_mutable_replicate(); ::milvus::proto::common::ReplicateInfo* _msg = _internal_mutable_replicateinfo();
// @@protoc_insertion_point(field_mutable:milvus.proto.common.MsgBase.replicate) // @@protoc_insertion_point(field_mutable:milvus.proto.common.MsgBase.replicateInfo)
return _msg; return _msg;
} }
inline void MsgBase::set_allocated_replicate(::milvus::proto::common::ReplicateEntity* replicate) { inline void MsgBase::set_allocated_replicateinfo(::milvus::proto::common::ReplicateInfo* replicateinfo) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
if (message_arena == nullptr) { if (message_arena == nullptr) {
delete _impl_.replicate_; delete _impl_.replicateinfo_;
} }
if (replicate) { if (replicateinfo) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(replicate); ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(replicateinfo);
if (message_arena != submessage_arena) { if (message_arena != submessage_arena) {
replicate = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( replicateinfo = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, replicate, submessage_arena); message_arena, replicateinfo, submessage_arena);
} }
} else { } else {
} }
_impl_.replicate_ = replicate; _impl_.replicateinfo_ = replicateinfo;
// @@protoc_insertion_point(field_set_allocated:milvus.proto.common.MsgBase.replicate) // @@protoc_insertion_point(field_set_allocated:milvus.proto.common.MsgBase.replicateInfo)
} }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// ReplicateEntity // ReplicateInfo
// bool isReplicate = 1; // bool isReplicate = 1;
inline void ReplicateEntity::clear_isreplicate() { inline void ReplicateInfo::clear_isreplicate() {
_impl_.isreplicate_ = false; _impl_.isreplicate_ = false;
} }
inline bool ReplicateEntity::_internal_isreplicate() const { inline bool ReplicateInfo::_internal_isreplicate() const {
return _impl_.isreplicate_; return _impl_.isreplicate_;
} }
inline bool ReplicateEntity::isreplicate() const { inline bool ReplicateInfo::isreplicate() const {
// @@protoc_insertion_point(field_get:milvus.proto.common.ReplicateEntity.isReplicate) // @@protoc_insertion_point(field_get:milvus.proto.common.ReplicateInfo.isReplicate)
return _internal_isreplicate(); return _internal_isreplicate();
} }
inline void ReplicateEntity::_internal_set_isreplicate(bool value) { inline void ReplicateInfo::_internal_set_isreplicate(bool value) {
_impl_.isreplicate_ = value; _impl_.isreplicate_ = value;
} }
inline void ReplicateEntity::set_isreplicate(bool value) { inline void ReplicateInfo::set_isreplicate(bool value) {
_internal_set_isreplicate(value); _internal_set_isreplicate(value);
// @@protoc_insertion_point(field_set:milvus.proto.common.ReplicateEntity.isReplicate) // @@protoc_insertion_point(field_set:milvus.proto.common.ReplicateInfo.isReplicate)
}
// uint64 msgTimestamp = 2;
inline void ReplicateInfo::clear_msgtimestamp() {
_impl_.msgtimestamp_ = uint64_t{0u};
}
inline uint64_t ReplicateInfo::_internal_msgtimestamp() const {
return _impl_.msgtimestamp_;
}
inline uint64_t ReplicateInfo::msgtimestamp() const {
// @@protoc_insertion_point(field_get:milvus.proto.common.ReplicateInfo.msgTimestamp)
return _internal_msgtimestamp();
}
inline void ReplicateInfo::_internal_set_msgtimestamp(uint64_t value) {
_impl_.msgtimestamp_ = value;
}
inline void ReplicateInfo::set_msgtimestamp(uint64_t value) {
_internal_set_msgtimestamp(value);
// @@protoc_insertion_point(field_set:milvus.proto.common.ReplicateInfo.msgTimestamp)
} }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -5247,6 +5367,8 @@ ServerInfo::mutable_reserved() {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope) // @@protoc_insertion_point(namespace_scope)

View File

@ -29,8 +29,7 @@ TEST(FloatVecIndex, All) {
std::tie(type_params, index_params) = std::tie(type_params, index_params) =
generate_params(index_type, metric_type); generate_params(index_type, metric_type);
std::string type_params_str, index_params_str; std::string type_params_str, index_params_str;
bool ok; bool ok = google::protobuf::TextFormat::PrintToString(type_params,
ok = google::protobuf::TextFormat::PrintToString(type_params,
&type_params_str); &type_params_str);
assert(ok); assert(ok);
ok = google::protobuf::TextFormat::PrintToString(index_params, ok = google::protobuf::TextFormat::PrintToString(index_params,
@ -46,7 +45,7 @@ TEST(FloatVecIndex, All) {
CIndex copy_index; CIndex copy_index;
{ {
status = CreateIndex( status = CreateIndexV0(
dtype, type_params_str.c_str(), index_params_str.c_str(), &index); dtype, type_params_str.c_str(), index_params_str.c_str(), &index);
ASSERT_EQ(milvus::Success, status.error_code); ASSERT_EQ(milvus::Success, status.error_code);
} }
@ -59,7 +58,7 @@ TEST(FloatVecIndex, All) {
ASSERT_EQ(milvus::Success, status.error_code); ASSERT_EQ(milvus::Success, status.error_code);
} }
{ {
status = CreateIndex(dtype, status = CreateIndexV0(dtype,
type_params_str.c_str(), type_params_str.c_str(),
index_params_str.c_str(), index_params_str.c_str(),
&copy_index); &copy_index);
@ -105,7 +104,7 @@ TEST(BinaryVecIndex, All) {
CIndex copy_index; CIndex copy_index;
{ {
status = CreateIndex( status = CreateIndexV0(
dtype, type_params_str.c_str(), index_params_str.c_str(), &index); dtype, type_params_str.c_str(), index_params_str.c_str(), &index);
ASSERT_EQ(milvus::Success, status.error_code); ASSERT_EQ(milvus::Success, status.error_code);
} }
@ -118,7 +117,7 @@ TEST(BinaryVecIndex, All) {
ASSERT_EQ(milvus::Success, status.error_code); ASSERT_EQ(milvus::Success, status.error_code);
} }
{ {
status = CreateIndex(dtype, status = CreateIndexV0(dtype,
type_params_str.c_str(), type_params_str.c_str(),
index_params_str.c_str(), index_params_str.c_str(),
&copy_index); &copy_index);
@ -162,7 +161,7 @@ TEST(CBoolIndexTest, All) {
CIndex copy_index; CIndex copy_index;
{ {
status = CreateIndex(dtype, status = CreateIndexV0(dtype,
type_params_str.c_str(), type_params_str.c_str(),
index_params_str.c_str(), index_params_str.c_str(),
&index); &index);
@ -178,7 +177,7 @@ TEST(CBoolIndexTest, All) {
ASSERT_EQ(milvus::Success, status.error_code); ASSERT_EQ(milvus::Success, status.error_code);
} }
{ {
status = CreateIndex(dtype, status = CreateIndexV0(dtype,
type_params_str.c_str(), type_params_str.c_str(),
index_params_str.c_str(), index_params_str.c_str(),
&copy_index); &copy_index);
@ -199,7 +198,7 @@ TEST(CBoolIndexTest, All) {
{ DeleteBinarySet(binary_set); } { DeleteBinarySet(binary_set); }
} }
delete[](char*)(half_ds->GetTensor()); delete[] (char*)(half_ds->GetTensor());
} }
// TODO: more scalar type. // TODO: more scalar type.
@ -220,7 +219,7 @@ TEST(CInt64IndexTest, All) {
CIndex copy_index; CIndex copy_index;
{ {
status = CreateIndex(dtype, status = CreateIndexV0(dtype,
type_params_str.c_str(), type_params_str.c_str(),
index_params_str.c_str(), index_params_str.c_str(),
&index); &index);
@ -235,7 +234,7 @@ TEST(CInt64IndexTest, All) {
ASSERT_EQ(milvus::Success, status.error_code); ASSERT_EQ(milvus::Success, status.error_code);
} }
{ {
status = CreateIndex(dtype, status = CreateIndexV0(dtype,
type_params_str.c_str(), type_params_str.c_str(),
index_params_str.c_str(), index_params_str.c_str(),
&copy_index); &copy_index);
@ -279,7 +278,7 @@ TEST(CStringIndexTest, All) {
CIndex copy_index; CIndex copy_index;
{ {
status = CreateIndex(dtype, status = CreateIndexV0(dtype,
type_params_str.c_str(), type_params_str.c_str(),
index_params_str.c_str(), index_params_str.c_str(),
&index); &index);
@ -295,7 +294,7 @@ TEST(CStringIndexTest, All) {
ASSERT_EQ(milvus::Success, status.error_code); ASSERT_EQ(milvus::Success, status.error_code);
} }
{ {
status = CreateIndex(dtype, status = CreateIndexV0(dtype,
type_params_str.c_str(), type_params_str.c_str(),
index_params_str.c_str(), index_params_str.c_str(),
&copy_index); &copy_index);
@ -316,6 +315,6 @@ TEST(CStringIndexTest, All) {
{ DeleteBinarySet(binary_set); } { DeleteBinarySet(binary_set); }
} }
delete[](char*)(str_ds->GetTensor()); delete[] (char*)(str_ds->GetTensor());
} }
#endif #endif

View File

@ -73,7 +73,7 @@ func NewCgoIndex(dtype schemapb.DataType, typeParams, indexParams map[string]str
var indexPtr C.CIndex var indexPtr C.CIndex
cintDType := uint32(dtype) cintDType := uint32(dtype)
status := C.CreateIndex(cintDType, typeParamsPointer, indexParamsPointer, &indexPtr) status := C.CreateIndexV0(cintDType, typeParamsPointer, indexParamsPointer, &indexPtr)
if err := HandleCStatus(&status, "failed to create index"); err != nil { if err := HandleCStatus(&status, "failed to create index"); err != nil {
return nil, err return nil, err
} }
@ -94,7 +94,7 @@ func NewCgoIndex(dtype schemapb.DataType, typeParams, indexParams map[string]str
func CreateIndex(ctx context.Context, buildIndexInfo *BuildIndexInfo) (CodecIndex, error) { func CreateIndex(ctx context.Context, buildIndexInfo *BuildIndexInfo) (CodecIndex, error) {
var indexPtr C.CIndex var indexPtr C.CIndex
status := C.CreateIndexV2(&indexPtr, buildIndexInfo.cBuildIndexInfo) status := C.CreateIndex(&indexPtr, buildIndexInfo.cBuildIndexInfo)
if err := HandleCStatus(&status, "failed to create index"); err != nil { if err := HandleCStatus(&status, "failed to create index"); err != nil {
return nil, err return nil, err
} }