mirror of https://github.com/milvus-io/milvus.git
rename table to collection (#1888)
* rename table to collection Signed-off-by: groot <yihua.mo@zilliz.com> * rename collection Signed-off-by: groot <yihua.mo@zilliz.com> * rename Signed-off-by: groot <yihua.mo@zilliz.com> * Update change log Signed-off-by: JinHai-CN <hai.jin@zilliz.com> Co-authored-by: JinHai-CN <hai.jin@zilliz.com>pull/1902/head
parent
9074366f42
commit
e25c5af2d7
|
@ -680,7 +680,7 @@ Please mark all change in change log and use the issue from GitHub
|
|||
- MS-67 Fix license check bug
|
||||
- MS-76 Fix pipeline crash bug
|
||||
- MS-100 cmake: fix AWS build issue
|
||||
- MS-101 change AWS build type to Release
|
||||
- MS-101 Change AWS build type to Release
|
||||
|
||||
## Improvement
|
||||
|
||||
|
|
|
@ -261,7 +261,7 @@ Config::ResetDefaultConfig() {
|
|||
|
||||
/* db config */
|
||||
CONFIG_CHECK(SetDBConfigBackendUrl(CONFIG_DB_BACKEND_URL_DEFAULT));
|
||||
CONFIG_CHECK(SetDBConfigPreloadCollection(CONFIG_DB_PRELOAD_TABLE_DEFAULT));
|
||||
CONFIG_CHECK(SetDBConfigPreloadCollection(CONFIG_DB_PRELOAD_COLLECTION_DEFAULT));
|
||||
CONFIG_CHECK(SetDBConfigArchiveDiskThreshold(CONFIG_DB_ARCHIVE_DISK_THRESHOLD_DEFAULT));
|
||||
CONFIG_CHECK(SetDBConfigArchiveDaysThreshold(CONFIG_DB_ARCHIVE_DAYS_THRESHOLD_DEFAULT));
|
||||
CONFIG_CHECK(SetDBConfigAutoFlushInterval(CONFIG_DB_AUTO_FLUSH_INTERVAL_DEFAULT));
|
||||
|
@ -353,7 +353,7 @@ Config::SetConfigCli(const std::string& parent_key, const std::string& child_key
|
|||
} else if (parent_key == CONFIG_DB) {
|
||||
if (child_key == CONFIG_DB_BACKEND_URL) {
|
||||
status = SetDBConfigBackendUrl(value);
|
||||
} else if (child_key == CONFIG_DB_PRELOAD_TABLE) {
|
||||
} else if (child_key == CONFIG_DB_PRELOAD_COLLECTION) {
|
||||
status = SetDBConfigPreloadCollection(value);
|
||||
} else if (child_key == CONFIG_DB_AUTO_FLUSH_INTERVAL) {
|
||||
status = SetDBConfigAutoFlushInterval(value);
|
||||
|
@ -795,7 +795,7 @@ Config::CheckDBConfigPreloadCollection(const std::string& value) {
|
|||
bool exist = false;
|
||||
auto status = DBWrapper::DB()->HasNativeCollection(collection, exist);
|
||||
if (!(status.ok() && exist)) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, "Collection " + collection + " not exist");
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, "Collection " + collection + " not exist");
|
||||
}
|
||||
table_set.insert(collection);
|
||||
}
|
||||
|
@ -1503,7 +1503,7 @@ Config::GetDBConfigArchiveDaysThreshold(int64_t& value) {
|
|||
|
||||
Status
|
||||
Config::GetDBConfigPreloadCollection(std::string& value) {
|
||||
value = GetConfigStr(CONFIG_DB, CONFIG_DB_PRELOAD_TABLE);
|
||||
value = GetConfigStr(CONFIG_DB, CONFIG_DB_PRELOAD_COLLECTION);
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
|
@ -1856,7 +1856,7 @@ Status
|
|||
Config::SetDBConfigPreloadCollection(const std::string& value) {
|
||||
CONFIG_CHECK(CheckDBConfigPreloadCollection(value));
|
||||
std::string cor_value = value == "*" ? "\'*\'" : value;
|
||||
return SetConfigValueInMem(CONFIG_DB, CONFIG_DB_PRELOAD_TABLE, cor_value);
|
||||
return SetConfigValueInMem(CONFIG_DB, CONFIG_DB_PRELOAD_COLLECTION, cor_value);
|
||||
}
|
||||
|
||||
Status
|
||||
|
|
|
@ -57,8 +57,8 @@ static const char* CONFIG_DB_ARCHIVE_DISK_THRESHOLD = "archive_disk_threshold";
|
|||
static const char* CONFIG_DB_ARCHIVE_DISK_THRESHOLD_DEFAULT = "0";
|
||||
static const char* CONFIG_DB_ARCHIVE_DAYS_THRESHOLD = "archive_days_threshold";
|
||||
static const char* CONFIG_DB_ARCHIVE_DAYS_THRESHOLD_DEFAULT = "0";
|
||||
static const char* CONFIG_DB_PRELOAD_TABLE = "preload_table";
|
||||
static const char* CONFIG_DB_PRELOAD_TABLE_DEFAULT = "";
|
||||
static const char* CONFIG_DB_PRELOAD_COLLECTION = "preload_table";
|
||||
static const char* CONFIG_DB_PRELOAD_COLLECTION_DEFAULT = "";
|
||||
static const char* CONFIG_DB_AUTO_FLUSH_INTERVAL = "auto_flush_interval";
|
||||
static const char* CONFIG_DB_AUTO_FLUSH_INTERVAL_DEFAULT = "1";
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ ConstructParentFolder(const std::string& db_path, const meta::SegmentSchema& tab
|
|||
}
|
||||
|
||||
static std::string
|
||||
GetTableFileParentFolder(const DBMetaOptions& options, const meta::SegmentSchema& table_file) {
|
||||
GetCollectionFileParentFolder(const DBMetaOptions& options, const meta::SegmentSchema& table_file) {
|
||||
uint64_t path_count = options.slave_paths_.size() + 1;
|
||||
std::string target_path = options.path_;
|
||||
uint64_t index = 0;
|
||||
|
@ -102,7 +102,7 @@ CreateCollectionPath(const DBMetaOptions& options, const std::string& collection
|
|||
}
|
||||
|
||||
Status
|
||||
DeleteTablePath(const DBMetaOptions& options, const std::string& collection_id, bool force) {
|
||||
DeleteCollectionPath(const DBMetaOptions& options, const std::string& collection_id, bool force) {
|
||||
std::vector<std::string> paths = options.slave_paths_;
|
||||
paths.push_back(options.path_);
|
||||
|
||||
|
@ -136,7 +136,7 @@ DeleteTablePath(const DBMetaOptions& options, const std::string& collection_id,
|
|||
|
||||
Status
|
||||
CreateCollectionFilePath(const DBMetaOptions& options, meta::SegmentSchema& table_file) {
|
||||
std::string parent_path = GetTableFileParentFolder(options, table_file);
|
||||
std::string parent_path = GetCollectionFileParentFolder(options, table_file);
|
||||
|
||||
auto status = server::CommonUtil::CreateDirectory(parent_path);
|
||||
fiu_do_on("CreateCollectionFilePath.fail_create", status = Status(DB_INVALID_PATH, ""));
|
||||
|
@ -151,14 +151,14 @@ CreateCollectionFilePath(const DBMetaOptions& options, meta::SegmentSchema& tabl
|
|||
}
|
||||
|
||||
Status
|
||||
GetTableFilePath(const DBMetaOptions& options, meta::SegmentSchema& table_file) {
|
||||
GetCollectionFilePath(const DBMetaOptions& options, meta::SegmentSchema& table_file) {
|
||||
std::string parent_path = ConstructParentFolder(options.path_, table_file);
|
||||
std::string file_path = parent_path + "/" + table_file.file_id_;
|
||||
|
||||
bool s3_enable = false;
|
||||
server::Config& config = server::Config::GetInstance();
|
||||
config.GetStorageConfigS3Enable(s3_enable);
|
||||
fiu_do_on("GetTableFilePath.enable_s3", s3_enable = true);
|
||||
fiu_do_on("GetCollectionFilePath.enable_s3", s3_enable = true);
|
||||
if (s3_enable) {
|
||||
/* need not check file existence */
|
||||
table_file.location_ = file_path;
|
||||
|
@ -188,15 +188,15 @@ GetTableFilePath(const DBMetaOptions& options, meta::SegmentSchema& table_file)
|
|||
}
|
||||
|
||||
Status
|
||||
DeleteTableFilePath(const DBMetaOptions& options, meta::SegmentSchema& table_file) {
|
||||
utils::GetTableFilePath(options, table_file);
|
||||
DeleteCollectionFilePath(const DBMetaOptions& options, meta::SegmentSchema& table_file) {
|
||||
utils::GetCollectionFilePath(options, table_file);
|
||||
boost::filesystem::remove(table_file.location_);
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
Status
|
||||
DeleteSegment(const DBMetaOptions& options, meta::SegmentSchema& table_file) {
|
||||
utils::GetTableFilePath(options, table_file);
|
||||
utils::GetCollectionFilePath(options, table_file);
|
||||
std::string segment_dir;
|
||||
GetParentPath(table_file.location_, segment_dir);
|
||||
boost::filesystem::remove_all(segment_dir);
|
||||
|
|
|
@ -28,14 +28,14 @@ GetMicroSecTimeStamp();
|
|||
Status
|
||||
CreateCollectionPath(const DBMetaOptions& options, const std::string& collection_id);
|
||||
Status
|
||||
DeleteTablePath(const DBMetaOptions& options, const std::string& collection_id, bool force = true);
|
||||
DeleteCollectionPath(const DBMetaOptions& options, const std::string& collection_id, bool force = true);
|
||||
|
||||
Status
|
||||
CreateCollectionFilePath(const DBMetaOptions& options, meta::SegmentSchema& table_file);
|
||||
Status
|
||||
GetTableFilePath(const DBMetaOptions& options, meta::SegmentSchema& table_file);
|
||||
GetCollectionFilePath(const DBMetaOptions& options, meta::SegmentSchema& table_file);
|
||||
Status
|
||||
DeleteTableFilePath(const DBMetaOptions& options, meta::SegmentSchema& table_file);
|
||||
DeleteCollectionFilePath(const DBMetaOptions& options, meta::SegmentSchema& table_file);
|
||||
Status
|
||||
DeleteSegment(const DBMetaOptions& options, meta::SegmentSchema& table_file);
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ MemTable::Serialize(uint64_t wal_lsn, bool apply_delete) {
|
|||
}
|
||||
|
||||
// Update flush lsn
|
||||
auto status = meta_->UpdateTableFlushLSN(collection_id_, wal_lsn);
|
||||
auto status = meta_->UpdateCollectionFlushLSN(collection_id_, wal_lsn);
|
||||
if (!status.ok()) {
|
||||
std::string err_msg = "Failed to write flush lsn to meta: " + status.ToString();
|
||||
ENGINE_LOG_ERROR << err_msg;
|
||||
|
|
|
@ -58,7 +58,7 @@ class Meta {
|
|||
UpdateCollectionFlag(const std::string& collection_id, int64_t flag) = 0;
|
||||
|
||||
virtual Status
|
||||
UpdateTableFlushLSN(const std::string& collection_id, uint64_t flush_lsn) = 0;
|
||||
UpdateCollectionFlushLSN(const std::string& collection_id, uint64_t flush_lsn) = 0;
|
||||
|
||||
virtual Status
|
||||
GetCollectionFlushLSN(const std::string& collection_id, uint64_t& flush_lsn) = 0;
|
||||
|
@ -67,13 +67,14 @@ class Meta {
|
|||
DropCollection(const std::string& collection_id) = 0;
|
||||
|
||||
virtual Status
|
||||
DeleteTableFiles(const std::string& collection_id) = 0;
|
||||
DeleteCollectionFiles(const std::string& collection_id) = 0;
|
||||
|
||||
virtual Status
|
||||
CreateCollectionFile(SegmentSchema& file_schema) = 0;
|
||||
|
||||
virtual Status
|
||||
GetTableFiles(const std::string& collection_id, const std::vector<size_t>& ids, SegmentsSchema& table_files) = 0;
|
||||
GetCollectionFiles(const std::string& collection_id, const std::vector<size_t>& ids,
|
||||
SegmentsSchema& table_files) = 0;
|
||||
|
||||
virtual Status
|
||||
GetCollectionFilesBySegmentId(const std::string& segment_id, SegmentsSchema& table_files) = 0;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -32,32 +32,32 @@ class MySQLMetaImpl : public Meta {
|
|||
~MySQLMetaImpl();
|
||||
|
||||
Status
|
||||
CreateCollection(CollectionSchema& table_schema) override;
|
||||
CreateCollection(CollectionSchema& collection_schema) override;
|
||||
|
||||
Status
|
||||
DescribeCollection(CollectionSchema& table_schema) override;
|
||||
DescribeCollection(CollectionSchema& collection_schema) override;
|
||||
|
||||
Status
|
||||
HasCollection(const std::string& collection_id, bool& has_or_not) override;
|
||||
|
||||
Status
|
||||
AllCollections(std::vector<CollectionSchema>& table_schema_array) override;
|
||||
AllCollections(std::vector<CollectionSchema>& collection_schema_array) override;
|
||||
|
||||
Status
|
||||
DropCollection(const std::string& collection_id) override;
|
||||
|
||||
Status
|
||||
DeleteTableFiles(const std::string& collection_id) override;
|
||||
DeleteCollectionFiles(const std::string& collection_id) override;
|
||||
|
||||
Status
|
||||
CreateCollectionFile(SegmentSchema& file_schema) override;
|
||||
|
||||
Status
|
||||
GetTableFiles(const std::string& collection_id, const std::vector<size_t>& ids,
|
||||
SegmentsSchema& table_files) override;
|
||||
GetCollectionFiles(const std::string& collection_id, const std::vector<size_t>& ids,
|
||||
SegmentsSchema& collection_files) override;
|
||||
|
||||
Status
|
||||
GetCollectionFilesBySegmentId(const std::string& segment_id, SegmentsSchema& table_files) override;
|
||||
GetCollectionFilesBySegmentId(const std::string& segment_id, SegmentsSchema& collection_files) override;
|
||||
|
||||
Status
|
||||
UpdateCollectionIndex(const std::string& collection_id, const CollectionIndex& index) override;
|
||||
|
@ -66,7 +66,7 @@ class MySQLMetaImpl : public Meta {
|
|||
UpdateCollectionFlag(const std::string& collection_id, int64_t flag) override;
|
||||
|
||||
Status
|
||||
UpdateTableFlushLSN(const std::string& collection_id, uint64_t flush_lsn) override;
|
||||
UpdateCollectionFlushLSN(const std::string& collection_id, uint64_t flush_lsn) override;
|
||||
|
||||
Status
|
||||
GetCollectionFlushLSN(const std::string& collection_id, uint64_t& flush_lsn) override;
|
||||
|
@ -116,7 +116,7 @@ class MySQLMetaImpl : public Meta {
|
|||
FilesByType(const std::string& collection_id, const std::vector<int>& file_types, SegmentsSchema& files) override;
|
||||
|
||||
Status
|
||||
FilesByID(const std::vector<size_t>& ids, SegmentsSchema& table_files) override;
|
||||
FilesByID(const std::vector<size_t>& ids, SegmentsSchema& collection_files) override;
|
||||
|
||||
Status
|
||||
Archive() override;
|
||||
|
@ -146,7 +146,7 @@ class MySQLMetaImpl : public Meta {
|
|||
Status
|
||||
NextFileId(std::string& file_id);
|
||||
Status
|
||||
NextTableId(std::string& collection_id);
|
||||
NextCollectionId(std::string& collection_id);
|
||||
Status
|
||||
DiscardFiles(int64_t to_discard_size);
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ SqliteMetaImpl::~SqliteMetaImpl() {
|
|||
}
|
||||
|
||||
Status
|
||||
SqliteMetaImpl::NextTableId(std::string& collection_id) {
|
||||
SqliteMetaImpl::NextCollectionId(std::string& collection_id) {
|
||||
std::lock_guard<std::mutex> lock(genid_mutex_); // avoid duplicated id
|
||||
std::stringstream ss;
|
||||
SafeIDGenerator& id_generator = SafeIDGenerator::GetInstance();
|
||||
|
@ -164,19 +164,19 @@ SqliteMetaImpl::Initialize() {
|
|||
}
|
||||
|
||||
Status
|
||||
SqliteMetaImpl::CreateCollection(CollectionSchema& table_schema) {
|
||||
SqliteMetaImpl::CreateCollection(CollectionSchema& collection_schema) {
|
||||
try {
|
||||
server::MetricCollector metric;
|
||||
|
||||
// multi-threads call sqlite update may get exception('bad logic', etc), so we add a lock here
|
||||
std::lock_guard<std::mutex> meta_lock(meta_mutex_);
|
||||
|
||||
if (table_schema.collection_id_ == "") {
|
||||
NextTableId(table_schema.collection_id_);
|
||||
if (collection_schema.collection_id_ == "") {
|
||||
NextCollectionId(collection_schema.collection_id_);
|
||||
} else {
|
||||
fiu_do_on("SqliteMetaImpl.CreateCollection.throw_exception", throw std::exception());
|
||||
auto collection = ConnectorPtr->select(columns(&CollectionSchema::state_),
|
||||
where(c(&CollectionSchema::collection_id_) == table_schema.collection_id_));
|
||||
where(c(&CollectionSchema::collection_id_) == collection_schema.collection_id_));
|
||||
if (collection.size() == 1) {
|
||||
if (CollectionSchema::TO_DELETE == std::get<0>(collection[0])) {
|
||||
return Status(DB_ERROR, "Collection already exists and it is in delete state, please wait a second");
|
||||
|
@ -187,27 +187,27 @@ SqliteMetaImpl::CreateCollection(CollectionSchema& table_schema) {
|
|||
}
|
||||
}
|
||||
|
||||
table_schema.id_ = -1;
|
||||
table_schema.created_on_ = utils::GetMicroSecTimeStamp();
|
||||
collection_schema.id_ = -1;
|
||||
collection_schema.created_on_ = utils::GetMicroSecTimeStamp();
|
||||
|
||||
try {
|
||||
fiu_do_on("SqliteMetaImpl.CreateCollection.insert_throw_exception", throw std::exception());
|
||||
auto id = ConnectorPtr->insert(table_schema);
|
||||
table_schema.id_ = id;
|
||||
auto id = ConnectorPtr->insert(collection_schema);
|
||||
collection_schema.id_ = id;
|
||||
} catch (std::exception& e) {
|
||||
return HandleException("Encounter exception when create collection", e.what());
|
||||
}
|
||||
|
||||
ENGINE_LOG_DEBUG << "Successfully create collection: " << table_schema.collection_id_;
|
||||
ENGINE_LOG_DEBUG << "Successfully create collection: " << collection_schema.collection_id_;
|
||||
|
||||
return utils::CreateCollectionPath(options_, table_schema.collection_id_);
|
||||
return utils::CreateCollectionPath(options_, collection_schema.collection_id_);
|
||||
} catch (std::exception& e) {
|
||||
return HandleException("Encounter exception when create collection", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
Status
|
||||
SqliteMetaImpl::DescribeCollection(CollectionSchema& table_schema) {
|
||||
SqliteMetaImpl::DescribeCollection(CollectionSchema& collection_schema) {
|
||||
try {
|
||||
server::MetricCollector metric;
|
||||
|
||||
|
@ -219,25 +219,25 @@ SqliteMetaImpl::DescribeCollection(CollectionSchema& table_schema) {
|
|||
&CollectionSchema::flag_, &CollectionSchema::index_file_size_, &CollectionSchema::engine_type_,
|
||||
&CollectionSchema::index_params_, &CollectionSchema::metric_type_, &CollectionSchema::owner_collection_,
|
||||
&CollectionSchema::partition_tag_, &CollectionSchema::version_, &CollectionSchema::flush_lsn_),
|
||||
where(c(&CollectionSchema::collection_id_) == table_schema.collection_id_ and
|
||||
where(c(&CollectionSchema::collection_id_) == collection_schema.collection_id_ and
|
||||
c(&CollectionSchema::state_) != (int)CollectionSchema::TO_DELETE));
|
||||
|
||||
if (groups.size() == 1) {
|
||||
table_schema.id_ = std::get<0>(groups[0]);
|
||||
table_schema.state_ = std::get<1>(groups[0]);
|
||||
table_schema.dimension_ = std::get<2>(groups[0]);
|
||||
table_schema.created_on_ = std::get<3>(groups[0]);
|
||||
table_schema.flag_ = std::get<4>(groups[0]);
|
||||
table_schema.index_file_size_ = std::get<5>(groups[0]);
|
||||
table_schema.engine_type_ = std::get<6>(groups[0]);
|
||||
table_schema.index_params_ = std::get<7>(groups[0]);
|
||||
table_schema.metric_type_ = std::get<8>(groups[0]);
|
||||
table_schema.owner_collection_ = std::get<9>(groups[0]);
|
||||
table_schema.partition_tag_ = std::get<10>(groups[0]);
|
||||
table_schema.version_ = std::get<11>(groups[0]);
|
||||
table_schema.flush_lsn_ = std::get<12>(groups[0]);
|
||||
collection_schema.id_ = std::get<0>(groups[0]);
|
||||
collection_schema.state_ = std::get<1>(groups[0]);
|
||||
collection_schema.dimension_ = std::get<2>(groups[0]);
|
||||
collection_schema.created_on_ = std::get<3>(groups[0]);
|
||||
collection_schema.flag_ = std::get<4>(groups[0]);
|
||||
collection_schema.index_file_size_ = std::get<5>(groups[0]);
|
||||
collection_schema.engine_type_ = std::get<6>(groups[0]);
|
||||
collection_schema.index_params_ = std::get<7>(groups[0]);
|
||||
collection_schema.metric_type_ = std::get<8>(groups[0]);
|
||||
collection_schema.owner_collection_ = std::get<9>(groups[0]);
|
||||
collection_schema.partition_tag_ = std::get<10>(groups[0]);
|
||||
collection_schema.version_ = std::get<11>(groups[0]);
|
||||
collection_schema.flush_lsn_ = std::get<12>(groups[0]);
|
||||
} else {
|
||||
return Status(DB_NOT_FOUND, "Collection " + table_schema.collection_id_ + " not found");
|
||||
return Status(DB_NOT_FOUND, "Collection " + collection_schema.collection_id_ + " not found");
|
||||
}
|
||||
} catch (std::exception& e) {
|
||||
return HandleException("Encounter exception when describe collection", e.what());
|
||||
|
@ -253,10 +253,10 @@ SqliteMetaImpl::HasCollection(const std::string& collection_id, bool& has_or_not
|
|||
try {
|
||||
fiu_do_on("SqliteMetaImpl.HasCollection.throw_exception", throw std::exception());
|
||||
server::MetricCollector metric;
|
||||
auto tables = ConnectorPtr->select(
|
||||
auto collections = ConnectorPtr->select(
|
||||
columns(&CollectionSchema::id_),
|
||||
where(c(&CollectionSchema::collection_id_) == collection_id and c(&CollectionSchema::state_) != (int)CollectionSchema::TO_DELETE));
|
||||
if (tables.size() == 1) {
|
||||
if (collections.size() == 1) {
|
||||
has_or_not = true;
|
||||
} else {
|
||||
has_or_not = false;
|
||||
|
@ -269,7 +269,7 @@ SqliteMetaImpl::HasCollection(const std::string& collection_id, bool& has_or_not
|
|||
}
|
||||
|
||||
Status
|
||||
SqliteMetaImpl::AllCollections(std::vector<CollectionSchema>& table_schema_array) {
|
||||
SqliteMetaImpl::AllCollections(std::vector<CollectionSchema>& collection_schema_array) {
|
||||
try {
|
||||
fiu_do_on("SqliteMetaImpl.AllCollections.throw_exception", throw std::exception());
|
||||
server::MetricCollector metric;
|
||||
|
@ -295,10 +295,10 @@ SqliteMetaImpl::AllCollections(std::vector<CollectionSchema>& table_schema_array
|
|||
schema.version_ = std::get<11>(collection);
|
||||
schema.flush_lsn_ = std::get<12>(collection);
|
||||
|
||||
table_schema_array.emplace_back(schema);
|
||||
collection_schema_array.emplace_back(schema);
|
||||
}
|
||||
} catch (std::exception& e) {
|
||||
return HandleException("Encounter exception when lookup all tables", e.what());
|
||||
return HandleException("Encounter exception when lookup all collections", e.what());
|
||||
}
|
||||
|
||||
return Status::OK();
|
||||
|
@ -328,9 +328,9 @@ SqliteMetaImpl::DropCollection(const std::string& collection_id) {
|
|||
}
|
||||
|
||||
Status
|
||||
SqliteMetaImpl::DeleteTableFiles(const std::string& collection_id) {
|
||||
SqliteMetaImpl::DeleteCollectionFiles(const std::string& collection_id) {
|
||||
try {
|
||||
fiu_do_on("SqliteMetaImpl.DeleteTableFiles.throw_exception", throw std::exception());
|
||||
fiu_do_on("SqliteMetaImpl.DeleteCollectionFiles.throw_exception", throw std::exception());
|
||||
|
||||
server::MetricCollector metric;
|
||||
|
||||
|
@ -356,9 +356,9 @@ SqliteMetaImpl::CreateCollectionFile(SegmentSchema& file_schema) {
|
|||
if (file_schema.date_ == EmptyDate) {
|
||||
file_schema.date_ = utils::GetDate();
|
||||
}
|
||||
CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = file_schema.collection_id_;
|
||||
auto status = DescribeCollection(table_schema);
|
||||
CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = file_schema.collection_id_;
|
||||
auto status = DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
}
|
||||
|
@ -371,15 +371,15 @@ SqliteMetaImpl::CreateCollectionFile(SegmentSchema& file_schema) {
|
|||
if (file_schema.segment_id_.empty()) {
|
||||
file_schema.segment_id_ = file_schema.file_id_;
|
||||
}
|
||||
file_schema.dimension_ = table_schema.dimension_;
|
||||
file_schema.dimension_ = collection_schema.dimension_;
|
||||
file_schema.file_size_ = 0;
|
||||
file_schema.row_count_ = 0;
|
||||
file_schema.created_on_ = utils::GetMicroSecTimeStamp();
|
||||
file_schema.updated_time_ = file_schema.created_on_;
|
||||
file_schema.index_file_size_ = table_schema.index_file_size_;
|
||||
file_schema.index_params_ = table_schema.index_params_;
|
||||
file_schema.engine_type_ = table_schema.engine_type_;
|
||||
file_schema.metric_type_ = table_schema.metric_type_;
|
||||
file_schema.index_file_size_ = collection_schema.index_file_size_;
|
||||
file_schema.index_params_ = collection_schema.index_params_;
|
||||
file_schema.engine_type_ = collection_schema.engine_type_;
|
||||
file_schema.metric_type_ = collection_schema.metric_type_;
|
||||
|
||||
// multi-threads call sqlite update may get exception('bad logic', etc), so we add a lock here
|
||||
std::lock_guard<std::mutex> meta_lock(meta_mutex_);
|
||||
|
@ -397,21 +397,21 @@ SqliteMetaImpl::CreateCollectionFile(SegmentSchema& file_schema) {
|
|||
}
|
||||
|
||||
Status
|
||||
SqliteMetaImpl::GetTableFiles(const std::string& collection_id, const std::vector<size_t>& ids,
|
||||
SegmentsSchema& table_files) {
|
||||
SqliteMetaImpl::GetCollectionFiles(const std::string& collection_id, const std::vector<size_t>& ids,
|
||||
SegmentsSchema& collection_files) {
|
||||
try {
|
||||
fiu_do_on("SqliteMetaImpl.GetTableFiles.throw_exception", throw std::exception());
|
||||
fiu_do_on("SqliteMetaImpl.GetCollectionFiles.throw_exception", throw std::exception());
|
||||
|
||||
table_files.clear();
|
||||
collection_files.clear();
|
||||
auto files = ConnectorPtr->select(
|
||||
columns(&SegmentSchema::id_, &SegmentSchema::segment_id_, &SegmentSchema::file_id_,
|
||||
&SegmentSchema::file_type_, &SegmentSchema::file_size_, &SegmentSchema::row_count_,
|
||||
&SegmentSchema::date_, &SegmentSchema::engine_type_, &SegmentSchema::created_on_),
|
||||
where(c(&SegmentSchema::collection_id_) == collection_id and in(&SegmentSchema::id_, ids) and
|
||||
c(&SegmentSchema::file_type_) != (int)SegmentSchema::TO_DELETE));
|
||||
CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_id;
|
||||
auto status = DescribeCollection(table_schema);
|
||||
CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_id;
|
||||
auto status = DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
}
|
||||
|
@ -429,14 +429,14 @@ SqliteMetaImpl::GetTableFiles(const std::string& collection_id, const std::vecto
|
|||
file_schema.date_ = std::get<6>(file);
|
||||
file_schema.engine_type_ = std::get<7>(file);
|
||||
file_schema.created_on_ = std::get<8>(file);
|
||||
file_schema.dimension_ = table_schema.dimension_;
|
||||
file_schema.index_file_size_ = table_schema.index_file_size_;
|
||||
file_schema.index_params_ = table_schema.index_params_;
|
||||
file_schema.metric_type_ = table_schema.metric_type_;
|
||||
file_schema.dimension_ = collection_schema.dimension_;
|
||||
file_schema.index_file_size_ = collection_schema.index_file_size_;
|
||||
file_schema.index_params_ = collection_schema.index_params_;
|
||||
file_schema.metric_type_ = collection_schema.metric_type_;
|
||||
|
||||
utils::GetTableFilePath(options_, file_schema);
|
||||
utils::GetCollectionFilePath(options_, file_schema);
|
||||
|
||||
table_files.emplace_back(file_schema);
|
||||
collection_files.emplace_back(file_schema);
|
||||
}
|
||||
|
||||
ENGINE_LOG_DEBUG << "Get collection files by id";
|
||||
|
@ -448,9 +448,9 @@ SqliteMetaImpl::GetTableFiles(const std::string& collection_id, const std::vecto
|
|||
|
||||
Status
|
||||
SqliteMetaImpl::GetCollectionFilesBySegmentId(const std::string& segment_id,
|
||||
milvus::engine::meta::SegmentsSchema& table_files) {
|
||||
milvus::engine::meta::SegmentsSchema& collection_files) {
|
||||
try {
|
||||
table_files.clear();
|
||||
collection_files.clear();
|
||||
auto files = ConnectorPtr->select(
|
||||
columns(&SegmentSchema::id_, &SegmentSchema::collection_id_, &SegmentSchema::segment_id_,
|
||||
&SegmentSchema::file_id_, &SegmentSchema::file_type_, &SegmentSchema::file_size_,
|
||||
|
@ -460,16 +460,16 @@ SqliteMetaImpl::GetCollectionFilesBySegmentId(const std::string& segment_id,
|
|||
c(&SegmentSchema::file_type_) != (int)SegmentSchema::TO_DELETE));
|
||||
|
||||
if (!files.empty()) {
|
||||
CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = std::get<1>(files[0]);
|
||||
auto status = DescribeCollection(table_schema);
|
||||
CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = std::get<1>(files[0]);
|
||||
auto status = DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
}
|
||||
|
||||
for (auto& file : files) {
|
||||
SegmentSchema file_schema;
|
||||
file_schema.collection_id_ = table_schema.collection_id_;
|
||||
file_schema.collection_id_ = collection_schema.collection_id_;
|
||||
file_schema.id_ = std::get<0>(file);
|
||||
file_schema.segment_id_ = std::get<2>(file);
|
||||
file_schema.file_id_ = std::get<3>(file);
|
||||
|
@ -479,13 +479,13 @@ SqliteMetaImpl::GetCollectionFilesBySegmentId(const std::string& segment_id,
|
|||
file_schema.date_ = std::get<7>(file);
|
||||
file_schema.engine_type_ = std::get<8>(file);
|
||||
file_schema.created_on_ = std::get<9>(file);
|
||||
file_schema.dimension_ = table_schema.dimension_;
|
||||
file_schema.index_file_size_ = table_schema.index_file_size_;
|
||||
file_schema.index_params_ = table_schema.index_params_;
|
||||
file_schema.metric_type_ = table_schema.metric_type_;
|
||||
file_schema.dimension_ = collection_schema.dimension_;
|
||||
file_schema.index_file_size_ = collection_schema.index_file_size_;
|
||||
file_schema.index_params_ = collection_schema.index_params_;
|
||||
file_schema.metric_type_ = collection_schema.metric_type_;
|
||||
|
||||
utils::GetTableFilePath(options_, file_schema);
|
||||
table_files.emplace_back(file_schema);
|
||||
utils::GetCollectionFilePath(options_, file_schema);
|
||||
collection_files.emplace_back(file_schema);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -514,7 +514,7 @@ SqliteMetaImpl::UpdateCollectionFlag(const std::string& collection_id, int64_t f
|
|||
}
|
||||
|
||||
Status
|
||||
SqliteMetaImpl::UpdateTableFlushLSN(const std::string& collection_id, uint64_t flush_lsn) {
|
||||
SqliteMetaImpl::UpdateCollectionFlushLSN(const std::string& collection_id, uint64_t flush_lsn) {
|
||||
try {
|
||||
server::MetricCollector metric;
|
||||
|
||||
|
@ -560,12 +560,12 @@ SqliteMetaImpl::UpdateCollectionFile(SegmentSchema& file_schema) {
|
|||
// multi-threads call sqlite update may get exception('bad logic', etc), so we add a lock here
|
||||
std::lock_guard<std::mutex> meta_lock(meta_mutex_);
|
||||
|
||||
auto tables = ConnectorPtr->select(columns(&CollectionSchema::state_),
|
||||
auto collections = ConnectorPtr->select(columns(&CollectionSchema::state_),
|
||||
where(c(&CollectionSchema::collection_id_) == file_schema.collection_id_));
|
||||
|
||||
// if the collection has been deleted, just mark the collection file as TO_DELETE
|
||||
// clean thread will delete the file later
|
||||
if (tables.size() < 1 || std::get<0>(tables[0]) == (int)CollectionSchema::TO_DELETE) {
|
||||
if (collections.size() < 1 || std::get<0>(collections[0]) == (int)CollectionSchema::TO_DELETE) {
|
||||
file_schema.file_type_ = SegmentSchema::TO_DELETE;
|
||||
}
|
||||
|
||||
|
@ -594,10 +594,10 @@ SqliteMetaImpl::UpdateCollectionFiles(SegmentsSchema& files) {
|
|||
if (has_collections.find(file.collection_id_) != has_collections.end()) {
|
||||
continue;
|
||||
}
|
||||
auto tables = ConnectorPtr->select(columns(&CollectionSchema::id_),
|
||||
auto collections = ConnectorPtr->select(columns(&CollectionSchema::id_),
|
||||
where(c(&CollectionSchema::collection_id_) == file.collection_id_ and
|
||||
c(&CollectionSchema::state_) != (int)CollectionSchema::TO_DELETE));
|
||||
if (tables.size() >= 1) {
|
||||
if (collections.size() >= 1) {
|
||||
has_collections[file.collection_id_] = true;
|
||||
} else {
|
||||
has_collections[file.collection_id_] = false;
|
||||
|
@ -657,31 +657,31 @@ SqliteMetaImpl::UpdateCollectionIndex(const std::string& collection_id, const Co
|
|||
// multi-threads call sqlite update may get exception('bad logic', etc), so we add a lock here
|
||||
std::lock_guard<std::mutex> meta_lock(meta_mutex_);
|
||||
|
||||
auto tables = ConnectorPtr->select(
|
||||
auto collections = ConnectorPtr->select(
|
||||
|
||||
columns(&CollectionSchema::id_, &CollectionSchema::state_, &CollectionSchema::dimension_, &CollectionSchema::created_on_,
|
||||
&CollectionSchema::flag_, &CollectionSchema::index_file_size_, &CollectionSchema::owner_collection_,
|
||||
&CollectionSchema::partition_tag_, &CollectionSchema::version_, &CollectionSchema::flush_lsn_),
|
||||
where(c(&CollectionSchema::collection_id_) == collection_id and c(&CollectionSchema::state_) != (int)CollectionSchema::TO_DELETE));
|
||||
|
||||
if (tables.size() > 0) {
|
||||
meta::CollectionSchema table_schema;
|
||||
table_schema.id_ = std::get<0>(tables[0]);
|
||||
table_schema.collection_id_ = collection_id;
|
||||
table_schema.state_ = std::get<1>(tables[0]);
|
||||
table_schema.dimension_ = std::get<2>(tables[0]);
|
||||
table_schema.created_on_ = std::get<3>(tables[0]);
|
||||
table_schema.flag_ = std::get<4>(tables[0]);
|
||||
table_schema.index_file_size_ = std::get<5>(tables[0]);
|
||||
table_schema.owner_collection_ = std::get<6>(tables[0]);
|
||||
table_schema.partition_tag_ = std::get<7>(tables[0]);
|
||||
table_schema.version_ = std::get<8>(tables[0]);
|
||||
table_schema.flush_lsn_ = std::get<9>(tables[0]);
|
||||
table_schema.engine_type_ = index.engine_type_;
|
||||
table_schema.index_params_ = index.extra_params_.dump();
|
||||
table_schema.metric_type_ = index.metric_type_;
|
||||
if (collections.size() > 0) {
|
||||
meta::CollectionSchema collection_schema;
|
||||
collection_schema.id_ = std::get<0>(collections[0]);
|
||||
collection_schema.collection_id_ = collection_id;
|
||||
collection_schema.state_ = std::get<1>(collections[0]);
|
||||
collection_schema.dimension_ = std::get<2>(collections[0]);
|
||||
collection_schema.created_on_ = std::get<3>(collections[0]);
|
||||
collection_schema.flag_ = std::get<4>(collections[0]);
|
||||
collection_schema.index_file_size_ = std::get<5>(collections[0]);
|
||||
collection_schema.owner_collection_ = std::get<6>(collections[0]);
|
||||
collection_schema.partition_tag_ = std::get<7>(collections[0]);
|
||||
collection_schema.version_ = std::get<8>(collections[0]);
|
||||
collection_schema.flush_lsn_ = std::get<9>(collections[0]);
|
||||
collection_schema.engine_type_ = index.engine_type_;
|
||||
collection_schema.index_params_ = index.extra_params_.dump();
|
||||
collection_schema.metric_type_ = index.metric_type_;
|
||||
|
||||
ConnectorPtr->update(table_schema);
|
||||
ConnectorPtr->update(collection_schema);
|
||||
} else {
|
||||
return Status(DB_NOT_FOUND, "Collection " + collection_id + " not found");
|
||||
}
|
||||
|
@ -796,15 +796,15 @@ SqliteMetaImpl::CreatePartition(const std::string& collection_id, const std::str
|
|||
uint64_t lsn) {
|
||||
server::MetricCollector metric;
|
||||
|
||||
CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_id;
|
||||
auto status = DescribeCollection(table_schema);
|
||||
CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_id;
|
||||
auto status = DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
}
|
||||
|
||||
// not allow create partition under partition
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(DB_ERROR, "Nested partition is not allowed");
|
||||
}
|
||||
|
||||
|
@ -822,19 +822,19 @@ SqliteMetaImpl::CreatePartition(const std::string& collection_id, const std::str
|
|||
|
||||
if (partition_name == "") {
|
||||
// generate unique partition name
|
||||
NextTableId(table_schema.collection_id_);
|
||||
NextCollectionId(collection_schema.collection_id_);
|
||||
} else {
|
||||
table_schema.collection_id_ = partition_name;
|
||||
collection_schema.collection_id_ = partition_name;
|
||||
}
|
||||
|
||||
table_schema.id_ = -1;
|
||||
table_schema.flag_ = 0;
|
||||
table_schema.created_on_ = utils::GetMicroSecTimeStamp();
|
||||
table_schema.owner_collection_ = collection_id;
|
||||
table_schema.partition_tag_ = valid_tag;
|
||||
table_schema.flush_lsn_ = lsn;
|
||||
collection_schema.id_ = -1;
|
||||
collection_schema.flag_ = 0;
|
||||
collection_schema.created_on_ = utils::GetMicroSecTimeStamp();
|
||||
collection_schema.owner_collection_ = collection_id;
|
||||
collection_schema.partition_tag_ = valid_tag;
|
||||
collection_schema.flush_lsn_ = lsn;
|
||||
|
||||
status = CreateCollection(table_schema);
|
||||
status = CreateCollection(collection_schema);
|
||||
if (status.code() == DB_ALREADY_EXIST) {
|
||||
return Status(DB_ALREADY_EXIST, "Partition already exists");
|
||||
}
|
||||
|
@ -925,47 +925,47 @@ SqliteMetaImpl::FilesToSearch(const std::string& collection_id, SegmentsSchema&
|
|||
&SegmentSchema::file_id_, &SegmentSchema::file_type_, &SegmentSchema::file_size_,
|
||||
&SegmentSchema::row_count_, &SegmentSchema::date_, &SegmentSchema::engine_type_);
|
||||
|
||||
auto match_tableid = c(&SegmentSchema::collection_id_) == collection_id;
|
||||
auto match_collectionid = c(&SegmentSchema::collection_id_) == collection_id;
|
||||
|
||||
std::vector<int> file_types = {(int)SegmentSchema::RAW, (int)SegmentSchema::TO_INDEX,
|
||||
(int)SegmentSchema::INDEX};
|
||||
auto match_type = in(&SegmentSchema::file_type_, file_types);
|
||||
|
||||
CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_id;
|
||||
auto status = DescribeCollection(table_schema);
|
||||
CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_id;
|
||||
auto status = DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
}
|
||||
|
||||
// perform query
|
||||
decltype(ConnectorPtr->select(select_columns)) selected;
|
||||
auto filter = where(match_tableid and match_type);
|
||||
auto filter = where(match_collectionid and match_type);
|
||||
selected = ConnectorPtr->select(select_columns, filter);
|
||||
|
||||
Status ret;
|
||||
for (auto& file : selected) {
|
||||
SegmentSchema table_file;
|
||||
table_file.id_ = std::get<0>(file);
|
||||
table_file.collection_id_ = std::get<1>(file);
|
||||
table_file.segment_id_ = std::get<2>(file);
|
||||
table_file.file_id_ = std::get<3>(file);
|
||||
table_file.file_type_ = std::get<4>(file);
|
||||
table_file.file_size_ = std::get<5>(file);
|
||||
table_file.row_count_ = std::get<6>(file);
|
||||
table_file.date_ = std::get<7>(file);
|
||||
table_file.engine_type_ = std::get<8>(file);
|
||||
table_file.dimension_ = table_schema.dimension_;
|
||||
table_file.index_file_size_ = table_schema.index_file_size_;
|
||||
table_file.index_params_ = table_schema.index_params_;
|
||||
table_file.metric_type_ = table_schema.metric_type_;
|
||||
SegmentSchema collection_file;
|
||||
collection_file.id_ = std::get<0>(file);
|
||||
collection_file.collection_id_ = std::get<1>(file);
|
||||
collection_file.segment_id_ = std::get<2>(file);
|
||||
collection_file.file_id_ = std::get<3>(file);
|
||||
collection_file.file_type_ = std::get<4>(file);
|
||||
collection_file.file_size_ = std::get<5>(file);
|
||||
collection_file.row_count_ = std::get<6>(file);
|
||||
collection_file.date_ = std::get<7>(file);
|
||||
collection_file.engine_type_ = std::get<8>(file);
|
||||
collection_file.dimension_ = collection_schema.dimension_;
|
||||
collection_file.index_file_size_ = collection_schema.index_file_size_;
|
||||
collection_file.index_params_ = collection_schema.index_params_;
|
||||
collection_file.metric_type_ = collection_schema.metric_type_;
|
||||
|
||||
auto status = utils::GetTableFilePath(options_, table_file);
|
||||
auto status = utils::GetCollectionFilePath(options_, collection_file);
|
||||
if (!status.ok()) {
|
||||
ret = status;
|
||||
}
|
||||
|
||||
files.emplace_back(table_file);
|
||||
files.emplace_back(collection_file);
|
||||
}
|
||||
if (files.empty()) {
|
||||
ENGINE_LOG_ERROR << "No file to search for collection: " << collection_id;
|
||||
|
@ -990,9 +990,9 @@ SqliteMetaImpl::FilesToMerge(const std::string& collection_id, SegmentsSchema& f
|
|||
server::MetricCollector metric;
|
||||
|
||||
// check collection existence
|
||||
CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_id;
|
||||
auto status = DescribeCollection(table_schema);
|
||||
CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_id;
|
||||
auto status = DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
}
|
||||
|
@ -1009,31 +1009,31 @@ SqliteMetaImpl::FilesToMerge(const std::string& collection_id, SegmentsSchema& f
|
|||
Status result;
|
||||
int64_t to_merge_files = 0;
|
||||
for (auto& file : selected) {
|
||||
SegmentSchema table_file;
|
||||
table_file.file_size_ = std::get<5>(file);
|
||||
if (table_file.file_size_ >= table_schema.index_file_size_) {
|
||||
SegmentSchema collection_file;
|
||||
collection_file.file_size_ = std::get<5>(file);
|
||||
if (collection_file.file_size_ >= collection_schema.index_file_size_) {
|
||||
continue; // skip large file
|
||||
}
|
||||
|
||||
table_file.id_ = std::get<0>(file);
|
||||
table_file.collection_id_ = std::get<1>(file);
|
||||
table_file.segment_id_ = std::get<2>(file);
|
||||
table_file.file_id_ = std::get<3>(file);
|
||||
table_file.file_type_ = std::get<4>(file);
|
||||
table_file.row_count_ = std::get<6>(file);
|
||||
table_file.date_ = std::get<7>(file);
|
||||
table_file.created_on_ = std::get<8>(file);
|
||||
table_file.dimension_ = table_schema.dimension_;
|
||||
table_file.index_file_size_ = table_schema.index_file_size_;
|
||||
table_file.index_params_ = table_schema.index_params_;
|
||||
table_file.metric_type_ = table_schema.metric_type_;
|
||||
collection_file.id_ = std::get<0>(file);
|
||||
collection_file.collection_id_ = std::get<1>(file);
|
||||
collection_file.segment_id_ = std::get<2>(file);
|
||||
collection_file.file_id_ = std::get<3>(file);
|
||||
collection_file.file_type_ = std::get<4>(file);
|
||||
collection_file.row_count_ = std::get<6>(file);
|
||||
collection_file.date_ = std::get<7>(file);
|
||||
collection_file.created_on_ = std::get<8>(file);
|
||||
collection_file.dimension_ = collection_schema.dimension_;
|
||||
collection_file.index_file_size_ = collection_schema.index_file_size_;
|
||||
collection_file.index_params_ = collection_schema.index_params_;
|
||||
collection_file.metric_type_ = collection_schema.metric_type_;
|
||||
|
||||
auto status = utils::GetTableFilePath(options_, table_file);
|
||||
auto status = utils::GetCollectionFilePath(options_, collection_file);
|
||||
if (!status.ok()) {
|
||||
result = status;
|
||||
}
|
||||
|
||||
files.emplace_back(table_file);
|
||||
files.emplace_back(collection_file);
|
||||
++to_merge_files;
|
||||
}
|
||||
|
||||
|
@ -1063,42 +1063,42 @@ SqliteMetaImpl::FilesToIndex(SegmentsSchema& files) {
|
|||
where(c(&SegmentSchema::file_type_) == (int)SegmentSchema::TO_INDEX));
|
||||
|
||||
std::map<std::string, CollectionSchema> groups;
|
||||
SegmentSchema table_file;
|
||||
SegmentSchema collection_file;
|
||||
|
||||
Status ret;
|
||||
for (auto& file : selected) {
|
||||
table_file.id_ = std::get<0>(file);
|
||||
table_file.collection_id_ = std::get<1>(file);
|
||||
table_file.segment_id_ = std::get<2>(file);
|
||||
table_file.file_id_ = std::get<3>(file);
|
||||
table_file.file_type_ = std::get<4>(file);
|
||||
table_file.file_size_ = std::get<5>(file);
|
||||
table_file.row_count_ = std::get<6>(file);
|
||||
table_file.date_ = std::get<7>(file);
|
||||
table_file.engine_type_ = std::get<8>(file);
|
||||
table_file.created_on_ = std::get<9>(file);
|
||||
collection_file.id_ = std::get<0>(file);
|
||||
collection_file.collection_id_ = std::get<1>(file);
|
||||
collection_file.segment_id_ = std::get<2>(file);
|
||||
collection_file.file_id_ = std::get<3>(file);
|
||||
collection_file.file_type_ = std::get<4>(file);
|
||||
collection_file.file_size_ = std::get<5>(file);
|
||||
collection_file.row_count_ = std::get<6>(file);
|
||||
collection_file.date_ = std::get<7>(file);
|
||||
collection_file.engine_type_ = std::get<8>(file);
|
||||
collection_file.created_on_ = std::get<9>(file);
|
||||
|
||||
auto status = utils::GetTableFilePath(options_, table_file);
|
||||
auto status = utils::GetCollectionFilePath(options_, collection_file);
|
||||
if (!status.ok()) {
|
||||
ret = status;
|
||||
}
|
||||
auto groupItr = groups.find(table_file.collection_id_);
|
||||
auto groupItr = groups.find(collection_file.collection_id_);
|
||||
if (groupItr == groups.end()) {
|
||||
CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = table_file.collection_id_;
|
||||
auto status = DescribeCollection(table_schema);
|
||||
fiu_do_on("SqliteMetaImpl_FilesToIndex_TableNotFound",
|
||||
CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_file.collection_id_;
|
||||
auto status = DescribeCollection(collection_schema);
|
||||
fiu_do_on("SqliteMetaImpl_FilesToIndex_CollectionNotFound",
|
||||
status = Status(DB_NOT_FOUND, "collection not found"));
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
}
|
||||
groups[table_file.collection_id_] = table_schema;
|
||||
groups[collection_file.collection_id_] = collection_schema;
|
||||
}
|
||||
table_file.dimension_ = groups[table_file.collection_id_].dimension_;
|
||||
table_file.index_file_size_ = groups[table_file.collection_id_].index_file_size_;
|
||||
table_file.index_params_ = groups[table_file.collection_id_].index_params_;
|
||||
table_file.metric_type_ = groups[table_file.collection_id_].metric_type_;
|
||||
files.push_back(table_file);
|
||||
collection_file.dimension_ = groups[collection_file.collection_id_].dimension_;
|
||||
collection_file.index_file_size_ = groups[collection_file.collection_id_].index_file_size_;
|
||||
collection_file.index_params_ = groups[collection_file.collection_id_].index_params_;
|
||||
collection_file.metric_type_ = groups[collection_file.collection_id_].metric_type_;
|
||||
files.push_back(collection_file);
|
||||
}
|
||||
|
||||
if (selected.size() > 0) {
|
||||
|
@ -1118,9 +1118,9 @@ SqliteMetaImpl::FilesByType(const std::string& collection_id, const std::vector<
|
|||
|
||||
Status ret = Status::OK();
|
||||
|
||||
CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_id;
|
||||
auto status = DescribeCollection(table_schema);
|
||||
CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_id;
|
||||
auto status = DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
}
|
||||
|
@ -1151,10 +1151,10 @@ SqliteMetaImpl::FilesByType(const std::string& collection_id, const std::vector<
|
|||
file_schema.engine_type_ = std::get<7>(file);
|
||||
file_schema.created_on_ = std::get<8>(file);
|
||||
|
||||
file_schema.dimension_ = table_schema.dimension_;
|
||||
file_schema.index_file_size_ = table_schema.index_file_size_;
|
||||
file_schema.index_params_ = table_schema.index_params_;
|
||||
file_schema.metric_type_ = table_schema.metric_type_;
|
||||
file_schema.dimension_ = collection_schema.dimension_;
|
||||
file_schema.index_file_size_ = collection_schema.index_file_size_;
|
||||
file_schema.index_params_ = collection_schema.index_params_;
|
||||
file_schema.metric_type_ = collection_schema.metric_type_;
|
||||
|
||||
switch (file_schema.file_type_) {
|
||||
case (int)SegmentSchema::RAW:++raw_count;
|
||||
|
@ -1174,7 +1174,7 @@ SqliteMetaImpl::FilesByType(const std::string& collection_id, const std::vector<
|
|||
default:break;
|
||||
}
|
||||
|
||||
auto status = utils::GetTableFilePath(options_, file_schema);
|
||||
auto status = utils::GetCollectionFilePath(options_, file_schema);
|
||||
if (!status.ok()) {
|
||||
ret = status;
|
||||
}
|
||||
|
@ -1243,44 +1243,44 @@ SqliteMetaImpl::FilesByID(const std::vector<size_t>& ids, SegmentsSchema& files)
|
|||
auto filter = where(match_fileid and match_type);
|
||||
selected = ConnectorPtr->select(select_columns, filter);
|
||||
|
||||
std::map<std::string, meta::CollectionSchema> tables;
|
||||
std::map<std::string, meta::CollectionSchema> collections;
|
||||
Status ret;
|
||||
for (auto& file : selected) {
|
||||
SegmentSchema table_file;
|
||||
table_file.id_ = std::get<0>(file);
|
||||
table_file.collection_id_ = std::get<1>(file);
|
||||
table_file.segment_id_ = std::get<2>(file);
|
||||
table_file.file_id_ = std::get<3>(file);
|
||||
table_file.file_type_ = std::get<4>(file);
|
||||
table_file.file_size_ = std::get<5>(file);
|
||||
table_file.row_count_ = std::get<6>(file);
|
||||
table_file.date_ = std::get<7>(file);
|
||||
table_file.engine_type_ = std::get<8>(file);
|
||||
SegmentSchema collection_file;
|
||||
collection_file.id_ = std::get<0>(file);
|
||||
collection_file.collection_id_ = std::get<1>(file);
|
||||
collection_file.segment_id_ = std::get<2>(file);
|
||||
collection_file.file_id_ = std::get<3>(file);
|
||||
collection_file.file_type_ = std::get<4>(file);
|
||||
collection_file.file_size_ = std::get<5>(file);
|
||||
collection_file.row_count_ = std::get<6>(file);
|
||||
collection_file.date_ = std::get<7>(file);
|
||||
collection_file.engine_type_ = std::get<8>(file);
|
||||
|
||||
if (tables.find(table_file.collection_id_) == tables.end()) {
|
||||
CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = table_file.collection_id_;
|
||||
auto status = DescribeCollection(table_schema);
|
||||
if (collections.find(collection_file.collection_id_) == collections.end()) {
|
||||
CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_file.collection_id_;
|
||||
auto status = DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
}
|
||||
tables.insert(std::make_pair(table_file.collection_id_, table_schema));
|
||||
collections.insert(std::make_pair(collection_file.collection_id_, collection_schema));
|
||||
}
|
||||
|
||||
auto status = utils::GetTableFilePath(options_, table_file);
|
||||
auto status = utils::GetCollectionFilePath(options_, collection_file);
|
||||
if (!status.ok()) {
|
||||
ret = status;
|
||||
}
|
||||
|
||||
files.emplace_back(table_file);
|
||||
files.emplace_back(collection_file);
|
||||
}
|
||||
|
||||
for (auto& table_file : files) {
|
||||
CollectionSchema& table_schema = tables[table_file.collection_id_];
|
||||
table_file.dimension_ = table_schema.dimension_;
|
||||
table_file.index_file_size_ = table_schema.index_file_size_;
|
||||
table_file.index_params_ = table_schema.index_params_;
|
||||
table_file.metric_type_ = table_schema.metric_type_;
|
||||
for (auto& collection_file : files) {
|
||||
CollectionSchema& collection_schema = collections[collection_file.collection_id_];
|
||||
collection_file.dimension_ = collection_schema.dimension_;
|
||||
collection_file.index_file_size_ = collection_schema.index_file_size_;
|
||||
collection_file.index_params_ = collection_schema.index_params_;
|
||||
collection_file.metric_type_ = collection_schema.metric_type_;
|
||||
}
|
||||
|
||||
if (files.empty()) {
|
||||
|
@ -1400,7 +1400,7 @@ SqliteMetaImpl::CleanUpShadowFiles() {
|
|||
Status
|
||||
SqliteMetaImpl::CleanUpFilesWithTTL(uint64_t seconds /*, CleanUpFilter* filter*/) {
|
||||
auto now = utils::GetMicroSecTimeStamp();
|
||||
std::set<std::string> table_ids;
|
||||
std::set<std::string> collection_ids;
|
||||
std::map<std::string, SegmentSchema> segment_ids;
|
||||
|
||||
// remove to_delete files
|
||||
|
@ -1427,40 +1427,40 @@ SqliteMetaImpl::CleanUpFilesWithTTL(uint64_t seconds /*, CleanUpFilter* filter*/
|
|||
|
||||
int64_t clean_files = 0;
|
||||
auto commited = ConnectorPtr->transaction([&]() mutable {
|
||||
SegmentSchema table_file;
|
||||
SegmentSchema collection_file;
|
||||
for (auto& file : files) {
|
||||
table_file.id_ = std::get<0>(file);
|
||||
table_file.collection_id_ = std::get<1>(file);
|
||||
table_file.segment_id_ = std::get<2>(file);
|
||||
table_file.engine_type_ = std::get<3>(file);
|
||||
table_file.file_id_ = std::get<4>(file);
|
||||
table_file.file_type_ = std::get<5>(file);
|
||||
table_file.date_ = std::get<6>(file);
|
||||
collection_file.id_ = std::get<0>(file);
|
||||
collection_file.collection_id_ = std::get<1>(file);
|
||||
collection_file.segment_id_ = std::get<2>(file);
|
||||
collection_file.engine_type_ = std::get<3>(file);
|
||||
collection_file.file_id_ = std::get<4>(file);
|
||||
collection_file.file_type_ = std::get<5>(file);
|
||||
collection_file.date_ = std::get<6>(file);
|
||||
|
||||
// check if the file can be deleted
|
||||
if (OngoingFileChecker::GetInstance().IsIgnored(table_file)) {
|
||||
ENGINE_LOG_DEBUG << "File:" << table_file.file_id_
|
||||
if (OngoingFileChecker::GetInstance().IsIgnored(collection_file)) {
|
||||
ENGINE_LOG_DEBUG << "File:" << collection_file.file_id_
|
||||
<< " currently is in use, not able to delete now";
|
||||
continue; // ignore this file, don't delete it
|
||||
}
|
||||
|
||||
// erase from cache, must do this before file deleted,
|
||||
// because GetTableFilePath won't able to generate file path after the file is deleted
|
||||
// because GetCollectionFilePath won't able to generate file path after the file is deleted
|
||||
// TODO(zhiru): clean up
|
||||
utils::GetTableFilePath(options_, table_file);
|
||||
server::CommonUtil::EraseFromCache(table_file.location_);
|
||||
utils::GetCollectionFilePath(options_, collection_file);
|
||||
server::CommonUtil::EraseFromCache(collection_file.location_);
|
||||
|
||||
if (table_file.file_type_ == (int)SegmentSchema::TO_DELETE) {
|
||||
if (collection_file.file_type_ == (int)SegmentSchema::TO_DELETE) {
|
||||
// delete file from meta
|
||||
ConnectorPtr->remove<SegmentSchema>(table_file.id_);
|
||||
ConnectorPtr->remove<SegmentSchema>(collection_file.id_);
|
||||
|
||||
// delete file from disk storage
|
||||
utils::DeleteTableFilePath(options_, table_file);
|
||||
utils::DeleteCollectionFilePath(options_, collection_file);
|
||||
|
||||
ENGINE_LOG_DEBUG << "Remove file id:" << table_file.file_id_ << " location:"
|
||||
<< table_file.location_;
|
||||
table_ids.insert(table_file.collection_id_);
|
||||
segment_ids.insert(std::make_pair(table_file.segment_id_, table_file));
|
||||
ENGINE_LOG_DEBUG << "Remove file id:" << collection_file.file_id_ << " location:"
|
||||
<< collection_file.location_;
|
||||
collection_ids.insert(collection_file.collection_id_);
|
||||
segment_ids.insert(std::make_pair(collection_file.segment_id_, collection_file));
|
||||
|
||||
++clean_files;
|
||||
}
|
||||
|
@ -1480,33 +1480,33 @@ SqliteMetaImpl::CleanUpFilesWithTTL(uint64_t seconds /*, CleanUpFilter* filter*/
|
|||
return HandleException("Encounter exception when clean collection files", e.what());
|
||||
}
|
||||
|
||||
// remove to_delete tables
|
||||
// remove to_delete collections
|
||||
try {
|
||||
fiu_do_on("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveTable_ThrowException", throw std::exception());
|
||||
fiu_do_on("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveCollection_ThrowException", throw std::exception());
|
||||
server::MetricCollector metric;
|
||||
|
||||
// multi-threads call sqlite update may get exception('bad logic', etc), so we add a lock here
|
||||
std::lock_guard<std::mutex> meta_lock(meta_mutex_);
|
||||
|
||||
auto tables = ConnectorPtr->select(columns(&CollectionSchema::id_, &CollectionSchema::collection_id_),
|
||||
auto collections = ConnectorPtr->select(columns(&CollectionSchema::id_, &CollectionSchema::collection_id_),
|
||||
where(c(&CollectionSchema::state_) == (int)CollectionSchema::TO_DELETE));
|
||||
|
||||
auto commited = ConnectorPtr->transaction([&]() mutable {
|
||||
for (auto& collection : tables) {
|
||||
utils::DeleteTablePath(options_, std::get<1>(collection), false); // only delete empty folder
|
||||
for (auto& collection : collections) {
|
||||
utils::DeleteCollectionPath(options_, std::get<1>(collection), false); // only delete empty folder
|
||||
ConnectorPtr->remove<CollectionSchema>(std::get<0>(collection));
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
fiu_do_on("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveTable_Failcommited", commited = false);
|
||||
fiu_do_on("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveCollection_Failcommited", commited = false);
|
||||
|
||||
if (!commited) {
|
||||
return HandleException("CleanUpFilesWithTTL error: sqlite transaction failed");
|
||||
}
|
||||
|
||||
if (tables.size() > 0) {
|
||||
ENGINE_LOG_DEBUG << "Remove " << tables.size() << " tables from meta";
|
||||
if (collections.size() > 0) {
|
||||
ENGINE_LOG_DEBUG << "Remove " << collections.size() << " collections from meta";
|
||||
}
|
||||
} catch (std::exception& e) {
|
||||
return HandleException("Encounter exception when clean collection files", e.what());
|
||||
|
@ -1515,28 +1515,28 @@ SqliteMetaImpl::CleanUpFilesWithTTL(uint64_t seconds /*, CleanUpFilter* filter*/
|
|||
// remove deleted collection folder
|
||||
// don't remove collection folder until all its files has been deleted
|
||||
try {
|
||||
fiu_do_on("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveTableFolder_ThrowException", throw std::exception());
|
||||
fiu_do_on("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveCollectionFolder_ThrowException", throw std::exception());
|
||||
server::MetricCollector metric;
|
||||
|
||||
int64_t remove_tables = 0;
|
||||
for (auto& collection_id : table_ids) {
|
||||
int64_t remove_collections = 0;
|
||||
for (auto& collection_id : collection_ids) {
|
||||
auto selected = ConnectorPtr->select(columns(&SegmentSchema::file_id_),
|
||||
where(c(&SegmentSchema::collection_id_) == collection_id));
|
||||
if (selected.size() == 0) {
|
||||
utils::DeleteTablePath(options_, collection_id);
|
||||
++remove_tables;
|
||||
utils::DeleteCollectionPath(options_, collection_id);
|
||||
++remove_collections;
|
||||
}
|
||||
}
|
||||
|
||||
if (remove_tables) {
|
||||
ENGINE_LOG_DEBUG << "Remove " << remove_tables << " tables folder";
|
||||
if (remove_collections) {
|
||||
ENGINE_LOG_DEBUG << "Remove " << remove_collections << " collections folder";
|
||||
}
|
||||
} catch (std::exception& e) {
|
||||
return HandleException("Encounter exception when delete collection folder", e.what());
|
||||
}
|
||||
|
||||
// remove deleted segment folder
|
||||
// don't remove segment folder until all its tablefiles has been deleted
|
||||
// don't remove segment folder until all its files has been deleted
|
||||
try {
|
||||
fiu_do_on("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveSegmentFolder_ThrowException", throw std::exception());
|
||||
server::MetricCollector metric;
|
||||
|
@ -1577,9 +1577,9 @@ SqliteMetaImpl::Count(const std::string& collection_id, uint64_t& result) {
|
|||
columns(&SegmentSchema::row_count_),
|
||||
where(in(&SegmentSchema::file_type_, file_types) and c(&SegmentSchema::collection_id_) == collection_id));
|
||||
|
||||
CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_id;
|
||||
auto status = DescribeCollection(table_schema);
|
||||
CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_id;
|
||||
auto status = DescribeCollection(collection_schema);
|
||||
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
|
@ -1632,17 +1632,17 @@ SqliteMetaImpl::DiscardFiles(int64_t to_discard_size) {
|
|||
order_by(&SegmentSchema::id_), limit(10));
|
||||
|
||||
std::vector<int> ids;
|
||||
SegmentSchema table_file;
|
||||
SegmentSchema collection_file;
|
||||
|
||||
for (auto& file : selected) {
|
||||
if (to_discard_size <= 0)
|
||||
break;
|
||||
table_file.id_ = std::get<0>(file);
|
||||
table_file.file_size_ = std::get<1>(file);
|
||||
ids.push_back(table_file.id_);
|
||||
ENGINE_LOG_DEBUG << "Discard table_file.id=" << table_file.file_id_
|
||||
<< " table_file.size=" << table_file.file_size_;
|
||||
to_discard_size -= table_file.file_size_;
|
||||
collection_file.id_ = std::get<0>(file);
|
||||
collection_file.file_size_ = std::get<1>(file);
|
||||
ids.push_back(collection_file.id_);
|
||||
ENGINE_LOG_DEBUG << "Discard file id=" << collection_file.file_id_
|
||||
<< " file size=" << collection_file.file_size_;
|
||||
to_discard_size -= collection_file.file_size_;
|
||||
}
|
||||
|
||||
if (ids.size() == 0) {
|
||||
|
|
|
@ -31,32 +31,32 @@ class SqliteMetaImpl : public Meta {
|
|||
~SqliteMetaImpl();
|
||||
|
||||
Status
|
||||
CreateCollection(CollectionSchema& table_schema) override;
|
||||
CreateCollection(CollectionSchema& collection_schema) override;
|
||||
|
||||
Status
|
||||
DescribeCollection(CollectionSchema& table_schema) override;
|
||||
DescribeCollection(CollectionSchema& collection_schema) override;
|
||||
|
||||
Status
|
||||
HasCollection(const std::string& collection_id, bool& has_or_not) override;
|
||||
|
||||
Status
|
||||
AllCollections(std::vector<CollectionSchema>& table_schema_array) override;
|
||||
AllCollections(std::vector<CollectionSchema>& collection_schema_array) override;
|
||||
|
||||
Status
|
||||
DropCollection(const std::string& collection_id) override;
|
||||
|
||||
Status
|
||||
DeleteTableFiles(const std::string& collection_id) override;
|
||||
DeleteCollectionFiles(const std::string& collection_id) override;
|
||||
|
||||
Status
|
||||
CreateCollectionFile(SegmentSchema& file_schema) override;
|
||||
|
||||
Status
|
||||
GetTableFiles(const std::string& collection_id, const std::vector<size_t>& ids,
|
||||
SegmentsSchema& table_files) override;
|
||||
GetCollectionFiles(const std::string& collection_id, const std::vector<size_t>& ids,
|
||||
SegmentsSchema& collection_files) override;
|
||||
|
||||
Status
|
||||
GetCollectionFilesBySegmentId(const std::string& segment_id, SegmentsSchema& table_files) override;
|
||||
GetCollectionFilesBySegmentId(const std::string& segment_id, SegmentsSchema& collection_files) override;
|
||||
|
||||
Status
|
||||
UpdateCollectionIndex(const std::string& collection_id, const CollectionIndex& index) override;
|
||||
|
@ -65,7 +65,7 @@ class SqliteMetaImpl : public Meta {
|
|||
UpdateCollectionFlag(const std::string& collection_id, int64_t flag) override;
|
||||
|
||||
Status
|
||||
UpdateTableFlushLSN(const std::string& collection_id, uint64_t flush_lsn) override;
|
||||
UpdateCollectionFlushLSN(const std::string& collection_id, uint64_t flush_lsn) override;
|
||||
|
||||
Status
|
||||
GetCollectionFlushLSN(const std::string& collection_id, uint64_t& flush_lsn) override;
|
||||
|
@ -145,7 +145,7 @@ class SqliteMetaImpl : public Meta {
|
|||
Status
|
||||
NextFileId(std::string& file_id);
|
||||
Status
|
||||
NextTableId(std::string& collection_id);
|
||||
NextCollectionId(std::string& collection_id);
|
||||
Status
|
||||
DiscardFiles(int64_t to_discard_size);
|
||||
|
||||
|
|
|
@ -20,13 +20,13 @@ namespace milvus {
|
|||
namespace grpc {
|
||||
|
||||
static const char* MilvusService_method_names[] = {
|
||||
"/milvus.grpc.MilvusService/CreateTable",
|
||||
"/milvus.grpc.MilvusService/HasTable",
|
||||
"/milvus.grpc.MilvusService/DescribeTable",
|
||||
"/milvus.grpc.MilvusService/CountTable",
|
||||
"/milvus.grpc.MilvusService/ShowTables",
|
||||
"/milvus.grpc.MilvusService/ShowTableInfo",
|
||||
"/milvus.grpc.MilvusService/DropTable",
|
||||
"/milvus.grpc.MilvusService/CreateCollection",
|
||||
"/milvus.grpc.MilvusService/HasCollection",
|
||||
"/milvus.grpc.MilvusService/DescribeCollection",
|
||||
"/milvus.grpc.MilvusService/CountCollection",
|
||||
"/milvus.grpc.MilvusService/ShowCollections",
|
||||
"/milvus.grpc.MilvusService/ShowCollectionInfo",
|
||||
"/milvus.grpc.MilvusService/DropCollection",
|
||||
"/milvus.grpc.MilvusService/CreateIndex",
|
||||
"/milvus.grpc.MilvusService/DescribeIndex",
|
||||
"/milvus.grpc.MilvusService/DropIndex",
|
||||
|
@ -41,7 +41,7 @@ static const char* MilvusService_method_names[] = {
|
|||
"/milvus.grpc.MilvusService/SearchInFiles",
|
||||
"/milvus.grpc.MilvusService/Cmd",
|
||||
"/milvus.grpc.MilvusService/DeleteByID",
|
||||
"/milvus.grpc.MilvusService/PreloadTable",
|
||||
"/milvus.grpc.MilvusService/PreloadCollection",
|
||||
"/milvus.grpc.MilvusService/Flush",
|
||||
"/milvus.grpc.MilvusService/Compact",
|
||||
};
|
||||
|
@ -53,13 +53,13 @@ std::unique_ptr< MilvusService::Stub> MilvusService::NewStub(const std::shared_p
|
|||
}
|
||||
|
||||
MilvusService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel)
|
||||
: channel_(channel), rpcmethod_CreateTable_(MilvusService_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_HasTable_(MilvusService_method_names[1], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_DescribeTable_(MilvusService_method_names[2], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_CountTable_(MilvusService_method_names[3], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_ShowTables_(MilvusService_method_names[4], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_ShowTableInfo_(MilvusService_method_names[5], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_DropTable_(MilvusService_method_names[6], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
: channel_(channel), rpcmethod_CreateCollection_(MilvusService_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_HasCollection_(MilvusService_method_names[1], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_DescribeCollection_(MilvusService_method_names[2], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_CountCollection_(MilvusService_method_names[3], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_ShowCollections_(MilvusService_method_names[4], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_ShowCollectionInfo_(MilvusService_method_names[5], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_DropCollection_(MilvusService_method_names[6], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_CreateIndex_(MilvusService_method_names[7], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_DescribeIndex_(MilvusService_method_names[8], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_DropIndex_(MilvusService_method_names[9], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
|
@ -74,205 +74,205 @@ MilvusService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& chan
|
|||
, rpcmethod_SearchInFiles_(MilvusService_method_names[18], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_Cmd_(MilvusService_method_names[19], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_DeleteByID_(MilvusService_method_names[20], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_PreloadTable_(MilvusService_method_names[21], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_PreloadCollection_(MilvusService_method_names[21], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_Flush_(MilvusService_method_names[22], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_Compact_(MilvusService_method_names[23], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
{}
|
||||
|
||||
::grpc::Status MilvusService::Stub::CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CreateTable_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionSchema& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CreateCollection_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionSchema* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CreateTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionSchema* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CreateTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncCreateTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateTable_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionSchema& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateCollection_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncCreateTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateTable_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionSchema& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateCollection_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::HasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::BoolReply* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_HasTable_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::BoolReply* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_HasCollection_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::HasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_HasTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::BoolReply* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_HasCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::HasTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_HasTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::HasCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_HasCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::HasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_HasTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_HasCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::HasTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_HasTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::HasCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_HasCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* MilvusService::Stub::AsyncHasTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::BoolReply>::Create(channel_.get(), cq, rpcmethod_HasTable_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* MilvusService::Stub::AsyncHasCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::BoolReply>::Create(channel_.get(), cq, rpcmethod_HasCollection_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* MilvusService::Stub::PrepareAsyncHasTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::BoolReply>::Create(channel_.get(), cq, rpcmethod_HasTable_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* MilvusService::Stub::PrepareAsyncHasCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::BoolReply>::Create(channel_.get(), cq, rpcmethod_HasCollection_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::DescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::TableSchema* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DescribeTable_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::CollectionSchema* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DescribeCollection_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionSchema* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DescribeTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableSchema* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::DescribeCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionSchema* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionSchema* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DescribeTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableSchema* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::DescribeCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionSchema* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableSchema>* MilvusService::Stub::AsyncDescribeTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableSchema>::Create(channel_.get(), cq, rpcmethod_DescribeTable_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionSchema>* MilvusService::Stub::AsyncDescribeCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionSchema>::Create(channel_.get(), cq, rpcmethod_DescribeCollection_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableSchema>* MilvusService::Stub::PrepareAsyncDescribeTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableSchema>::Create(channel_.get(), cq, rpcmethod_DescribeTable_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionSchema>* MilvusService::Stub::PrepareAsyncDescribeCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionSchema>::Create(channel_.get(), cq, rpcmethod_DescribeCollection_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::CountTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::TableRowCount* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CountTable_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::CollectionRowCount* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CountCollection_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CountTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CountTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionRowCount* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CountCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CountTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableRowCount* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CountTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::CountCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionRowCount* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CountCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CountTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CountTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionRowCount* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CountCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CountTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableRowCount* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CountTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::CountCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionRowCount* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CountCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableRowCount>* MilvusService::Stub::AsyncCountTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableRowCount>::Create(channel_.get(), cq, rpcmethod_CountTable_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionRowCount>* MilvusService::Stub::AsyncCountCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionRowCount>::Create(channel_.get(), cq, rpcmethod_CountCollection_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableRowCount>* MilvusService::Stub::PrepareAsyncCountTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableRowCount>::Create(channel_.get(), cq, rpcmethod_CountTable_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionRowCount>* MilvusService::Stub::PrepareAsyncCountCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionRowCount>::Create(channel_.get(), cq, rpcmethod_CountCollection_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::ShowTables(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::TableNameList* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ShowTables_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::CollectionNameList* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ShowCollections_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTables(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::TableNameList* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowTables_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::CollectionNameList* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowCollections_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTables(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableNameList* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowTables_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::ShowCollections(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionNameList* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowCollections_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTables(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::TableNameList* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowTables_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::CollectionNameList* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowCollections_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTables(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableNameList* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowTables_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::ShowCollections(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionNameList* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowCollections_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableNameList>* MilvusService::Stub::AsyncShowTablesRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableNameList>::Create(channel_.get(), cq, rpcmethod_ShowTables_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionNameList>* MilvusService::Stub::AsyncShowCollectionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionNameList>::Create(channel_.get(), cq, rpcmethod_ShowCollections_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableNameList>* MilvusService::Stub::PrepareAsyncShowTablesRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableNameList>::Create(channel_.get(), cq, rpcmethod_ShowTables_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionNameList>* MilvusService::Stub::PrepareAsyncShowCollectionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionNameList>::Create(channel_.get(), cq, rpcmethod_ShowCollections_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::ShowTableInfo(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::TableInfo* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ShowTableInfo_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::CollectionInfo* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ShowCollectionInfo_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTableInfo(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableInfo* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowTableInfo_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionInfo* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowCollectionInfo_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTableInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableInfo* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowTableInfo_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::ShowCollectionInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionInfo* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowCollectionInfo_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTableInfo(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableInfo* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowTableInfo_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionInfo* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowCollectionInfo_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTableInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableInfo* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowTableInfo_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::ShowCollectionInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionInfo* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowCollectionInfo_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableInfo>* MilvusService::Stub::AsyncShowTableInfoRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableInfo>::Create(channel_.get(), cq, rpcmethod_ShowTableInfo_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionInfo>* MilvusService::Stub::AsyncShowCollectionInfoRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionInfo>::Create(channel_.get(), cq, rpcmethod_ShowCollectionInfo_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableInfo>* MilvusService::Stub::PrepareAsyncShowTableInfoRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableInfo>::Create(channel_.get(), cq, rpcmethod_ShowTableInfo_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionInfo>* MilvusService::Stub::PrepareAsyncShowCollectionInfoRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionInfo>::Create(channel_.get(), cq, rpcmethod_ShowCollectionInfo_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DropTable_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DropCollection_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DropTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::DropCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DropTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::DropCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropTable_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncDropCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropCollection_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropTable_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncDropCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropCollection_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::milvus::grpc::Status* response) {
|
||||
|
@ -303,11 +303,11 @@ void MilvusService::Stub::experimental_async::CreateIndex(::grpc::ClientContext*
|
|||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateIndex_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::IndexParam* response) {
|
||||
::grpc::Status MilvusService::Stub::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::IndexParam* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DescribeIndex_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::IndexParam* response, std::function<void(::grpc::Status)> f) {
|
||||
void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::IndexParam* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeIndex_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
|
@ -315,7 +315,7 @@ void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContex
|
|||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeIndex_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::IndexParam* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::IndexParam* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeIndex_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
|
@ -323,19 +323,19 @@ void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContex
|
|||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeIndex_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>* MilvusService::Stub::AsyncDescribeIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>* MilvusService::Stub::AsyncDescribeIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::IndexParam>::Create(channel_.get(), cq, rpcmethod_DescribeIndex_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>* MilvusService::Stub::PrepareAsyncDescribeIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>* MilvusService::Stub::PrepareAsyncDescribeIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::IndexParam>::Create(channel_.get(), cq, rpcmethod_DescribeIndex_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::Status* response) {
|
||||
::grpc::Status MilvusService::Stub::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DropIndex_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropIndex_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
|
@ -343,7 +343,7 @@ void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* c
|
|||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropIndex_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropIndex_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
|
@ -351,11 +351,11 @@ void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* c
|
|||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropIndex_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncDropIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncDropIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropIndex_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncDropIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncDropIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropIndex_, context, request, false);
|
||||
}
|
||||
|
||||
|
@ -387,11 +387,11 @@ void MilvusService::Stub::experimental_async::CreatePartition(::grpc::ClientCont
|
|||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreatePartition_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::PartitionList* response) {
|
||||
::grpc::Status MilvusService::Stub::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::PartitionList* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ShowPartitions_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::PartitionList* response, std::function<void(::grpc::Status)> f) {
|
||||
void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::PartitionList* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowPartitions_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
|
@ -399,7 +399,7 @@ void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientConte
|
|||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowPartitions_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::PartitionList* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::PartitionList* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowPartitions_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
|
@ -407,11 +407,11 @@ void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientConte
|
|||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowPartitions_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>* MilvusService::Stub::AsyncShowPartitionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>* MilvusService::Stub::AsyncShowPartitionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::PartitionList>::Create(channel_.get(), cq, rpcmethod_ShowPartitions_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>* MilvusService::Stub::PrepareAsyncShowPartitionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>* MilvusService::Stub::PrepareAsyncShowPartitionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::PartitionList>::Create(channel_.get(), cq, rpcmethod_ShowPartitions_, context, request, false);
|
||||
}
|
||||
|
||||
|
@ -667,32 +667,32 @@ void MilvusService::Stub::experimental_async::DeleteByID(::grpc::ClientContext*
|
|||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DeleteByID_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::PreloadTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_PreloadTable_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_PreloadCollection_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::PreloadTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_PreloadTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_PreloadCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::PreloadTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_PreloadTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::PreloadCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_PreloadCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::PreloadTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_PreloadTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_PreloadCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::PreloadTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_PreloadTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::PreloadCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_PreloadCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncPreloadTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_PreloadTable_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncPreloadCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_PreloadCollection_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncPreloadTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_PreloadTable_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncPreloadCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_PreloadCollection_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::Flush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::milvus::grpc::Status* response) {
|
||||
|
@ -723,11 +723,11 @@ void MilvusService::Stub::experimental_async::Flush(::grpc::ClientContext* conte
|
|||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_Flush_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::Compact(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::Status* response) {
|
||||
::grpc::Status MilvusService::Stub::Compact(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_Compact_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Compact_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
|
@ -735,7 +735,7 @@ void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* con
|
|||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Compact_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Compact_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
|
@ -743,11 +743,11 @@ void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* con
|
|||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Compact_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncCompactRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncCompactRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_Compact_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncCompactRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncCompactRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_Compact_, context, request, false);
|
||||
}
|
||||
|
||||
|
@ -755,38 +755,38 @@ MilvusService::Service::Service() {
|
|||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[0],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableSchema, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::CreateTable), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionSchema, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::CreateCollection), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[1],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::BoolReply>(
|
||||
std::mem_fn(&MilvusService::Service::HasTable), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::BoolReply>(
|
||||
std::mem_fn(&MilvusService::Service::HasCollection), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[2],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::TableSchema>(
|
||||
std::mem_fn(&MilvusService::Service::DescribeTable), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionSchema>(
|
||||
std::mem_fn(&MilvusService::Service::DescribeCollection), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[3],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::TableRowCount>(
|
||||
std::mem_fn(&MilvusService::Service::CountTable), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionRowCount>(
|
||||
std::mem_fn(&MilvusService::Service::CountCollection), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[4],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::Command, ::milvus::grpc::TableNameList>(
|
||||
std::mem_fn(&MilvusService::Service::ShowTables), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::Command, ::milvus::grpc::CollectionNameList>(
|
||||
std::mem_fn(&MilvusService::Service::ShowCollections), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[5],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::TableInfo>(
|
||||
std::mem_fn(&MilvusService::Service::ShowTableInfo), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionInfo>(
|
||||
std::mem_fn(&MilvusService::Service::ShowCollectionInfo), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[6],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::DropTable), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::DropCollection), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[7],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
|
@ -795,12 +795,12 @@ MilvusService::Service::Service() {
|
|||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[8],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::IndexParam>(
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::IndexParam>(
|
||||
std::mem_fn(&MilvusService::Service::DescribeIndex), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[9],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::Status>(
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::DropIndex), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[10],
|
||||
|
@ -810,7 +810,7 @@ MilvusService::Service::Service() {
|
|||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[11],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::PartitionList>(
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::PartitionList>(
|
||||
std::mem_fn(&MilvusService::Service::ShowPartitions), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[12],
|
||||
|
@ -860,8 +860,8 @@ MilvusService::Service::Service() {
|
|||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[21],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::PreloadTable), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::PreloadCollection), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[22],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
|
@ -870,56 +870,56 @@ MilvusService::Service::Service() {
|
|||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[23],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::Status>(
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::Compact), this)));
|
||||
}
|
||||
|
||||
MilvusService::Service::~Service() {
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response) {
|
||||
::grpc::Status MilvusService::Service::CreateCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionSchema* request, ::milvus::grpc::Status* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response) {
|
||||
::grpc::Status MilvusService::Service::HasCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::BoolReply* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response) {
|
||||
::grpc::Status MilvusService::Service::DescribeCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionSchema* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::CountTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response) {
|
||||
::grpc::Status MilvusService::Service::CountCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionRowCount* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::TableNameList* response) {
|
||||
::grpc::Status MilvusService::Service::ShowCollections(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::CollectionNameList* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::ShowTableInfo(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableInfo* response) {
|
||||
::grpc::Status MilvusService::Service::ShowCollectionInfo(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionInfo* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) {
|
||||
::grpc::Status MilvusService::Service::DropCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
|
@ -933,14 +933,14 @@ MilvusService::Service::~Service() {
|
|||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::DescribeIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::IndexParam* response) {
|
||||
::grpc::Status MilvusService::Service::DescribeIndex(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::IndexParam* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::DropIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) {
|
||||
::grpc::Status MilvusService::Service::DropIndex(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
|
@ -954,7 +954,7 @@ MilvusService::Service::~Service() {
|
|||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::ShowPartitions(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::PartitionList* response) {
|
||||
::grpc::Status MilvusService::Service::ShowPartitions(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::PartitionList* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
|
@ -1024,7 +1024,7 @@ MilvusService::Service::~Service() {
|
|||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::PreloadTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) {
|
||||
::grpc::Status MilvusService::Service::PreloadCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
|
@ -1038,7 +1038,7 @@ MilvusService::Service::~Service() {
|
|||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::Compact(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) {
|
||||
::grpc::Status MilvusService::Service::Compact(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -61,21 +61,21 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] =
|
|||
const char descriptor_table_protodef_status_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
|
||||
"\n\014status.proto\022\013milvus.grpc\"D\n\006Status\022*\n"
|
||||
"\nerror_code\030\001 \001(\0162\026.milvus.grpc.ErrorCod"
|
||||
"e\022\016\n\006reason\030\002 \001(\t*\230\004\n\tErrorCode\022\013\n\007SUCCE"
|
||||
"e\022\016\n\006reason\030\002 \001(\t*\242\004\n\tErrorCode\022\013\n\007SUCCE"
|
||||
"SS\020\000\022\024\n\020UNEXPECTED_ERROR\020\001\022\022\n\016CONNECT_FA"
|
||||
"ILED\020\002\022\025\n\021PERMISSION_DENIED\020\003\022\024\n\020TABLE_N"
|
||||
"OT_EXISTS\020\004\022\024\n\020ILLEGAL_ARGUMENT\020\005\022\025\n\021ILL"
|
||||
"EGAL_DIMENSION\020\007\022\026\n\022ILLEGAL_INDEX_TYPE\020\010"
|
||||
"\022\026\n\022ILLEGAL_TABLE_NAME\020\t\022\020\n\014ILLEGAL_TOPK"
|
||||
"\020\n\022\025\n\021ILLEGAL_ROWRECORD\020\013\022\025\n\021ILLEGAL_VEC"
|
||||
"TOR_ID\020\014\022\031\n\025ILLEGAL_SEARCH_RESULT\020\r\022\022\n\016F"
|
||||
"ILE_NOT_FOUND\020\016\022\017\n\013META_FAILED\020\017\022\020\n\014CACH"
|
||||
"E_FAILED\020\020\022\030\n\024CANNOT_CREATE_FOLDER\020\021\022\026\n\022"
|
||||
"CANNOT_CREATE_FILE\020\022\022\030\n\024CANNOT_DELETE_FO"
|
||||
"LDER\020\023\022\026\n\022CANNOT_DELETE_FILE\020\024\022\025\n\021BUILD_"
|
||||
"INDEX_ERROR\020\025\022\021\n\rILLEGAL_NLIST\020\026\022\027\n\023ILLE"
|
||||
"GAL_METRIC_TYPE\020\027\022\021\n\rOUT_OF_MEMORY\020\030b\006pr"
|
||||
"oto3"
|
||||
"ILED\020\002\022\025\n\021PERMISSION_DENIED\020\003\022\031\n\025COLLECT"
|
||||
"ION_NOT_EXISTS\020\004\022\024\n\020ILLEGAL_ARGUMENT\020\005\022\025"
|
||||
"\n\021ILLEGAL_DIMENSION\020\007\022\026\n\022ILLEGAL_INDEX_T"
|
||||
"YPE\020\010\022\033\n\027ILLEGAL_COLLECTION_NAME\020\t\022\020\n\014IL"
|
||||
"LEGAL_TOPK\020\n\022\025\n\021ILLEGAL_ROWRECORD\020\013\022\025\n\021I"
|
||||
"LLEGAL_VECTOR_ID\020\014\022\031\n\025ILLEGAL_SEARCH_RES"
|
||||
"ULT\020\r\022\022\n\016FILE_NOT_FOUND\020\016\022\017\n\013META_FAILED"
|
||||
"\020\017\022\020\n\014CACHE_FAILED\020\020\022\030\n\024CANNOT_CREATE_FO"
|
||||
"LDER\020\021\022\026\n\022CANNOT_CREATE_FILE\020\022\022\030\n\024CANNOT"
|
||||
"_DELETE_FOLDER\020\023\022\026\n\022CANNOT_DELETE_FILE\020\024"
|
||||
"\022\025\n\021BUILD_INDEX_ERROR\020\025\022\021\n\rILLEGAL_NLIST"
|
||||
"\020\026\022\027\n\023ILLEGAL_METRIC_TYPE\020\027\022\021\n\rOUT_OF_ME"
|
||||
"MORY\020\030b\006proto3"
|
||||
;
|
||||
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_status_2eproto_deps[1] = {
|
||||
};
|
||||
|
@ -85,7 +85,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_sta
|
|||
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_status_2eproto_once;
|
||||
static bool descriptor_table_status_2eproto_initialized = false;
|
||||
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_status_2eproto = {
|
||||
&descriptor_table_status_2eproto_initialized, descriptor_table_protodef_status_2eproto, "status.proto", 644,
|
||||
&descriptor_table_status_2eproto_initialized, descriptor_table_protodef_status_2eproto, "status.proto", 654,
|
||||
&descriptor_table_status_2eproto_once, descriptor_table_status_2eproto_sccs, descriptor_table_status_2eproto_deps, 1, 0,
|
||||
schemas, file_default_instances, TableStruct_status_2eproto::offsets,
|
||||
file_level_metadata_status_2eproto, 1, file_level_enum_descriptors_status_2eproto, file_level_service_descriptors_status_2eproto,
|
||||
|
|
|
@ -73,11 +73,11 @@ enum ErrorCode : int {
|
|||
UNEXPECTED_ERROR = 1,
|
||||
CONNECT_FAILED = 2,
|
||||
PERMISSION_DENIED = 3,
|
||||
TABLE_NOT_EXISTS = 4,
|
||||
COLLECTION_NOT_EXISTS = 4,
|
||||
ILLEGAL_ARGUMENT = 5,
|
||||
ILLEGAL_DIMENSION = 7,
|
||||
ILLEGAL_INDEX_TYPE = 8,
|
||||
ILLEGAL_TABLE_NAME = 9,
|
||||
ILLEGAL_COLLECTION_NAME = 9,
|
||||
ILLEGAL_TOPK = 10,
|
||||
ILLEGAL_ROWRECORD = 11,
|
||||
ILLEGAL_VECTOR_ID = 12,
|
||||
|
|
|
@ -13,27 +13,27 @@ message KeyValuePair {
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Table name
|
||||
* @brief Collection name
|
||||
*/
|
||||
message TableName {
|
||||
string table_name = 1;
|
||||
message CollectionName {
|
||||
string collection_name = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Table name list
|
||||
* @brief Collection name list
|
||||
*/
|
||||
message TableNameList {
|
||||
message CollectionNameList {
|
||||
Status status = 1;
|
||||
repeated string table_names = 2;
|
||||
repeated string collection_names = 2;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Table schema
|
||||
* @brief Collection schema
|
||||
* metric_type: 1-L2, 2-IP
|
||||
*/
|
||||
message TableSchema {
|
||||
message CollectionSchema {
|
||||
Status status = 1;
|
||||
string table_name = 2;
|
||||
string collection_name = 2;
|
||||
int64 dimension = 3;
|
||||
int64 index_file_size = 4;
|
||||
int32 metric_type = 5;
|
||||
|
@ -44,7 +44,7 @@ message TableSchema {
|
|||
* @brief Params of partition
|
||||
*/
|
||||
message PartitionParam {
|
||||
string table_name = 1;
|
||||
string collection_name = 1;
|
||||
string tag = 2;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ message RowRecord {
|
|||
* @brief Params to be inserted
|
||||
*/
|
||||
message InsertParam {
|
||||
string table_name = 1;
|
||||
string collection_name = 1;
|
||||
repeated RowRecord row_record_array = 2;
|
||||
repeated int64 row_id_array = 3; //optional
|
||||
string partition_tag = 4;
|
||||
|
@ -87,7 +87,7 @@ message VectorIds {
|
|||
* @brief Params for searching vector
|
||||
*/
|
||||
message SearchParam {
|
||||
string table_name = 1;
|
||||
string collection_name = 1;
|
||||
repeated string partition_tag_array = 2;
|
||||
repeated RowRecord query_record_array = 3;
|
||||
int64 topk = 4;
|
||||
|
@ -106,7 +106,7 @@ message SearchInFilesParam {
|
|||
* @brief Params for searching vector by ID
|
||||
*/
|
||||
message SearchByIDParam {
|
||||
string table_name = 1;
|
||||
string collection_name = 1;
|
||||
repeated string partition_tag_array = 2;
|
||||
int64 id = 3;
|
||||
int64 topk = 4;
|
||||
|
@ -140,11 +140,11 @@ message BoolReply {
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Return table row count
|
||||
* @brief Return collection row count
|
||||
*/
|
||||
message TableRowCount {
|
||||
message CollectionRowCount {
|
||||
Status status = 1;
|
||||
int64 table_row_count = 2;
|
||||
int64 collection_row_count = 2;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -160,7 +160,7 @@ message Command {
|
|||
*/
|
||||
message IndexParam {
|
||||
Status status = 1;
|
||||
string table_name = 2;
|
||||
string collection_name = 2;
|
||||
int32 index_type = 3;
|
||||
repeated KeyValuePair extra_params = 4;
|
||||
}
|
||||
|
@ -169,14 +169,14 @@ message IndexParam {
|
|||
* @brief Flush params
|
||||
*/
|
||||
message FlushParam {
|
||||
repeated string table_name_array = 1;
|
||||
repeated string collection_name_array = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Flush params
|
||||
*/
|
||||
message DeleteByIDParam {
|
||||
string table_name = 1;
|
||||
string collection_name = 1;
|
||||
repeated int64 id_array = 2;
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ message SegmentStat {
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief table statistics
|
||||
* @brief collection statistics
|
||||
*/
|
||||
message PartitionStat {
|
||||
string tag = 1;
|
||||
|
@ -200,9 +200,9 @@ message PartitionStat {
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief table information
|
||||
* @brief collection information
|
||||
*/
|
||||
message TableInfo {
|
||||
message CollectionInfo {
|
||||
Status status = 1;
|
||||
int64 total_row_count = 2;
|
||||
repeated PartitionStat partitions_stat = 3;
|
||||
|
@ -212,7 +212,7 @@ message TableInfo {
|
|||
* @brief vector identity
|
||||
*/
|
||||
message VectorIdentity {
|
||||
string table_name = 1;
|
||||
string collection_name = 1;
|
||||
int64 id = 2;
|
||||
}
|
||||
|
||||
|
@ -228,76 +228,76 @@ message VectorData {
|
|||
* @brief get vector ids from a segment parameters
|
||||
*/
|
||||
message GetVectorIDsParam {
|
||||
string table_name = 1;
|
||||
string collection_name = 1;
|
||||
string segment_name = 2;
|
||||
}
|
||||
|
||||
service MilvusService {
|
||||
/**
|
||||
* @brief This method is used to create table
|
||||
* @brief This method is used to create collection
|
||||
*
|
||||
* @param TableSchema, use to provide table information to be created.
|
||||
* @param CollectionSchema, use to provide collection information to be created.
|
||||
*
|
||||
* @return Status
|
||||
*/
|
||||
rpc CreateTable(TableSchema) returns (Status){}
|
||||
rpc CreateCollection(CollectionSchema) returns (Status){}
|
||||
|
||||
/**
|
||||
* @brief This method is used to test table existence.
|
||||
* @brief This method is used to test collection existence.
|
||||
*
|
||||
* @param TableName, table name is going to be tested.
|
||||
* @param CollectionName, collection name is going to be tested.
|
||||
*
|
||||
* @return BoolReply
|
||||
*/
|
||||
rpc HasTable(TableName) returns (BoolReply) {}
|
||||
rpc HasCollection(CollectionName) returns (BoolReply) {}
|
||||
|
||||
/**
|
||||
* @brief This method is used to get table schema.
|
||||
* @brief This method is used to get collection schema.
|
||||
*
|
||||
* @param TableName, target table name.
|
||||
* @param CollectionName, target collection name.
|
||||
*
|
||||
* @return TableSchema
|
||||
* @return CollectionSchema
|
||||
*/
|
||||
rpc DescribeTable(TableName) returns (TableSchema) {}
|
||||
rpc DescribeCollection(CollectionName) returns (CollectionSchema) {}
|
||||
|
||||
/**
|
||||
* @brief This method is used to get table schema.
|
||||
* @brief This method is used to get collection schema.
|
||||
*
|
||||
* @param TableName, target table name.
|
||||
* @param CollectionName, target collection name.
|
||||
*
|
||||
* @return TableRowCount
|
||||
* @return CollectionRowCount
|
||||
*/
|
||||
rpc CountTable(TableName) returns (TableRowCount) {}
|
||||
rpc CountCollection(CollectionName) returns (CollectionRowCount) {}
|
||||
|
||||
/**
|
||||
* @brief This method is used to list all tables.
|
||||
* @brief This method is used to list all collections.
|
||||
*
|
||||
* @param Command, dummy parameter.
|
||||
*
|
||||
* @return TableNameList
|
||||
* @return CollectionNameList
|
||||
*/
|
||||
rpc ShowTables(Command) returns (TableNameList) {}
|
||||
rpc ShowCollections(Command) returns (CollectionNameList) {}
|
||||
|
||||
/**
|
||||
* @brief This method is used to get table detail information.
|
||||
* @brief This method is used to get collection detail information.
|
||||
*
|
||||
* @param TableName, target table name.
|
||||
* @param CollectionName, target collection name.
|
||||
*
|
||||
* @return TableInfo
|
||||
* @return CollectionInfo
|
||||
*/
|
||||
rpc ShowTableInfo(TableName) returns (TableInfo) {}
|
||||
rpc ShowCollectionInfo(CollectionName) returns (CollectionInfo) {}
|
||||
|
||||
/**
|
||||
* @brief This method is used to delete table.
|
||||
* @brief This method is used to delete collection.
|
||||
*
|
||||
* @param TableName, table name is going to be deleted.
|
||||
* @param CollectionName, collection name is going to be deleted.
|
||||
*
|
||||
* @return TableNameList
|
||||
* @return CollectionNameList
|
||||
*/
|
||||
rpc DropTable(TableName) returns (Status) {}
|
||||
rpc DropCollection(CollectionName) returns (Status) {}
|
||||
|
||||
/**
|
||||
* @brief This method is used to build index by table in sync mode.
|
||||
* @brief This method is used to build index by collection in sync mode.
|
||||
*
|
||||
* @param IndexParam, index paramters.
|
||||
*
|
||||
|
@ -308,20 +308,20 @@ service MilvusService {
|
|||
/**
|
||||
* @brief This method is used to describe index
|
||||
*
|
||||
* @param TableName, target table name.
|
||||
* @param CollectionName, target collection name.
|
||||
*
|
||||
* @return IndexParam
|
||||
*/
|
||||
rpc DescribeIndex(TableName) returns (IndexParam) {}
|
||||
rpc DescribeIndex(CollectionName) returns (IndexParam) {}
|
||||
|
||||
/**
|
||||
* @brief This method is used to drop index
|
||||
*
|
||||
* @param TableName, target table name.
|
||||
* @param CollectionName, target collection name.
|
||||
*
|
||||
* @return Status
|
||||
*/
|
||||
rpc DropIndex(TableName) returns (Status) {}
|
||||
rpc DropIndex(CollectionName) returns (Status) {}
|
||||
|
||||
/**
|
||||
* @brief This method is used to create partition
|
||||
|
@ -335,11 +335,11 @@ service MilvusService {
|
|||
/**
|
||||
* @brief This method is used to show partition information
|
||||
*
|
||||
* @param TableName, target table name.
|
||||
* @param CollectionName, target collection name.
|
||||
*
|
||||
* @return PartitionList
|
||||
*/
|
||||
rpc ShowPartitions(TableName) returns (PartitionList) {}
|
||||
rpc ShowPartitions(CollectionName) returns (PartitionList) {}
|
||||
|
||||
/**
|
||||
* @brief This method is used to drop partition
|
||||
|
@ -351,7 +351,7 @@ service MilvusService {
|
|||
rpc DropPartition(PartitionParam) returns (Status) {}
|
||||
|
||||
/**
|
||||
* @brief This method is used to add vector array to table.
|
||||
* @brief This method is used to add vector array to collection.
|
||||
*
|
||||
* @param InsertParam, insert parameters.
|
||||
*
|
||||
|
@ -371,14 +371,14 @@ service MilvusService {
|
|||
/**
|
||||
* @brief This method is used to get vector ids from a segment
|
||||
*
|
||||
* @param GetVectorIDsParam, target table and segment
|
||||
* @param GetVectorIDsParam, target collection and segment
|
||||
*
|
||||
* @return VectorIds
|
||||
*/
|
||||
rpc GetVectorIDs(GetVectorIDsParam) returns (VectorIds) {}
|
||||
|
||||
/**
|
||||
* @brief This method is used to query vector in table.
|
||||
* @brief This method is used to query vector in collection.
|
||||
*
|
||||
* @param SearchParam, search parameters.
|
||||
*
|
||||
|
@ -423,13 +423,13 @@ service MilvusService {
|
|||
rpc DeleteByID(DeleteByIDParam) returns (Status) {}
|
||||
|
||||
/**
|
||||
* @brief This method is used to preload table
|
||||
* @brief This method is used to preload collection
|
||||
*
|
||||
* @param TableName, target table name.
|
||||
* @param CollectionName, target collection name.
|
||||
*
|
||||
* @return Status
|
||||
*/
|
||||
rpc PreloadTable(TableName) returns (Status) {}
|
||||
rpc PreloadCollection(CollectionName) returns (Status) {}
|
||||
|
||||
/**
|
||||
* @brief This method is used to flush buffer into storage.
|
||||
|
@ -441,11 +441,11 @@ service MilvusService {
|
|||
rpc Flush(FlushParam) returns (Status) {}
|
||||
|
||||
/**
|
||||
* @brief This method is used to compact table
|
||||
* @brief This method is used to compact collection
|
||||
*
|
||||
* @param TableName, target table name.
|
||||
* @param CollectionName, target collection name.
|
||||
*
|
||||
* @return Status
|
||||
*/
|
||||
rpc Compact(TableName) returns (Status) {}
|
||||
rpc Compact(CollectionName) returns (Status) {}
|
||||
}
|
||||
|
|
|
@ -7,11 +7,11 @@ enum ErrorCode {
|
|||
UNEXPECTED_ERROR = 1;
|
||||
CONNECT_FAILED = 2;
|
||||
PERMISSION_DENIED = 3;
|
||||
TABLE_NOT_EXISTS = 4;
|
||||
COLLECTION_NOT_EXISTS = 4;
|
||||
ILLEGAL_ARGUMENT = 5;
|
||||
ILLEGAL_DIMENSION = 7;
|
||||
ILLEGAL_INDEX_TYPE = 8;
|
||||
ILLEGAL_TABLE_NAME = 9;
|
||||
ILLEGAL_COLLECTION_NAME = 9;
|
||||
ILLEGAL_TOPK = 10;
|
||||
ILLEGAL_ROWRECORD = 11;
|
||||
ILLEGAL_VECTOR_ID = 12;
|
||||
|
|
|
@ -27,7 +27,7 @@ void
|
|||
DeleteJob::WaitAndDelete() {
|
||||
std::unique_lock<std::mutex> lock(mutex_);
|
||||
cv_.wait(lock, [&] { return done_resource == num_resource_; });
|
||||
meta_ptr_->DeleteTableFiles(collection_id_);
|
||||
meta_ptr_->DeleteCollectionFiles(collection_id_);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -130,7 +130,7 @@ BaseRequest::set_status(const Status& status) {
|
|||
}
|
||||
|
||||
std::string
|
||||
BaseRequest::TableNotExistMsg(const std::string& collection_name) {
|
||||
BaseRequest::CollectionNotExistMsg(const std::string& collection_name) {
|
||||
return "Collection " + collection_name +
|
||||
" does not exist. Use milvus.has_collection to verify whether the collection exists. "
|
||||
"You also can check whether the collection name exists.";
|
||||
|
|
|
@ -209,7 +209,7 @@ class BaseRequest {
|
|||
OnPostExecute();
|
||||
|
||||
std::string
|
||||
TableNotExistMsg(const std::string& collection_name);
|
||||
CollectionNotExistMsg(const std::string& collection_name);
|
||||
|
||||
protected:
|
||||
const std::shared_ptr<milvus::server::Context> context_;
|
||||
|
|
|
@ -49,18 +49,18 @@ CompactRequest::OnExecute() {
|
|||
}
|
||||
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,18 +46,18 @@ CountCollectionRequest::OnExecute() {
|
|||
}
|
||||
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ CountCollectionRequest::OnExecute() {
|
|||
fiu_do_on("CountCollectionRequest.OnExecute.throw_std_exception", throw std::exception());
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -93,13 +93,13 @@ CreateCollectionRequest::OnExecute() {
|
|||
// step 3: create collection
|
||||
status = DBWrapper::DB()->CreateCollection(collection_info);
|
||||
fiu_do_on("CreateCollectionRequest.OnExecute.db_already_exist", status = Status(milvus::DB_ALREADY_EXIST, ""));
|
||||
fiu_do_on("CreateCollectionRequest.OnExecute.create_table_fail",
|
||||
fiu_do_on("CreateCollectionRequest.OnExecute.create_collection_fail",
|
||||
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
fiu_do_on("CreateCollectionRequest.OnExecute.throw_std_exception", throw std::exception());
|
||||
if (!status.ok()) {
|
||||
// collection could exist
|
||||
if (status.code() == DB_ALREADY_EXIST) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, status.message());
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, status.message());
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -52,21 +52,21 @@ CreateIndexRequest::OnExecute() {
|
|||
}
|
||||
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
fiu_do_on("CreateIndexRequest.OnExecute.not_has_collection",
|
||||
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
fiu_do_on("CreateIndexRequest.OnExecute.throw_std.exception", throw std::exception());
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ CreateIndexRequest::OnExecute() {
|
|||
return status;
|
||||
}
|
||||
|
||||
status = ValidationUtil::ValidateIndexParams(json_params_, table_schema, index_type_);
|
||||
status = ValidationUtil::ValidateIndexParams(json_params_, collection_schema, index_type_);
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ CreatePartitionRequest::OnExecute() {
|
|||
try {
|
||||
// step 1: check arguments
|
||||
auto status = ValidationUtil::ValidateCollectionName(collection_name_);
|
||||
fiu_do_on("CreatePartitionRequest.OnExecute.invalid_table_name",
|
||||
fiu_do_on("CreatePartitionRequest.OnExecute.invalid_collection_name",
|
||||
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
|
@ -59,20 +59,20 @@ CreatePartitionRequest::OnExecute() {
|
|||
}
|
||||
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
fiu_do_on("CreatePartitionRequest.OnExecute.invalid_partition_tags",
|
||||
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ CreatePartitionRequest::OnExecute() {
|
|||
if (!status.ok()) {
|
||||
// partition could exist
|
||||
if (status.code() == DB_ALREADY_EXIST) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, status.message());
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, status.message());
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -52,26 +52,26 @@ DeleteByIDRequest::OnExecute() {
|
|||
}
|
||||
|
||||
// step 2: check collection existence
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
// Check collection's index type supports delete
|
||||
if (table_schema.engine_type_ == (int32_t)engine::EngineType::SPTAG_BKT ||
|
||||
table_schema.engine_type_ == (int32_t)engine::EngineType::SPTAG_KDT) {
|
||||
if (collection_schema.engine_type_ == (int32_t)engine::EngineType::SPTAG_BKT ||
|
||||
collection_schema.engine_type_ == (int32_t)engine::EngineType::SPTAG_KDT) {
|
||||
std::string err_msg =
|
||||
"Index type " + std::to_string(table_schema.engine_type_) + " does not support delete operation";
|
||||
"Index type " + std::to_string(collection_schema.engine_type_) + " does not support delete operation";
|
||||
SERVER_LOG_ERROR << err_msg;
|
||||
return Status(SERVER_UNSUPPORTED_ERROR, err_msg);
|
||||
}
|
||||
|
|
|
@ -46,28 +46,28 @@ DescribeCollectionRequest::OnExecute() {
|
|||
|
||||
// step 2: get collection info
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
fiu_do_on("DescribeCollectionRequest.OnExecute.describe_table_fail",
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
fiu_do_on("DescribeCollectionRequest.OnExecute.describe_collection_fail",
|
||||
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
fiu_do_on("DescribeCollectionRequest.OnExecute.throw_std_exception", throw std::exception());
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
schema_.collection_name_ = table_schema.collection_id_;
|
||||
schema_.dimension_ = static_cast<int64_t>(table_schema.dimension_);
|
||||
schema_.index_file_size_ = table_schema.index_file_size_;
|
||||
schema_.metric_type_ = table_schema.metric_type_;
|
||||
schema_.collection_name_ = collection_schema.collection_id_;
|
||||
schema_.dimension_ = static_cast<int64_t>(collection_schema.dimension_);
|
||||
schema_.index_file_size_ = collection_schema.index_file_size_;
|
||||
schema_.metric_type_ = collection_schema.metric_type_;
|
||||
} catch (std::exception& ex) {
|
||||
return Status(SERVER_UNEXPECTED_ERROR, ex.what());
|
||||
}
|
||||
|
|
|
@ -46,18 +46,18 @@ DescribeIndexRequest::OnExecute() {
|
|||
}
|
||||
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,22 +47,22 @@ DropCollectionRequest::OnExecute() {
|
|||
|
||||
// step 2: check collection existence
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
fiu_do_on("DropCollectionRequest.OnExecute.db_not_found", status = Status(milvus::DB_NOT_FOUND, ""));
|
||||
fiu_do_on("DropCollectionRequest.OnExecute.describe_table_fail",
|
||||
fiu_do_on("DropCollectionRequest.OnExecute.describe_collection_fail",
|
||||
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
fiu_do_on("DropCollectionRequest.OnExecute.throw_std_exception", throw std::exception());
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ DropCollectionRequest::OnExecute() {
|
|||
|
||||
// step 3: Drop collection
|
||||
status = DBWrapper::DB()->DropCollection(collection_name_);
|
||||
fiu_do_on("DropCollectionRequest.OnExecute.drop_table_fail",
|
||||
fiu_do_on("DropCollectionRequest.OnExecute.drop_collection_fail",
|
||||
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
|
|
|
@ -45,19 +45,20 @@ DropIndexRequest::OnExecute() {
|
|||
}
|
||||
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
fiu_do_on("DropIndexRequest.OnExecute.table_not_exist", status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
fiu_do_on("DropIndexRequest.OnExecute.collection_not_exist",
|
||||
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ DropPartitionRequest::OnExecute() {
|
|||
|
||||
// step 1: check collection name
|
||||
auto status = ValidationUtil::ValidateCollectionName(collection_name);
|
||||
fiu_do_on("DropPartitionRequest.OnExecute.invalid_table_name",
|
||||
fiu_do_on("DropPartitionRequest.OnExecute.invalid_collection_name",
|
||||
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
|
@ -53,7 +53,7 @@ DropPartitionRequest::OnExecute() {
|
|||
if (partition_tag == milvus::engine::DEFAULT_PARTITON_TAG) {
|
||||
std::string msg = "Default partition cannot be dropped.";
|
||||
SERVER_LOG_ERROR << msg;
|
||||
return Status(SERVER_INVALID_TABLE_NAME, msg);
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, msg);
|
||||
}
|
||||
|
||||
status = ValidationUtil::ValidatePartitionTags({partition_tag});
|
||||
|
@ -63,18 +63,18 @@ DropPartitionRequest::OnExecute() {
|
|||
|
||||
// step 3: check collection
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ FlushRequest::Create(const std::shared_ptr<milvus::server::Context>& context,
|
|||
|
||||
Status
|
||||
FlushRequest::OnExecute() {
|
||||
std::string hdr = "FlushRequest flush tables: ";
|
||||
std::string hdr = "FlushRequest flush collections: ";
|
||||
for (auto& name : collection_names_) {
|
||||
hdr += name;
|
||||
hdr += ", ";
|
||||
|
@ -51,18 +51,18 @@ FlushRequest::OnExecute() {
|
|||
|
||||
for (auto& name : collection_names_) {
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = name;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = name;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(name));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(name));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(name));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(name));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,18 +60,18 @@ GetVectorByIDRequest::OnExecute() {
|
|||
}
|
||||
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,18 +55,18 @@ GetVectorIDsRequest::OnExecute() {
|
|||
}
|
||||
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,16 +46,16 @@ HasCollectionRequest::OnExecute() {
|
|||
return status;
|
||||
}
|
||||
|
||||
// step 2: check table existence
|
||||
// step 2: check collection existence
|
||||
status = DBWrapper::DB()->HasNativeCollection(collection_name_, has_collection_);
|
||||
fiu_do_on("HasCollectionRequest.OnExecute.throw_std_exception", throw std::exception());
|
||||
|
||||
// only process root collection, ignore partition collection
|
||||
if (has_collection_) {
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
has_collection_ = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,25 +77,26 @@ InsertRequest::OnExecute() {
|
|||
|
||||
// step 2: check collection existence
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
fiu_do_on("InsertRequest.OnExecute.db_not_found", status = Status(milvus::DB_NOT_FOUND, ""));
|
||||
fiu_do_on("InsertRequest.OnExecute.describe_table_fail", status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
fiu_do_on("InsertRequest.OnExecute.describe_collection_fail",
|
||||
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
SERVER_LOG_ERROR << LogOut("[%s][%ld] Collection %s not found", "insert", 0, collection_name_.c_str());
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
SERVER_LOG_ERROR << LogOut("[%s][%ld] Describe collection %s fail: %s", "insert", 0,
|
||||
collection_name_.c_str(), status.message().c_str());
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
SERVER_LOG_ERROR << LogOut("[%s][%ld] owner collection of %s is empty", "insert", 0,
|
||||
collection_name_.c_str());
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,18 +104,18 @@ InsertRequest::OnExecute() {
|
|||
// all user provide id, or all internal id
|
||||
bool user_provide_ids = !vectors_data_.id_array_.empty();
|
||||
fiu_do_on("InsertRequest.OnExecute.illegal_vector_id", user_provide_ids = false;
|
||||
table_schema.flag_ = engine::meta::FLAG_MASK_HAS_USERID);
|
||||
collection_schema.flag_ = engine::meta::FLAG_MASK_HAS_USERID);
|
||||
// user already provided id before, all insert action require user id
|
||||
if ((table_schema.flag_ & engine::meta::FLAG_MASK_HAS_USERID) != 0 && !user_provide_ids) {
|
||||
if ((collection_schema.flag_ & engine::meta::FLAG_MASK_HAS_USERID) != 0 && !user_provide_ids) {
|
||||
std::string msg = "Entities IDs are user-defined. Please provide IDs for all entities of the collection.";
|
||||
SERVER_LOG_ERROR << LogOut("[%s][%ld] %s", "insert", 0, msg.c_str());
|
||||
return Status(SERVER_ILLEGAL_VECTOR_ID, msg);
|
||||
}
|
||||
|
||||
fiu_do_on("InsertRequest.OnExecute.illegal_vector_id2", user_provide_ids = true;
|
||||
table_schema.flag_ = engine::meta::FLAG_MASK_NO_USERID);
|
||||
collection_schema.flag_ = engine::meta::FLAG_MASK_NO_USERID);
|
||||
// user didn't provided id before, no need to provide user id
|
||||
if ((table_schema.flag_ & engine::meta::FLAG_MASK_NO_USERID) != 0 && user_provide_ids) {
|
||||
if ((collection_schema.flag_ & engine::meta::FLAG_MASK_NO_USERID) != 0 && user_provide_ids) {
|
||||
std::string msg =
|
||||
"Entities IDs are auto-generated. All vectors of this collection must use auto-generated IDs.";
|
||||
return Status(SERVER_ILLEGAL_VECTOR_ID, msg);
|
||||
|
@ -128,7 +129,7 @@ InsertRequest::OnExecute() {
|
|||
#endif
|
||||
// step 4: some metric type doesn't support float vectors
|
||||
if (!vectors_data_.float_data_.empty()) { // insert float vectors
|
||||
if (engine::utils::IsBinaryMetricType(table_schema.metric_type_)) {
|
||||
if (engine::utils::IsBinaryMetricType(collection_schema.metric_type_)) {
|
||||
std::string msg = "Collection metric type doesn't support float vectors.";
|
||||
SERVER_LOG_ERROR << LogOut("[%s][%ld] %s", "insert", 0, msg.c_str());
|
||||
return Status(SERVER_INVALID_ROWRECORD_ARRAY, msg);
|
||||
|
@ -141,14 +142,14 @@ InsertRequest::OnExecute() {
|
|||
return Status(SERVER_INVALID_ROWRECORD_ARRAY, msg);
|
||||
}
|
||||
|
||||
fiu_do_on("InsertRequest.OnExecute.invalid_dim", table_schema.dimension_ = -1);
|
||||
if (vectors_data_.float_data_.size() / vector_count != table_schema.dimension_) {
|
||||
fiu_do_on("InsertRequest.OnExecute.invalid_dim", collection_schema.dimension_ = -1);
|
||||
if (vectors_data_.float_data_.size() / vector_count != collection_schema.dimension_) {
|
||||
std::string msg = "The vector dimension must be equal to the collection dimension.";
|
||||
SERVER_LOG_ERROR << LogOut("[%s][%ld] %s", "insert", 0, msg.c_str());
|
||||
return Status(SERVER_INVALID_VECTOR_DIMENSION, msg);
|
||||
}
|
||||
} else if (!vectors_data_.binary_data_.empty()) { // insert binary vectors
|
||||
if (!engine::utils::IsBinaryMetricType(table_schema.metric_type_)) {
|
||||
if (!engine::utils::IsBinaryMetricType(collection_schema.metric_type_)) {
|
||||
std::string msg = "Collection metric type doesn't support binary vectors.";
|
||||
SERVER_LOG_ERROR << LogOut("[%s][%ld] %s", "insert", 0, msg.c_str());
|
||||
return Status(SERVER_INVALID_ROWRECORD_ARRAY, msg);
|
||||
|
@ -161,7 +162,7 @@ InsertRequest::OnExecute() {
|
|||
return Status(SERVER_INVALID_ROWRECORD_ARRAY, msg);
|
||||
}
|
||||
|
||||
if (vectors_data_.binary_data_.size() * 8 / vector_count != table_schema.dimension_) {
|
||||
if (vectors_data_.binary_data_.size() * 8 / vector_count != collection_schema.dimension_) {
|
||||
std::string msg = "The vector dimension must be equal to the collection dimension.";
|
||||
SERVER_LOG_ERROR << LogOut("[%s][%ld] %s", "insert", 0, msg.c_str());
|
||||
return Status(SERVER_INVALID_VECTOR_DIMENSION, msg);
|
||||
|
@ -189,9 +190,9 @@ InsertRequest::OnExecute() {
|
|||
}
|
||||
|
||||
// step 6: update collection flag
|
||||
user_provide_ids ? table_schema.flag_ |= engine::meta::FLAG_MASK_HAS_USERID
|
||||
: table_schema.flag_ |= engine::meta::FLAG_MASK_NO_USERID;
|
||||
status = DBWrapper::DB()->UpdateCollectionFlag(collection_name_, table_schema.flag_);
|
||||
user_provide_ids ? collection_schema.flag_ |= engine::meta::FLAG_MASK_HAS_USERID
|
||||
: collection_schema.flag_ |= engine::meta::FLAG_MASK_NO_USERID;
|
||||
status = DBWrapper::DB()->UpdateCollectionFlag(collection_name_, collection_schema.flag_);
|
||||
|
||||
#ifdef MILVUS_ENABLE_PROFILING
|
||||
ProfilerStop();
|
||||
|
|
|
@ -45,24 +45,24 @@ PreloadCollectionRequest::OnExecute() {
|
|||
}
|
||||
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
// step 2: check collection existence
|
||||
status = DBWrapper::DB()->PreloadCollection(collection_name_);
|
||||
fiu_do_on("PreloadCollectionRequest.OnExecute.preload_table_fail",
|
||||
fiu_do_on("PreloadCollectionRequest.OnExecute.preload_collection_fail",
|
||||
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
fiu_do_on("PreloadCollectionRequest.OnExecute.throw_std_exception", throw std::exception());
|
||||
if (!status.ok()) {
|
||||
|
|
|
@ -80,23 +80,23 @@ SearchByIDRequest::OnExecute() {
|
|||
|
||||
// step 4: check collection existence
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
// step 5: check search parameters
|
||||
status = ValidationUtil::ValidateSearchParams(extra_params_, table_schema, topk_);
|
||||
status = ValidationUtil::ValidateSearchParams(extra_params_, collection_schema, topk_);
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
}
|
||||
|
@ -118,13 +118,13 @@ SearchByIDRequest::OnExecute() {
|
|||
#endif
|
||||
|
||||
// step 7: check collection's index type supports search by id
|
||||
if (table_schema.engine_type_ != (int32_t)engine::EngineType::FAISS_IDMAP &&
|
||||
table_schema.engine_type_ != (int32_t)engine::EngineType::FAISS_BIN_IDMAP &&
|
||||
table_schema.engine_type_ != (int32_t)engine::EngineType::FAISS_IVFFLAT &&
|
||||
table_schema.engine_type_ != (int32_t)engine::EngineType::FAISS_BIN_IVFFLAT &&
|
||||
table_schema.engine_type_ != (int32_t)engine::EngineType::FAISS_IVFSQ8) {
|
||||
std::string err_msg =
|
||||
"Index type " + std::to_string(table_schema.engine_type_) + " does not support SearchByID operation";
|
||||
if (collection_schema.engine_type_ != (int32_t)engine::EngineType::FAISS_IDMAP &&
|
||||
collection_schema.engine_type_ != (int32_t)engine::EngineType::FAISS_BIN_IDMAP &&
|
||||
collection_schema.engine_type_ != (int32_t)engine::EngineType::FAISS_IVFFLAT &&
|
||||
collection_schema.engine_type_ != (int32_t)engine::EngineType::FAISS_BIN_IVFFLAT &&
|
||||
collection_schema.engine_type_ != (int32_t)engine::EngineType::FAISS_IVFSQ8) {
|
||||
std::string err_msg = "Index type " + std::to_string(collection_schema.engine_type_) +
|
||||
" does not support SearchByID operation";
|
||||
SERVER_LOG_ERROR << err_msg;
|
||||
return Status(SERVER_UNSUPPORTED_ERROR, err_msg);
|
||||
}
|
||||
|
|
|
@ -239,15 +239,15 @@ SearchCombineRequest::OnExecute() {
|
|||
|
||||
TimeRecorderAuto rc(hdr);
|
||||
|
||||
// step 1: check table existence
|
||||
// only process root table, ignore partition table
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
auto status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
// step 1: check collection existence
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
auto status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
status = Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
status = Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
FreeRequests(status);
|
||||
return status;
|
||||
} else {
|
||||
|
@ -255,8 +255,8 @@ SearchCombineRequest::OnExecute() {
|
|||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
status = Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
status = Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
FreeRequests(status);
|
||||
return status;
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ SearchCombineRequest::OnExecute() {
|
|||
continue;
|
||||
}
|
||||
|
||||
status = ValidationUtil::ValidateSearchParams(extra_params_, table_schema, request->TopK());
|
||||
status = ValidationUtil::ValidateSearchParams(extra_params_, collection_schema, request->TopK());
|
||||
if (!status.ok()) {
|
||||
// check failed, erase request and let it return error status
|
||||
FreeRequest(request, status);
|
||||
|
@ -283,7 +283,7 @@ SearchCombineRequest::OnExecute() {
|
|||
continue;
|
||||
}
|
||||
|
||||
status = ValidationUtil::ValidateVectorData(request->VectorsData(), table_schema);
|
||||
status = ValidationUtil::ValidateVectorData(request->VectorsData(), collection_schema);
|
||||
if (!status.ok()) {
|
||||
// check failed, erase request and let it return error status
|
||||
FreeRequest(request, status);
|
||||
|
@ -325,7 +325,7 @@ SearchCombineRequest::OnExecute() {
|
|||
}
|
||||
vectors_data_.vector_count_ = total_count;
|
||||
|
||||
uint16_t dimension = table_schema.dimension_;
|
||||
uint16_t dimension = collection_schema.dimension_;
|
||||
bool is_float = true;
|
||||
if (!first_request->VectorsData().float_data_.empty()) {
|
||||
vectors_data_.float_data_.resize(total_count * dimension);
|
||||
|
|
|
@ -59,7 +59,7 @@ SearchRequest::OnPreExecute() {
|
|||
TimeRecorderAuto rc(LogOut("[%s][%ld] %s", "search", 0, hdr.c_str()));
|
||||
|
||||
milvus::server::ContextChild tracer_pre(context_, "Pre Query");
|
||||
// step 1: check table name
|
||||
// step 1: check collection name
|
||||
auto status = ValidationUtil::ValidateCollectionName(collection_name_);
|
||||
if (!status.ok()) {
|
||||
SERVER_LOG_ERROR << LogOut("[%s][%d] %s", "search", 0, status.message().c_str());
|
||||
|
@ -94,17 +94,18 @@ SearchRequest::OnExecute() {
|
|||
", nq=" + std::to_string(vector_count) + ", k=" + std::to_string(topk_) + ")";
|
||||
TimeRecorderAuto rc(LogOut("[%s][%d] %s", "search", 0, hdr.c_str()));
|
||||
|
||||
// step 4: check table existence
|
||||
// only process root table, ignore partition table
|
||||
// step 4: check collection existence
|
||||
// only process root collection, ignore partition collection
|
||||
collection_schema_.collection_id_ = collection_name_;
|
||||
auto status = DBWrapper::DB()->DescribeCollection(collection_schema_);
|
||||
|
||||
fiu_do_on("SearchRequest.OnExecute.describe_table_fail", status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
fiu_do_on("SearchRequest.OnExecute.describe_collection_fail",
|
||||
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
SERVER_LOG_ERROR << LogOut("[%s][%d] Collection %s not found: %s", "search", 0,
|
||||
collection_name_.c_str(), status.message().c_str());
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
SERVER_LOG_ERROR << LogOut("[%s][%d] Error occurred when describing collection %s: %s", "search", 0,
|
||||
collection_name_.c_str(), status.message().c_str());
|
||||
|
@ -112,8 +113,8 @@ SearchRequest::OnExecute() {
|
|||
}
|
||||
} else {
|
||||
if (!collection_schema_.owner_collection_.empty()) {
|
||||
SERVER_LOG_ERROR << LogOut("[%s][%d] %s", "search", 0, TableNotExistMsg(collection_name_).c_str());
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
SERVER_LOG_ERROR << LogOut("[%s][%d] %s", "search", 0, CollectionNotExistMsg(collection_name_).c_str());
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,18 +70,18 @@ ShowCollectionInfoRequest::OnExecute() {
|
|||
|
||||
// step 2: check collection existence
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,14 +23,14 @@ namespace milvus {
|
|||
namespace server {
|
||||
|
||||
ShowCollectionsRequest::ShowCollectionsRequest(const std::shared_ptr<milvus::server::Context>& context,
|
||||
std::vector<std::string>& table_name_list)
|
||||
: BaseRequest(context, BaseRequest::kShowCollections), table_name_list_(table_name_list) {
|
||||
std::vector<std::string>& collection_name_list)
|
||||
: BaseRequest(context, BaseRequest::kShowCollections), collection_name_list_(collection_name_list) {
|
||||
}
|
||||
|
||||
BaseRequestPtr
|
||||
ShowCollectionsRequest::Create(const std::shared_ptr<milvus::server::Context>& context,
|
||||
std::vector<std::string>& table_name_list) {
|
||||
return std::shared_ptr<BaseRequest>(new ShowCollectionsRequest(context, table_name_list));
|
||||
std::vector<std::string>& collection_name_list) {
|
||||
return std::shared_ptr<BaseRequest>(new ShowCollectionsRequest(context, collection_name_list));
|
||||
}
|
||||
|
||||
Status
|
||||
|
@ -39,14 +39,14 @@ ShowCollectionsRequest::OnExecute() {
|
|||
|
||||
std::vector<engine::meta::CollectionSchema> schema_array;
|
||||
auto status = DBWrapper::DB()->AllCollections(schema_array);
|
||||
fiu_do_on("ShowCollectionsRequest.OnExecute.show_tables_fail",
|
||||
fiu_do_on("ShowCollectionsRequest.OnExecute.show_collections_fail",
|
||||
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
}
|
||||
|
||||
for (auto& schema : schema_array) {
|
||||
table_name_list_.push_back(schema.collection_id_);
|
||||
collection_name_list_.push_back(schema.collection_id_);
|
||||
}
|
||||
return Status::OK();
|
||||
}
|
||||
|
|
|
@ -23,17 +23,17 @@ namespace server {
|
|||
class ShowCollectionsRequest : public BaseRequest {
|
||||
public:
|
||||
static BaseRequestPtr
|
||||
Create(const std::shared_ptr<milvus::server::Context>& context, std::vector<std::string>& table_name_list);
|
||||
Create(const std::shared_ptr<milvus::server::Context>& context, std::vector<std::string>& collection_name_list);
|
||||
|
||||
protected:
|
||||
ShowCollectionsRequest(const std::shared_ptr<milvus::server::Context>& context,
|
||||
std::vector<std::string>& table_name_list);
|
||||
std::vector<std::string>& collection_name_list);
|
||||
|
||||
Status
|
||||
OnExecute() override;
|
||||
|
||||
private:
|
||||
std::vector<std::string>& table_name_list_;
|
||||
std::vector<std::string>& collection_name_list_;
|
||||
};
|
||||
|
||||
} // namespace server
|
||||
|
|
|
@ -43,7 +43,7 @@ ShowPartitionsRequest::OnExecute() {
|
|||
|
||||
// step 1: check collection name
|
||||
auto status = ValidationUtil::ValidateCollectionName(collection_name_);
|
||||
fiu_do_on("ShowPartitionsRequest.OnExecute.invalid_table_name",
|
||||
fiu_do_on("ShowPartitionsRequest.OnExecute.invalid_collection_name",
|
||||
status = Status(milvus::SERVER_UNEXPECTED_ERROR, ""));
|
||||
if (!status.ok()) {
|
||||
return status;
|
||||
|
@ -51,18 +51,18 @@ ShowPartitionsRequest::OnExecute() {
|
|||
|
||||
// step 2: check collection existence
|
||||
// only process root collection, ignore partition collection
|
||||
engine::meta::CollectionSchema table_schema;
|
||||
table_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(table_schema);
|
||||
engine::meta::CollectionSchema collection_schema;
|
||||
collection_schema.collection_id_ = collection_name_;
|
||||
status = DBWrapper::DB()->DescribeCollection(collection_schema);
|
||||
if (!status.ok()) {
|
||||
if (status.code() == DB_NOT_FOUND) {
|
||||
return Status(SERVER_TABLE_NOT_EXIST, TableNotExistMsg(collection_name_));
|
||||
return Status(SERVER_COLLECTION_NOT_EXIST, CollectionNotExistMsg(collection_name_));
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
} else {
|
||||
if (!table_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_TABLE_NAME, TableNotExistMsg(collection_name_));
|
||||
if (!collection_schema.owner_collection_.empty()) {
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, CollectionNotExistMsg(collection_name_));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,9 +39,9 @@ ErrorMap(ErrorCode code) {
|
|||
{SERVER_CANNOT_CREATE_FILE, ::milvus::grpc::ErrorCode::CANNOT_CREATE_FILE},
|
||||
{SERVER_CANNOT_DELETE_FOLDER, ::milvus::grpc::ErrorCode::CANNOT_DELETE_FOLDER},
|
||||
{SERVER_CANNOT_DELETE_FILE, ::milvus::grpc::ErrorCode::CANNOT_DELETE_FILE},
|
||||
{SERVER_TABLE_NOT_EXIST, ::milvus::grpc::ErrorCode::TABLE_NOT_EXISTS},
|
||||
{SERVER_INVALID_TABLE_NAME, ::milvus::grpc::ErrorCode::ILLEGAL_TABLE_NAME},
|
||||
{SERVER_INVALID_TABLE_DIMENSION, ::milvus::grpc::ErrorCode::ILLEGAL_DIMENSION},
|
||||
{SERVER_COLLECTION_NOT_EXIST, ::milvus::grpc::ErrorCode::COLLECTION_NOT_EXISTS},
|
||||
{SERVER_INVALID_COLLECTION_NAME, ::milvus::grpc::ErrorCode::ILLEGAL_COLLECTION_NAME},
|
||||
{SERVER_INVALID_COLLECTION_DIMENSION, ::milvus::grpc::ErrorCode::ILLEGAL_DIMENSION},
|
||||
{SERVER_INVALID_VECTOR_DIMENSION, ::milvus::grpc::ErrorCode::ILLEGAL_DIMENSION},
|
||||
|
||||
{SERVER_INVALID_INDEX_TYPE, ::milvus::grpc::ErrorCode::ILLEGAL_INDEX_TYPE},
|
||||
|
@ -143,7 +143,7 @@ ConstructPartitionStat(const PartitionStat& partition_stat, ::milvus::grpc::Part
|
|||
}
|
||||
|
||||
void
|
||||
ConstructTableInfo(const CollectionInfo& collection_info, ::milvus::grpc::TableInfo* response) {
|
||||
ConstructCollectionInfo(const CollectionInfo& collection_info, ::milvus::grpc::CollectionInfo* response) {
|
||||
if (!response) {
|
||||
return;
|
||||
}
|
||||
|
@ -239,12 +239,12 @@ GrpcRequestHandler::random_id() const {
|
|||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
::grpc::Status
|
||||
GrpcRequestHandler::CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request,
|
||||
::milvus::grpc::Status* response) {
|
||||
GrpcRequestHandler::CreateCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionSchema* request,
|
||||
::milvus::grpc::Status* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
Status status =
|
||||
request_handler_.CreateCollection(context_map_[context], request->table_name(), request->dimension(),
|
||||
request_handler_.CreateCollection(context_map_[context], request->collection_name(), request->dimension(),
|
||||
request->index_file_size(), request->metric_type());
|
||||
SET_RESPONSE(response, status, context);
|
||||
|
||||
|
@ -252,13 +252,13 @@ GrpcRequestHandler::CreateTable(::grpc::ServerContext* context, const ::milvus::
|
|||
}
|
||||
|
||||
::grpc::Status
|
||||
GrpcRequestHandler::HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
::milvus::grpc::BoolReply* response) {
|
||||
GrpcRequestHandler::HasCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::BoolReply* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
bool has_collection = false;
|
||||
|
||||
Status status = request_handler_.HasCollection(context_map_[context], request->table_name(), has_collection);
|
||||
Status status = request_handler_.HasCollection(context_map_[context], request->collection_name(), has_collection);
|
||||
response->set_bool_reply(has_collection);
|
||||
SET_RESPONSE(response->mutable_status(), status, context);
|
||||
|
||||
|
@ -266,11 +266,11 @@ GrpcRequestHandler::HasTable(::grpc::ServerContext* context, const ::milvus::grp
|
|||
}
|
||||
|
||||
::grpc::Status
|
||||
GrpcRequestHandler::DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
::milvus::grpc::Status* response) {
|
||||
GrpcRequestHandler::DropCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::Status* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
Status status = request_handler_.DropCollection(context_map_[context], request->table_name());
|
||||
Status status = request_handler_.DropCollection(context_map_[context], request->collection_name());
|
||||
|
||||
SET_RESPONSE(response, status, context);
|
||||
return ::grpc::Status::OK;
|
||||
|
@ -289,8 +289,8 @@ GrpcRequestHandler::CreateIndex(::grpc::ServerContext* context, const ::milvus::
|
|||
}
|
||||
}
|
||||
|
||||
Status status =
|
||||
request_handler_.CreateIndex(context_map_[context], request->table_name(), request->index_type(), json_params);
|
||||
Status status = request_handler_.CreateIndex(context_map_[context], request->collection_name(),
|
||||
request->index_type(), json_params);
|
||||
|
||||
SET_RESPONSE(response, status, context);
|
||||
return ::grpc::Status::OK;
|
||||
|
@ -309,7 +309,7 @@ GrpcRequestHandler::Insert(::grpc::ServerContext* context, const ::milvus::grpc:
|
|||
|
||||
// step 2: insert vectors
|
||||
Status status =
|
||||
request_handler_.Insert(context_map_[context], request->table_name(), vectors, request->partition_tag());
|
||||
request_handler_.Insert(context_map_[context], request->collection_name(), vectors, request->partition_tag());
|
||||
|
||||
// step 3: return id array
|
||||
response->mutable_vector_id_array()->Resize(static_cast<int>(vectors.id_array_.size()), 0);
|
||||
|
@ -328,7 +328,8 @@ GrpcRequestHandler::GetVectorByID(::grpc::ServerContext* context, const ::milvus
|
|||
|
||||
std::vector<int64_t> vector_ids = {request->id()};
|
||||
engine::VectorsData vectors;
|
||||
Status status = request_handler_.GetVectorByID(context_map_[context], request->table_name(), vector_ids, vectors);
|
||||
Status status =
|
||||
request_handler_.GetVectorByID(context_map_[context], request->collection_name(), vector_ids, vectors);
|
||||
|
||||
if (!vectors.float_data_.empty()) {
|
||||
response->mutable_vector_data()->mutable_float_data()->Resize(vectors.float_data_.size(), 0);
|
||||
|
@ -350,8 +351,8 @@ GrpcRequestHandler::GetVectorIDs(::grpc::ServerContext* context, const ::milvus:
|
|||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
std::vector<int64_t> vector_ids;
|
||||
Status status = request_handler_.GetVectorIDs(context_map_[context], request->table_name(), request->segment_name(),
|
||||
vector_ids);
|
||||
Status status = request_handler_.GetVectorIDs(context_map_[context], request->collection_name(),
|
||||
request->segment_name(), vector_ids);
|
||||
|
||||
if (!vector_ids.empty()) {
|
||||
response->mutable_vector_id_array()->Resize(vector_ids.size(), -1);
|
||||
|
@ -392,7 +393,7 @@ GrpcRequestHandler::Search(::grpc::ServerContext* context, const ::milvus::grpc:
|
|||
std::vector<std::string> file_ids;
|
||||
TopKQueryResult result;
|
||||
fiu_do_on("GrpcRequestHandler.Search.not_empty_file_ids", file_ids.emplace_back("test_file_id"));
|
||||
Status status = request_handler_.Search(context_map_[context], request->table_name(), vectors, request->topk(),
|
||||
Status status = request_handler_.Search(context_map_[context], request->collection_name(), vectors, request->topk(),
|
||||
json_params, partitions, file_ids, result);
|
||||
|
||||
// step 5: construct and return result
|
||||
|
@ -427,7 +428,7 @@ GrpcRequestHandler::SearchByID(::grpc::ServerContext* context, const ::milvus::g
|
|||
|
||||
// step 3: search vectors
|
||||
TopKQueryResult result;
|
||||
Status status = request_handler_.SearchByID(context_map_[context], request->table_name(), request->id(),
|
||||
Status status = request_handler_.SearchByID(context_map_[context], request->collection_name(), request->id(),
|
||||
request->topk(), json_params, partitions, result);
|
||||
|
||||
// step 4: construct and return result
|
||||
|
@ -473,7 +474,7 @@ GrpcRequestHandler::SearchInFiles(::grpc::ServerContext* context, const ::milvus
|
|||
|
||||
// step 5: search vectors
|
||||
TopKQueryResult result;
|
||||
Status status = request_handler_.Search(context_map_[context], search_request->table_name(), vectors,
|
||||
Status status = request_handler_.Search(context_map_[context], search_request->collection_name(), vectors,
|
||||
search_request->topk(), json_params, partitions, file_ids, result);
|
||||
|
||||
// step 6: construct and return result
|
||||
|
@ -485,42 +486,43 @@ GrpcRequestHandler::SearchInFiles(::grpc::ServerContext* context, const ::milvus
|
|||
}
|
||||
|
||||
::grpc::Status
|
||||
GrpcRequestHandler::DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
::milvus::grpc::TableSchema* response) {
|
||||
GrpcRequestHandler::DescribeCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::CollectionSchema* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
CollectionSchema table_schema;
|
||||
Status status = request_handler_.DescribeCollection(context_map_[context], request->table_name(), table_schema);
|
||||
response->set_table_name(table_schema.collection_name_);
|
||||
response->set_dimension(table_schema.dimension_);
|
||||
response->set_index_file_size(table_schema.index_file_size_);
|
||||
response->set_metric_type(table_schema.metric_type_);
|
||||
CollectionSchema collection_schema;
|
||||
Status status =
|
||||
request_handler_.DescribeCollection(context_map_[context], request->collection_name(), collection_schema);
|
||||
response->set_collection_name(collection_schema.collection_name_);
|
||||
response->set_dimension(collection_schema.dimension_);
|
||||
response->set_index_file_size(collection_schema.index_file_size_);
|
||||
response->set_metric_type(collection_schema.metric_type_);
|
||||
|
||||
SET_RESPONSE(response->mutable_status(), status, context);
|
||||
return ::grpc::Status::OK;
|
||||
}
|
||||
|
||||
::grpc::Status
|
||||
GrpcRequestHandler::CountTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
::milvus::grpc::TableRowCount* response) {
|
||||
GrpcRequestHandler::CountCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::CollectionRowCount* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
int64_t row_count = 0;
|
||||
Status status = request_handler_.CountCollection(context_map_[context], request->table_name(), row_count);
|
||||
response->set_table_row_count(row_count);
|
||||
Status status = request_handler_.CountCollection(context_map_[context], request->collection_name(), row_count);
|
||||
response->set_collection_row_count(row_count);
|
||||
SET_RESPONSE(response->mutable_status(), status, context);
|
||||
return ::grpc::Status::OK;
|
||||
}
|
||||
|
||||
::grpc::Status
|
||||
GrpcRequestHandler::ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request,
|
||||
::milvus::grpc::TableNameList* response) {
|
||||
GrpcRequestHandler::ShowCollections(::grpc::ServerContext* context, const ::milvus::grpc::Command* request,
|
||||
::milvus::grpc::CollectionNameList* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
std::vector<std::string> tables;
|
||||
Status status = request_handler_.ShowCollections(context_map_[context], tables);
|
||||
for (auto& collection : tables) {
|
||||
response->add_table_names(collection);
|
||||
std::vector<std::string> collections;
|
||||
Status status = request_handler_.ShowCollections(context_map_[context], collections);
|
||||
for (auto& collection : collections) {
|
||||
response->add_collection_names(collection);
|
||||
}
|
||||
SET_RESPONSE(response->mutable_status(), status, context);
|
||||
|
||||
|
@ -528,13 +530,14 @@ GrpcRequestHandler::ShowTables(::grpc::ServerContext* context, const ::milvus::g
|
|||
}
|
||||
|
||||
::grpc::Status
|
||||
GrpcRequestHandler::ShowTableInfo(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
::milvus::grpc::TableInfo* response) {
|
||||
GrpcRequestHandler::ShowCollectionInfo(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::CollectionInfo* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
CollectionInfo collection_info;
|
||||
Status status = request_handler_.ShowCollectionInfo(context_map_[context], request->table_name(), collection_info);
|
||||
ConstructTableInfo(collection_info, response);
|
||||
Status status =
|
||||
request_handler_.ShowCollectionInfo(context_map_[context], request->collection_name(), collection_info);
|
||||
ConstructCollectionInfo(collection_info, response);
|
||||
SET_RESPONSE(response->mutable_status(), status, context);
|
||||
|
||||
return ::grpc::Status::OK;
|
||||
|
@ -565,31 +568,31 @@ GrpcRequestHandler::DeleteByID(::grpc::ServerContext* context, const ::milvus::g
|
|||
}
|
||||
|
||||
// step 2: delete vector
|
||||
Status status = request_handler_.DeleteByID(context_map_[context], request->table_name(), vector_ids);
|
||||
Status status = request_handler_.DeleteByID(context_map_[context], request->collection_name(), vector_ids);
|
||||
SET_RESPONSE(response, status, context);
|
||||
|
||||
return ::grpc::Status::OK;
|
||||
}
|
||||
|
||||
::grpc::Status
|
||||
GrpcRequestHandler::PreloadTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
::milvus::grpc::Status* response) {
|
||||
GrpcRequestHandler::PreloadCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::Status* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
Status status = request_handler_.PreloadCollection(context_map_[context], request->table_name());
|
||||
Status status = request_handler_.PreloadCollection(context_map_[context], request->collection_name());
|
||||
SET_RESPONSE(response, status, context);
|
||||
|
||||
return ::grpc::Status::OK;
|
||||
}
|
||||
|
||||
::grpc::Status
|
||||
GrpcRequestHandler::DescribeIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
GrpcRequestHandler::DescribeIndex(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::IndexParam* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
IndexParam param;
|
||||
Status status = request_handler_.DescribeIndex(context_map_[context], request->table_name(), param);
|
||||
response->set_table_name(param.collection_name_);
|
||||
Status status = request_handler_.DescribeIndex(context_map_[context], request->collection_name(), param);
|
||||
response->set_collection_name(param.collection_name_);
|
||||
response->set_index_type(param.index_type_);
|
||||
::milvus::grpc::KeyValuePair* kv = response->add_extra_params();
|
||||
kv->set_key(EXTRA_PARAM_KEY);
|
||||
|
@ -600,11 +603,11 @@ GrpcRequestHandler::DescribeIndex(::grpc::ServerContext* context, const ::milvus
|
|||
}
|
||||
|
||||
::grpc::Status
|
||||
GrpcRequestHandler::DropIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
GrpcRequestHandler::DropIndex(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::Status* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
Status status = request_handler_.DropIndex(context_map_[context], request->table_name());
|
||||
Status status = request_handler_.DropIndex(context_map_[context], request->collection_name());
|
||||
SET_RESPONSE(response, status, context);
|
||||
|
||||
return ::grpc::Status::OK;
|
||||
|
@ -615,19 +618,19 @@ GrpcRequestHandler::CreatePartition(::grpc::ServerContext* context, const ::milv
|
|||
::milvus::grpc::Status* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
Status status = request_handler_.CreatePartition(context_map_[context], request->table_name(), request->tag());
|
||||
Status status = request_handler_.CreatePartition(context_map_[context], request->collection_name(), request->tag());
|
||||
SET_RESPONSE(response, status, context);
|
||||
|
||||
return ::grpc::Status::OK;
|
||||
}
|
||||
|
||||
::grpc::Status
|
||||
GrpcRequestHandler::ShowPartitions(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
GrpcRequestHandler::ShowPartitions(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::PartitionList* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
std::vector<PartitionParam> partitions;
|
||||
Status status = request_handler_.ShowPartitions(context_map_[context], request->table_name(), partitions);
|
||||
Status status = request_handler_.ShowPartitions(context_map_[context], request->collection_name(), partitions);
|
||||
for (auto& partition : partitions) {
|
||||
response->add_partition_tag_array(partition.tag_);
|
||||
}
|
||||
|
@ -642,7 +645,7 @@ GrpcRequestHandler::DropPartition(::grpc::ServerContext* context, const ::milvus
|
|||
::milvus::grpc::Status* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
Status status = request_handler_.DropPartition(context_map_[context], request->table_name(), request->tag());
|
||||
Status status = request_handler_.DropPartition(context_map_[context], request->collection_name(), request->tag());
|
||||
SET_RESPONSE(response, status, context);
|
||||
|
||||
return ::grpc::Status::OK;
|
||||
|
@ -654,8 +657,8 @@ GrpcRequestHandler::Flush(::grpc::ServerContext* context, const ::milvus::grpc::
|
|||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
std::vector<std::string> collection_names;
|
||||
for (int32_t i = 0; i < request->table_name_array().size(); i++) {
|
||||
collection_names.push_back(request->table_name_array(i));
|
||||
for (int32_t i = 0; i < request->collection_name_array().size(); i++) {
|
||||
collection_names.push_back(request->collection_name_array(i));
|
||||
}
|
||||
Status status = request_handler_.Flush(context_map_[context], collection_names);
|
||||
SET_RESPONSE(response, status, context);
|
||||
|
@ -664,11 +667,11 @@ GrpcRequestHandler::Flush(::grpc::ServerContext* context, const ::milvus::grpc::
|
|||
}
|
||||
|
||||
::grpc::Status
|
||||
GrpcRequestHandler::Compact(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
GrpcRequestHandler::Compact(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::Status* response) {
|
||||
CHECK_NULLPTR_RETURN(request);
|
||||
|
||||
Status status = request_handler_.Compact(context_map_[context], request->table_name());
|
||||
Status status = request_handler_.Compact(context_map_[context], request->collection_name());
|
||||
SET_RESPONSE(response, status, context);
|
||||
|
||||
return ::grpc::Status::OK;
|
||||
|
|
|
@ -82,12 +82,12 @@ class GrpcRequestHandler final : public ::milvus::grpc::MilvusService::Service,
|
|||
// *
|
||||
// @brief This method is used to create collection
|
||||
//
|
||||
// @param TableSchema, use to provide collection information to be created.
|
||||
// @param CollectionSchema, use to provide collection information to be created.
|
||||
//
|
||||
// @return Status
|
||||
::grpc::Status
|
||||
CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request,
|
||||
::milvus::grpc::Status* response) override;
|
||||
CreateCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionSchema* request,
|
||||
::milvus::grpc::Status* response) override;
|
||||
// *
|
||||
// @brief This method is used to test collection existence.
|
||||
//
|
||||
|
@ -95,44 +95,44 @@ class GrpcRequestHandler final : public ::milvus::grpc::MilvusService::Service,
|
|||
//
|
||||
// @return BoolReply
|
||||
::grpc::Status
|
||||
HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
::milvus::grpc::BoolReply* response) override;
|
||||
HasCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::BoolReply* response) override;
|
||||
// *
|
||||
// @brief This method is used to get collection schema.
|
||||
//
|
||||
// @param CollectionName, target collection name.
|
||||
//
|
||||
// @return TableSchema
|
||||
// @return CollectionSchema
|
||||
::grpc::Status
|
||||
DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
::milvus::grpc::TableSchema* response) override;
|
||||
DescribeCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::CollectionSchema* response) override;
|
||||
// *
|
||||
// @brief This method is used to get collection schema.
|
||||
//
|
||||
// @param CollectionName, target collection name.
|
||||
//
|
||||
// @return TableRowCount
|
||||
// @return CollectionRowCount
|
||||
::grpc::Status
|
||||
CountTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
::milvus::grpc::TableRowCount* response) override;
|
||||
CountCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::CollectionRowCount* response) override;
|
||||
// *
|
||||
// @brief This method is used to list all tables.
|
||||
// @brief This method is used to list all collections.
|
||||
//
|
||||
// @param Command, dummy parameter.
|
||||
//
|
||||
// @return CollectionNameList
|
||||
::grpc::Status
|
||||
ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request,
|
||||
::milvus::grpc::TableNameList* response) override;
|
||||
ShowCollections(::grpc::ServerContext* context, const ::milvus::grpc::Command* request,
|
||||
::milvus::grpc::CollectionNameList* response) override;
|
||||
// *
|
||||
// @brief This method is used to get collection detail information.
|
||||
//
|
||||
// @param CollectionName, target collection name.
|
||||
//
|
||||
// @return TableInfo
|
||||
// @return CollectionInfo
|
||||
::grpc::Status
|
||||
ShowTableInfo(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
::milvus::grpc::TableInfo* response);
|
||||
ShowCollectionInfo(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::CollectionInfo* response);
|
||||
|
||||
// *
|
||||
// @brief This method is used to delete collection.
|
||||
|
@ -141,8 +141,8 @@ class GrpcRequestHandler final : public ::milvus::grpc::MilvusService::Service,
|
|||
//
|
||||
// @return CollectionNameList
|
||||
::grpc::Status
|
||||
DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
::milvus::grpc::Status* response) override;
|
||||
DropCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::Status* response) override;
|
||||
// *
|
||||
// @brief This method is used to build index by collection in sync mode.
|
||||
//
|
||||
|
@ -159,7 +159,7 @@ class GrpcRequestHandler final : public ::milvus::grpc::MilvusService::Service,
|
|||
//
|
||||
// @return IndexParam
|
||||
::grpc::Status
|
||||
DescribeIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
DescribeIndex(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::IndexParam* response) override;
|
||||
// *
|
||||
// @brief This method is used to drop index
|
||||
|
@ -168,7 +168,7 @@ class GrpcRequestHandler final : public ::milvus::grpc::MilvusService::Service,
|
|||
//
|
||||
// @return Status
|
||||
::grpc::Status
|
||||
DropIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
DropIndex(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::Status* response) override;
|
||||
// *
|
||||
// @brief This method is used to create partition
|
||||
|
@ -186,7 +186,7 @@ class GrpcRequestHandler final : public ::milvus::grpc::MilvusService::Service,
|
|||
//
|
||||
// @return PartitionList
|
||||
::grpc::Status
|
||||
ShowPartitions(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
ShowPartitions(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::PartitionList* response) override;
|
||||
// *
|
||||
// @brief This method is used to drop partition
|
||||
|
@ -281,8 +281,8 @@ class GrpcRequestHandler final : public ::milvus::grpc::MilvusService::Service,
|
|||
//
|
||||
// @return Status
|
||||
::grpc::Status
|
||||
PreloadTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request,
|
||||
::milvus::grpc::Status* response) override;
|
||||
PreloadCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::Status* response) override;
|
||||
|
||||
// *
|
||||
// @brief This method is used to flush buffer into storage.
|
||||
|
@ -300,7 +300,8 @@ class GrpcRequestHandler final : public ::milvus::grpc::MilvusService::Service,
|
|||
//
|
||||
// @return Status
|
||||
::grpc::Status
|
||||
Compact(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response);
|
||||
Compact(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request,
|
||||
::milvus::grpc::Status* response);
|
||||
|
||||
GrpcRequestHandler&
|
||||
RegisterRequestHandler(const RequestHandler& handler) {
|
||||
|
|
|
@ -39,12 +39,12 @@ enum StatusCode : int {
|
|||
UNEXPECTED_ERROR = 1,
|
||||
CONNECT_FAILED = 2, // reserved.
|
||||
PERMISSION_DENIED = 3,
|
||||
TABLE_NOT_EXISTS = 4, // DB_NOT_FOUND || TABLE_NOT_EXISTS
|
||||
COLLECTION_NOT_EXISTS = 4, // DB_NOT_FOUND || COLLECTION_NOT_EXISTS
|
||||
ILLEGAL_ARGUMENT = 5,
|
||||
ILLEGAL_RANGE = 6,
|
||||
ILLEGAL_DIMENSION = 7,
|
||||
ILLEGAL_INDEX_TYPE = 8,
|
||||
ILLEGAL_TABLE_NAME = 9,
|
||||
ILLEGAL_COLLECTION_NAME = 9,
|
||||
ILLEGAL_TOPK = 10,
|
||||
ILLEGAL_ROWRECORD = 11,
|
||||
ILLEGAL_VECTOR_ID = 12,
|
||||
|
|
|
@ -286,7 +286,7 @@ class WebController : public oatpp::web::server::api::ApiController {
|
|||
case StatusCode::SUCCESS:
|
||||
response = createResponse(Status::CODE_200, response_str);
|
||||
break;
|
||||
case StatusCode::TABLE_NOT_EXISTS:
|
||||
case StatusCode::COLLECTION_NOT_EXISTS:
|
||||
response = createDtoResponse(Status::CODE_404, status_dto);
|
||||
break;
|
||||
default:
|
||||
|
@ -314,7 +314,7 @@ class WebController : public oatpp::web::server::api::ApiController {
|
|||
case StatusCode::SUCCESS:
|
||||
response = createDtoResponse(Status::CODE_204, status_dto);
|
||||
break;
|
||||
case StatusCode::TABLE_NOT_EXISTS:
|
||||
case StatusCode::COLLECTION_NOT_EXISTS:
|
||||
response = createDtoResponse(Status::CODE_404, status_dto);
|
||||
break;
|
||||
default:
|
||||
|
@ -349,7 +349,7 @@ class WebController : public oatpp::web::server::api::ApiController {
|
|||
case StatusCode::SUCCESS:
|
||||
response = createDtoResponse(Status::CODE_201, status_dto);
|
||||
break;
|
||||
case StatusCode::TABLE_NOT_EXISTS:
|
||||
case StatusCode::COLLECTION_NOT_EXISTS:
|
||||
response = createDtoResponse(Status::CODE_404, status_dto);
|
||||
break;
|
||||
default:
|
||||
|
@ -379,7 +379,7 @@ class WebController : public oatpp::web::server::api::ApiController {
|
|||
case StatusCode::SUCCESS:
|
||||
response = createResponse(Status::CODE_200, result);
|
||||
break;
|
||||
case StatusCode::TABLE_NOT_EXISTS:
|
||||
case StatusCode::COLLECTION_NOT_EXISTS:
|
||||
response = createDtoResponse(Status::CODE_404, status_dto);
|
||||
break;
|
||||
default:
|
||||
|
@ -407,7 +407,7 @@ class WebController : public oatpp::web::server::api::ApiController {
|
|||
case StatusCode::SUCCESS:
|
||||
response = createDtoResponse(Status::CODE_204, status_dto);
|
||||
break;
|
||||
case StatusCode::TABLE_NOT_EXISTS:
|
||||
case StatusCode::COLLECTION_NOT_EXISTS:
|
||||
response = createDtoResponse(Status::CODE_404, status_dto);
|
||||
break;
|
||||
default:
|
||||
|
@ -442,7 +442,7 @@ class WebController : public oatpp::web::server::api::ApiController {
|
|||
case StatusCode::SUCCESS:
|
||||
response = createDtoResponse(Status::CODE_201, status_dto);
|
||||
break;
|
||||
case StatusCode::TABLE_NOT_EXISTS:
|
||||
case StatusCode::COLLECTION_NOT_EXISTS:
|
||||
response = createDtoResponse(Status::CODE_404, status_dto);
|
||||
break;
|
||||
default:
|
||||
|
@ -474,7 +474,7 @@ class WebController : public oatpp::web::server::api::ApiController {
|
|||
case StatusCode::SUCCESS:
|
||||
response = createDtoResponse(Status::CODE_200, partition_list_dto);
|
||||
break;
|
||||
case StatusCode::TABLE_NOT_EXISTS:
|
||||
case StatusCode::COLLECTION_NOT_EXISTS:
|
||||
response = createDtoResponse(Status::CODE_404, status_dto);
|
||||
break;
|
||||
default:response = createDtoResponse(Status::CODE_400, status_dto);
|
||||
|
@ -502,7 +502,7 @@ class WebController : public oatpp::web::server::api::ApiController {
|
|||
case StatusCode::SUCCESS:
|
||||
response = createDtoResponse(Status::CODE_204, status_dto);
|
||||
break;
|
||||
case StatusCode::TABLE_NOT_EXISTS:
|
||||
case StatusCode::COLLECTION_NOT_EXISTS:
|
||||
response = createDtoResponse(Status::CODE_404, status_dto);
|
||||
break;
|
||||
default:
|
||||
|
@ -529,7 +529,7 @@ class WebController : public oatpp::web::server::api::ApiController {
|
|||
switch (status_dto->code->getValue()) {
|
||||
case StatusCode::SUCCESS:
|
||||
return createResponse(Status::CODE_200, response);
|
||||
case StatusCode::TABLE_NOT_EXISTS:
|
||||
case StatusCode::COLLECTION_NOT_EXISTS:
|
||||
return createDtoResponse(Status::CODE_404, status_dto);
|
||||
default:
|
||||
return createDtoResponse(Status::CODE_400, status_dto);
|
||||
|
@ -553,7 +553,7 @@ class WebController : public oatpp::web::server::api::ApiController {
|
|||
switch (status_dto->code->getValue()) {
|
||||
case StatusCode::SUCCESS:
|
||||
return createResponse(Status::CODE_200, response);
|
||||
case StatusCode::TABLE_NOT_EXISTS:
|
||||
case StatusCode::COLLECTION_NOT_EXISTS:
|
||||
return createDtoResponse(Status::CODE_404, status_dto);
|
||||
default:
|
||||
return createDtoResponse(Status::CODE_400, status_dto);
|
||||
|
@ -580,7 +580,7 @@ class WebController : public oatpp::web::server::api::ApiController {
|
|||
switch (status_dto->code->getValue()) {
|
||||
case StatusCode::SUCCESS:
|
||||
return createResponse(Status::CODE_200, response);
|
||||
case StatusCode::TABLE_NOT_EXISTS:
|
||||
case StatusCode::COLLECTION_NOT_EXISTS:
|
||||
return createDtoResponse(Status::CODE_404, status_dto);
|
||||
default:
|
||||
return createDtoResponse(Status::CODE_400, status_dto);
|
||||
|
@ -603,7 +603,7 @@ class WebController : public oatpp::web::server::api::ApiController {
|
|||
case StatusCode::SUCCESS:
|
||||
response = createDtoResponse(Status::CODE_201, ids_dto);
|
||||
break;
|
||||
case StatusCode::TABLE_NOT_EXISTS:
|
||||
case StatusCode::COLLECTION_NOT_EXISTS:
|
||||
response = createDtoResponse(Status::CODE_404, status_dto);
|
||||
break;
|
||||
default:
|
||||
|
@ -632,7 +632,7 @@ class WebController : public oatpp::web::server::api::ApiController {
|
|||
case StatusCode::SUCCESS:
|
||||
response = createResponse(Status::CODE_200, result);
|
||||
break;
|
||||
case StatusCode::TABLE_NOT_EXISTS:
|
||||
case StatusCode::COLLECTION_NOT_EXISTS:
|
||||
response = createDtoResponse(Status::CODE_404, status_dto);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -45,9 +45,9 @@ WebErrorMap(ErrorCode code) {
|
|||
{SERVER_CANNOT_CREATE_FILE, StatusCode::CANNOT_CREATE_FILE},
|
||||
{SERVER_CANNOT_DELETE_FOLDER, StatusCode::CANNOT_DELETE_FOLDER},
|
||||
{SERVER_CANNOT_DELETE_FILE, StatusCode::CANNOT_DELETE_FILE},
|
||||
{SERVER_TABLE_NOT_EXIST, StatusCode::TABLE_NOT_EXISTS},
|
||||
{SERVER_INVALID_TABLE_NAME, StatusCode::ILLEGAL_TABLE_NAME},
|
||||
{SERVER_INVALID_TABLE_DIMENSION, StatusCode::ILLEGAL_DIMENSION},
|
||||
{SERVER_COLLECTION_NOT_EXIST, StatusCode::COLLECTION_NOT_EXISTS},
|
||||
{SERVER_INVALID_COLLECTION_NAME, StatusCode::ILLEGAL_COLLECTION_NAME},
|
||||
{SERVER_INVALID_COLLECTION_DIMENSION, StatusCode::ILLEGAL_DIMENSION},
|
||||
{SERVER_INVALID_VECTOR_DIMENSION, StatusCode::ILLEGAL_DIMENSION},
|
||||
|
||||
{SERVER_INVALID_INDEX_TYPE, StatusCode::ILLEGAL_INDEX_TYPE},
|
||||
|
@ -64,7 +64,7 @@ WebErrorMap(ErrorCode code) {
|
|||
{SERVER_BUILD_INDEX_ERROR, StatusCode::BUILD_INDEX_ERROR},
|
||||
{SERVER_OUT_OF_MEMORY, StatusCode::OUT_OF_MEMORY},
|
||||
|
||||
{DB_NOT_FOUND, StatusCode::TABLE_NOT_EXISTS},
|
||||
{DB_NOT_FOUND, StatusCode::COLLECTION_NOT_EXISTS},
|
||||
{DB_META_TRANSACTION_FAILED, StatusCode::META_FAILED},
|
||||
};
|
||||
if (code < StatusCode::MAX) {
|
||||
|
|
|
@ -64,9 +64,9 @@ constexpr ErrorCode SERVER_CANNOT_DELETE_FOLDER = ToServerErrorCode(10);
|
|||
constexpr ErrorCode SERVER_CANNOT_DELETE_FILE = ToServerErrorCode(11);
|
||||
constexpr ErrorCode SERVER_BUILD_INDEX_ERROR = ToServerErrorCode(12);
|
||||
|
||||
constexpr ErrorCode SERVER_TABLE_NOT_EXIST = ToServerErrorCode(100);
|
||||
constexpr ErrorCode SERVER_INVALID_TABLE_NAME = ToServerErrorCode(101);
|
||||
constexpr ErrorCode SERVER_INVALID_TABLE_DIMENSION = ToServerErrorCode(102);
|
||||
constexpr ErrorCode SERVER_COLLECTION_NOT_EXIST = ToServerErrorCode(100);
|
||||
constexpr ErrorCode SERVER_INVALID_COLLECTION_NAME = ToServerErrorCode(101);
|
||||
constexpr ErrorCode SERVER_INVALID_COLLECTION_DIMENSION = ToServerErrorCode(102);
|
||||
constexpr ErrorCode SERVER_INVALID_VECTOR_DIMENSION = ToServerErrorCode(104);
|
||||
constexpr ErrorCode SERVER_INVALID_INDEX_TYPE = ToServerErrorCode(105);
|
||||
constexpr ErrorCode SERVER_INVALID_ROWRECORD = ToServerErrorCode(106);
|
||||
|
@ -91,7 +91,7 @@ constexpr ErrorCode DB_ALREADY_EXIST = ToDbErrorCode(4);
|
|||
constexpr ErrorCode DB_INVALID_PATH = ToDbErrorCode(5);
|
||||
constexpr ErrorCode DB_INCOMPATIB_META = ToDbErrorCode(6);
|
||||
constexpr ErrorCode DB_INVALID_META_URI = ToDbErrorCode(7);
|
||||
constexpr ErrorCode DB_EMPTY_TABLE = ToDbErrorCode(8);
|
||||
constexpr ErrorCode DB_EMPTY_COLLECTION = ToDbErrorCode(8);
|
||||
constexpr ErrorCode DB_BLOOM_FILTER_ERROR = ToDbErrorCode(9);
|
||||
constexpr ErrorCode PARTITION_NOT_FOUND = ToDbErrorCode(10);
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@ namespace milvus {
|
|||
namespace server {
|
||||
|
||||
namespace {
|
||||
constexpr size_t TABLE_NAME_SIZE_LIMIT = 255;
|
||||
constexpr int64_t TABLE_DIMENSION_LIMIT = 32768;
|
||||
constexpr size_t COLLECTION_NAME_SIZE_LIMIT = 255;
|
||||
constexpr int64_t COLLECTION_DIMENSION_LIMIT = 32768;
|
||||
constexpr int32_t INDEX_FILE_SIZE_LIMIT = 4096; // index trigger size max = 4096 MB
|
||||
|
||||
Status
|
||||
|
@ -104,15 +104,15 @@ ValidationUtil::ValidateCollectionName(const std::string& collection_name) {
|
|||
if (collection_name.empty()) {
|
||||
std::string msg = "Collection name should not be empty.";
|
||||
SERVER_LOG_ERROR << msg;
|
||||
return Status(SERVER_INVALID_TABLE_NAME, msg);
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, msg);
|
||||
}
|
||||
|
||||
std::string invalid_msg = "Invalid collection name: " + collection_name + ". ";
|
||||
// Collection name size shouldn't exceed 16384.
|
||||
if (collection_name.size() > TABLE_NAME_SIZE_LIMIT) {
|
||||
if (collection_name.size() > COLLECTION_NAME_SIZE_LIMIT) {
|
||||
std::string msg = invalid_msg + "The length of a collection name must be less than 255 characters.";
|
||||
SERVER_LOG_ERROR << msg;
|
||||
return Status(SERVER_INVALID_TABLE_NAME, msg);
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, msg);
|
||||
}
|
||||
|
||||
// Collection name first character should be underscore or character.
|
||||
|
@ -120,7 +120,7 @@ ValidationUtil::ValidateCollectionName(const std::string& collection_name) {
|
|||
if (first_char != '_' && std::isalpha(first_char) == 0) {
|
||||
std::string msg = invalid_msg + "The first character of a collection name must be an underscore or letter.";
|
||||
SERVER_LOG_ERROR << msg;
|
||||
return Status(SERVER_INVALID_TABLE_NAME, msg);
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, msg);
|
||||
}
|
||||
|
||||
int64_t table_name_size = collection_name.size();
|
||||
|
@ -129,7 +129,7 @@ ValidationUtil::ValidateCollectionName(const std::string& collection_name) {
|
|||
if (name_char != '_' && std::isalnum(name_char) == 0) {
|
||||
std::string msg = invalid_msg + "Collection name can only contain numbers, letters, and underscores.";
|
||||
SERVER_LOG_ERROR << msg;
|
||||
return Status(SERVER_INVALID_TABLE_NAME, msg);
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,10 +138,10 @@ ValidationUtil::ValidateCollectionName(const std::string& collection_name) {
|
|||
|
||||
Status
|
||||
ValidationUtil::ValidateTableDimension(int64_t dimension, int64_t metric_type) {
|
||||
if (dimension <= 0 || dimension > TABLE_DIMENSION_LIMIT) {
|
||||
if (dimension <= 0 || dimension > COLLECTION_DIMENSION_LIMIT) {
|
||||
std::string msg = "Invalid collection dimension: " + std::to_string(dimension) + ". " +
|
||||
"The collection dimension must be within the range of 1 ~ " +
|
||||
std::to_string(TABLE_DIMENSION_LIMIT) + ".";
|
||||
std::to_string(COLLECTION_DIMENSION_LIMIT) + ".";
|
||||
SERVER_LOG_ERROR << msg;
|
||||
return Status(SERVER_INVALID_VECTOR_DIMENSION, msg);
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ ValidationUtil::ValidateIndexParams(const milvus::json& index_params,
|
|||
if (resset.empty()) {
|
||||
std::string msg = "Invalid collection dimension, unable to get reasonable values for 'm'";
|
||||
SERVER_LOG_ERROR << msg;
|
||||
return Status(SERVER_INVALID_TABLE_DIMENSION, msg);
|
||||
return Status(SERVER_INVALID_COLLECTION_DIMENSION, msg);
|
||||
}
|
||||
|
||||
auto iter = std::find(std::begin(resset), std::end(resset), m_value);
|
||||
|
@ -399,15 +399,15 @@ ValidationUtil::ValidatePartitionName(const std::string& partition_name) {
|
|||
if (partition_name.empty()) {
|
||||
std::string msg = "Partition name should not be empty.";
|
||||
SERVER_LOG_ERROR << msg;
|
||||
return Status(SERVER_INVALID_TABLE_NAME, msg);
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, msg);
|
||||
}
|
||||
|
||||
std::string invalid_msg = "Invalid partition name: " + partition_name + ". ";
|
||||
// Collection name size shouldn't exceed 16384.
|
||||
if (partition_name.size() > TABLE_NAME_SIZE_LIMIT) {
|
||||
if (partition_name.size() > COLLECTION_NAME_SIZE_LIMIT) {
|
||||
std::string msg = invalid_msg + "The length of a partition name must be less than 255 characters.";
|
||||
SERVER_LOG_ERROR << msg;
|
||||
return Status(SERVER_INVALID_TABLE_NAME, msg);
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, msg);
|
||||
}
|
||||
|
||||
// Collection name first character should be underscore or character.
|
||||
|
@ -415,7 +415,7 @@ ValidationUtil::ValidatePartitionName(const std::string& partition_name) {
|
|||
if (first_char != '_' && std::isalpha(first_char) == 0) {
|
||||
std::string msg = invalid_msg + "The first character of a partition name must be an underscore or letter.";
|
||||
SERVER_LOG_ERROR << msg;
|
||||
return Status(SERVER_INVALID_TABLE_NAME, msg);
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, msg);
|
||||
}
|
||||
|
||||
int64_t table_name_size = partition_name.size();
|
||||
|
@ -424,7 +424,7 @@ ValidationUtil::ValidatePartitionName(const std::string& partition_name) {
|
|||
if (name_char != '_' && std::isalnum(name_char) == 0) {
|
||||
std::string msg = invalid_msg + "Partition name can only contain numbers, letters, and underscores.";
|
||||
SERVER_LOG_ERROR << msg;
|
||||
return Status(SERVER_INVALID_TABLE_NAME, msg);
|
||||
return Status(SERVER_INVALID_COLLECTION_NAME, msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,18 +30,18 @@
|
|||
|
||||
namespace {
|
||||
|
||||
static const char* TABLE_NAME = "test_group";
|
||||
static constexpr int64_t TABLE_DIM = 256;
|
||||
static const char* COLLECTION_NAME = "test_group";
|
||||
static constexpr int64_t COLLECTION_DIM = 256;
|
||||
static constexpr int64_t VECTOR_COUNT = 25000;
|
||||
static constexpr int64_t INSERT_LOOP = 1000;
|
||||
static constexpr int64_t SECONDS_EACH_HOUR = 3600;
|
||||
static constexpr int64_t DAY_SECONDS = 24 * 60 * 60;
|
||||
|
||||
milvus::engine::meta::CollectionSchema
|
||||
BuildTableSchema() {
|
||||
BuildCollectionSchema() {
|
||||
milvus::engine::meta::CollectionSchema collection_info;
|
||||
collection_info.dimension_ = TABLE_DIM;
|
||||
collection_info.collection_id_ = TABLE_NAME;
|
||||
collection_info.dimension_ = COLLECTION_DIM;
|
||||
collection_info.collection_id_ = COLLECTION_NAME;
|
||||
return collection_info;
|
||||
}
|
||||
|
||||
|
@ -49,11 +49,11 @@ void
|
|||
BuildVectors(uint64_t n, uint64_t batch_index, milvus::engine::VectorsData& vectors) {
|
||||
vectors.vector_count_ = n;
|
||||
vectors.float_data_.clear();
|
||||
vectors.float_data_.resize(n * TABLE_DIM);
|
||||
vectors.float_data_.resize(n * COLLECTION_DIM);
|
||||
float* data = vectors.float_data_.data();
|
||||
for (uint64_t i = 0; i < n; i++) {
|
||||
for (int64_t j = 0; j < TABLE_DIM; j++) data[TABLE_DIM * i + j] = drand48();
|
||||
data[TABLE_DIM * i] += i / 2000.;
|
||||
for (int64_t j = 0; j < COLLECTION_DIM; j++) data[COLLECTION_DIM * i + j] = drand48();
|
||||
data[COLLECTION_DIM * i] += i / 2000.;
|
||||
|
||||
vectors.id_array_.push_back(n * batch_index + i);
|
||||
}
|
||||
|
@ -163,14 +163,14 @@ TEST_F(DBTest, CONFIG_TEST) {
|
|||
}
|
||||
|
||||
TEST_F(DBTest, DB_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = TABLE_NAME;
|
||||
collection_info_get.collection_id_ = COLLECTION_NAME;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
uint64_t qb = 5;
|
||||
milvus::engine::VectorsData qxb;
|
||||
|
@ -199,7 +199,7 @@ TEST_F(DBTest, DB_TEST) {
|
|||
START_TIMER;
|
||||
|
||||
std::vector<std::string> tags;
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, tags, k, json_params, qxb, result_ids, result_distances);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, k, json_params, qxb, result_ids, result_distances);
|
||||
ss << "Search " << j << " With Size " << count / milvus::engine::M << " M";
|
||||
STOP_TIMER(ss.str());
|
||||
|
||||
|
@ -222,14 +222,14 @@ TEST_F(DBTest, DB_TEST) {
|
|||
|
||||
for (auto i = 0; i < loop; ++i) {
|
||||
if (i == 40) {
|
||||
db_->InsertVectors(TABLE_NAME, "", qxb);
|
||||
db_->InsertVectors(COLLECTION_NAME, "", qxb);
|
||||
ASSERT_EQ(qxb.id_array_.size(), qb);
|
||||
} else {
|
||||
uint64_t nb = 50;
|
||||
milvus::engine::VectorsData xb;
|
||||
BuildVectors(nb, i, xb);
|
||||
|
||||
db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
ASSERT_EQ(xb.id_array_.size(), nb);
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,7 @@ TEST_F(DBTest, DB_TEST) {
|
|||
search.join();
|
||||
|
||||
uint64_t count;
|
||||
stat = db_->GetCollectionRowCount(TABLE_NAME, count);
|
||||
stat = db_->GetCollectionRowCount(COLLECTION_NAME, count);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_GT(count, 0);
|
||||
|
||||
|
@ -267,14 +267,14 @@ TEST_F(DBTest, SEARCH_TEST) {
|
|||
milvus::server::Config& config = milvus::server::Config::GetInstance();
|
||||
milvus::Status s = config.LoadConfigFile(config_path);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = TABLE_NAME;
|
||||
collection_info_get.collection_id_ = COLLECTION_NAME;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
// prepare raw data
|
||||
size_t nb = VECTOR_COUNT;
|
||||
|
@ -282,21 +282,21 @@ TEST_F(DBTest, SEARCH_TEST) {
|
|||
size_t k = 5;
|
||||
milvus::engine::VectorsData xb, xq;
|
||||
xb.vector_count_ = nb;
|
||||
xb.float_data_.resize(nb * TABLE_DIM);
|
||||
xb.float_data_.resize(nb * COLLECTION_DIM);
|
||||
xq.vector_count_ = nq;
|
||||
xq.float_data_.resize(nq * TABLE_DIM);
|
||||
xq.float_data_.resize(nq * COLLECTION_DIM);
|
||||
xb.id_array_.resize(nb);
|
||||
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
std::uniform_real_distribution<> dis_xt(-1.0, 1.0);
|
||||
for (size_t i = 0; i < nb * TABLE_DIM; i++) {
|
||||
for (size_t i = 0; i < nb * COLLECTION_DIM; i++) {
|
||||
xb.float_data_[i] = dis_xt(gen);
|
||||
if (i < nb) {
|
||||
xb.id_array_[i] = i;
|
||||
}
|
||||
}
|
||||
for (size_t i = 0; i < nq * TABLE_DIM; i++) {
|
||||
for (size_t i = 0; i < nq * COLLECTION_DIM; i++) {
|
||||
xq.float_data_[i] = dis_xt(gen);
|
||||
}
|
||||
|
||||
|
@ -307,56 +307,56 @@ TEST_F(DBTest, SEARCH_TEST) {
|
|||
std::vector<float> dis(k * nq);
|
||||
|
||||
// insert data
|
||||
stat = db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
stat = db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
milvus::json json_params = {{"nprobe", 10}};
|
||||
milvus::engine::CollectionIndex index;
|
||||
index.engine_type_ = (int)milvus::engine::EngineType::FAISS_IDMAP;
|
||||
index.extra_params_ = {{"nlist", 16384}};
|
||||
// db_->CreateIndex(TABLE_NAME, index); // wait until build index finish
|
||||
// db_->CreateIndex(COLLECTION_NAME, index); // wait until build index finish
|
||||
//
|
||||
// {
|
||||
// std::vector<std::string> tags;
|
||||
// milvus::engine::ResultIds result_ids;
|
||||
// milvus::engine::ResultDistances result_distances;
|
||||
// stat = db_->Query(dummy_context_, TABLE_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
// stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
// ASSERT_TRUE(stat.ok());
|
||||
// }
|
||||
//
|
||||
// index.engine_type_ = (int)milvus::engine::EngineType::FAISS_IVFFLAT;
|
||||
// index.extra_params_ = {{"nlist", 16384}};
|
||||
// db_->CreateIndex(TABLE_NAME, index); // wait until build index finish
|
||||
// db_->CreateIndex(COLLECTION_NAME, index); // wait until build index finish
|
||||
//
|
||||
// {
|
||||
// std::vector<std::string> tags;
|
||||
// milvus::engine::ResultIds result_ids;
|
||||
// milvus::engine::ResultDistances result_distances;
|
||||
// stat = db_->Query(dummy_context_, TABLE_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
// stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
// ASSERT_TRUE(stat.ok());
|
||||
// }
|
||||
|
||||
index.engine_type_ = (int)milvus::engine::EngineType::FAISS_IVFSQ8;
|
||||
index.extra_params_ = {{"nlist", 16384}};
|
||||
db_->CreateIndex(TABLE_NAME, index); // wait until build index finish
|
||||
db_->CreateIndex(COLLECTION_NAME, index); // wait until build index finish
|
||||
|
||||
{
|
||||
std::vector<std::string> tags;
|
||||
milvus::engine::ResultIds result_ids;
|
||||
milvus::engine::ResultDistances result_distances;
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
}
|
||||
|
||||
#ifdef MILVUS_GPU_VERSION
|
||||
index.engine_type_ = (int)milvus::engine::EngineType::FAISS_IVFSQ8H;
|
||||
db_->CreateIndex(TABLE_NAME, index); // wait until build index finish
|
||||
db_->CreateIndex(COLLECTION_NAME, index); // wait until build index finish
|
||||
|
||||
{
|
||||
std::vector<std::string> tags;
|
||||
milvus::engine::ResultIds result_ids;
|
||||
milvus::engine::ResultDistances result_distances;
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
}
|
||||
#endif
|
||||
|
@ -391,13 +391,13 @@ TEST_F(DBTest, SEARCH_TEST) {
|
|||
std::vector<std::string> tags;
|
||||
milvus::engine::ResultIds result_ids;
|
||||
milvus::engine::ResultDistances result_distances;
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.FilesToSearch.throw_exception");
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
fiu_disable("SqliteMetaImpl.FilesToSearch.throw_exception");
|
||||
}
|
||||
|
@ -406,7 +406,7 @@ TEST_F(DBTest, SEARCH_TEST) {
|
|||
#ifdef MILVUS_GPU_VERSION
|
||||
// test FAISS_IVFSQ8H optimizer
|
||||
index.engine_type_ = (int)milvus::engine::EngineType::FAISS_IVFSQ8H;
|
||||
db_->CreateIndex(TABLE_NAME, index); // wait until build index finish
|
||||
db_->CreateIndex(COLLECTION_NAME, index); // wait until build index finish
|
||||
std::vector<std::string> partition_tag;
|
||||
milvus::engine::ResultIds result_ids;
|
||||
milvus::engine::ResultDistances result_dists;
|
||||
|
@ -414,7 +414,7 @@ TEST_F(DBTest, SEARCH_TEST) {
|
|||
{
|
||||
result_ids.clear();
|
||||
result_dists.clear();
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, partition_tag, k, json_params, xq, result_ids, result_dists);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, partition_tag, k, json_params, xq, result_ids, result_dists);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
}
|
||||
|
||||
|
@ -434,17 +434,17 @@ TEST_F(DBTest, SEARCH_TEST) {
|
|||
#endif
|
||||
}
|
||||
|
||||
TEST_F(DBTest, PRELOADTABLE_TEST) {
|
||||
TEST_F(DBTest, PRELOAD_TEST) {
|
||||
fiu_init(0);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = TABLE_NAME;
|
||||
collection_info_get.collection_id_ = COLLECTION_NAME;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int loop = 5;
|
||||
for (auto i = 0; i < loop; ++i) {
|
||||
|
@ -452,43 +452,43 @@ TEST_F(DBTest, PRELOADTABLE_TEST) {
|
|||
milvus::engine::VectorsData xb;
|
||||
BuildVectors(nb, i, xb);
|
||||
|
||||
db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
ASSERT_EQ(xb.id_array_.size(), nb);
|
||||
}
|
||||
|
||||
milvus::engine::CollectionIndex index;
|
||||
index.engine_type_ = (int)milvus::engine::EngineType::FAISS_IDMAP;
|
||||
db_->CreateIndex(TABLE_NAME, index); // wait until build index finish
|
||||
db_->CreateIndex(COLLECTION_NAME, index); // wait until build index finish
|
||||
|
||||
int64_t prev_cache_usage = milvus::cache::CpuCacheMgr::GetInstance()->CacheUsage();
|
||||
stat = db_->PreloadCollection(TABLE_NAME);
|
||||
stat = db_->PreloadCollection(COLLECTION_NAME);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
int64_t cur_cache_usage = milvus::cache::CpuCacheMgr::GetInstance()->CacheUsage();
|
||||
ASSERT_TRUE(prev_cache_usage < cur_cache_usage);
|
||||
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.FilesToSearch.throw_exception");
|
||||
stat = db_->PreloadCollection(TABLE_NAME);
|
||||
stat = db_->PreloadCollection(COLLECTION_NAME);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
fiu_disable("SqliteMetaImpl.FilesToSearch.throw_exception");
|
||||
|
||||
// create a partition
|
||||
stat = db_->CreatePartition(TABLE_NAME, "part0", "0");
|
||||
stat = db_->CreatePartition(COLLECTION_NAME, "part0", "0");
|
||||
ASSERT_TRUE(stat.ok());
|
||||
stat = db_->PreloadCollection(TABLE_NAME);
|
||||
stat = db_->PreloadCollection(COLLECTION_NAME);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
FIU_ENABLE_FIU("DBImpl.PreloadCollection.null_engine");
|
||||
stat = db_->PreloadCollection(TABLE_NAME);
|
||||
stat = db_->PreloadCollection(COLLECTION_NAME);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
fiu_disable("DBImpl.PreloadCollection.null_engine");
|
||||
|
||||
FIU_ENABLE_FIU("DBImpl.PreloadCollection.exceed_cache");
|
||||
stat = db_->PreloadCollection(TABLE_NAME);
|
||||
stat = db_->PreloadCollection(COLLECTION_NAME);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
fiu_disable("DBImpl.PreloadCollection.exceed_cache");
|
||||
|
||||
FIU_ENABLE_FIU("DBImpl.PreloadCollection.engine_throw_exception");
|
||||
stat = db_->PreloadCollection(TABLE_NAME);
|
||||
stat = db_->PreloadCollection(COLLECTION_NAME);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
fiu_disable("DBImpl.PreloadCollection.engine_throw_exception");
|
||||
}
|
||||
|
@ -496,27 +496,27 @@ TEST_F(DBTest, PRELOADTABLE_TEST) {
|
|||
TEST_F(DBTest, SHUTDOWN_TEST) {
|
||||
db_->Stop();
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
|
||||
stat = db_->DescribeCollection(collection_info);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
|
||||
stat = db_->UpdateCollectionFlag(TABLE_NAME, 0);
|
||||
stat = db_->UpdateCollectionFlag(COLLECTION_NAME, 0);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
|
||||
stat = db_->CreatePartition(TABLE_NAME, "part0", "0");
|
||||
stat = db_->CreatePartition(COLLECTION_NAME, "part0", "0");
|
||||
ASSERT_FALSE(stat.ok());
|
||||
|
||||
stat = db_->DropPartition("part0");
|
||||
ASSERT_FALSE(stat.ok());
|
||||
|
||||
stat = db_->DropPartitionByTag(TABLE_NAME, "0");
|
||||
stat = db_->DropPartitionByTag(COLLECTION_NAME, "0");
|
||||
ASSERT_FALSE(stat.ok());
|
||||
|
||||
std::vector<milvus::engine::meta::CollectionSchema> partition_schema_array;
|
||||
stat = db_->ShowPartitions(TABLE_NAME, partition_schema_array);
|
||||
stat = db_->ShowPartitions(COLLECTION_NAME, partition_schema_array);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
|
||||
std::vector<milvus::engine::meta::CollectionSchema> collection_infos;
|
||||
|
@ -562,7 +562,7 @@ TEST_F(DBTest, SHUTDOWN_TEST) {
|
|||
stat = db_->DescribeIndex(collection_info.collection_id_, index);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
|
||||
stat = db_->DropIndex(TABLE_NAME);
|
||||
stat = db_->DropIndex(COLLECTION_NAME);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
|
||||
std::vector<std::string> tags;
|
||||
|
@ -598,7 +598,7 @@ TEST_F(DBTest, SHUTDOWN_TEST) {
|
|||
|
||||
TEST_F(DBTest, BACK_TIMER_THREAD_1) {
|
||||
fiu_init(0);
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
milvus::Status stat;
|
||||
// test background timer thread
|
||||
{
|
||||
|
@ -607,13 +607,13 @@ TEST_F(DBTest, BACK_TIMER_THREAD_1) {
|
|||
stat = db_->CreateCollection(collection_info);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
// insert some vector to create some tablefiles
|
||||
// insert some vector to create some collection files
|
||||
int loop = 10;
|
||||
for (auto i = 0; i < loop; ++i) {
|
||||
int64_t nb = VECTOR_COUNT;
|
||||
milvus::engine::VectorsData xb;
|
||||
BuildVectors(nb, i, xb);
|
||||
db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
ASSERT_EQ(xb.id_array_.size(), nb);
|
||||
}
|
||||
|
||||
|
@ -633,18 +633,18 @@ TEST_F(DBTest, BACK_TIMER_THREAD_1) {
|
|||
TEST_F(DBTest, BACK_TIMER_THREAD_2) {
|
||||
fiu_init(0);
|
||||
milvus::Status stat;
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
|
||||
stat = db_->CreateCollection(collection_info);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
// insert some vector to create some tablefiles
|
||||
// insert some vector to create some collection files
|
||||
int loop = 10;
|
||||
for (auto i = 0; i < loop; ++i) {
|
||||
int64_t nb = VECTOR_COUNT;
|
||||
milvus::engine::VectorsData xb;
|
||||
BuildVectors(nb, i, xb);
|
||||
db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
ASSERT_EQ(xb.id_array_.size(), nb);
|
||||
}
|
||||
|
||||
|
@ -657,18 +657,18 @@ TEST_F(DBTest, BACK_TIMER_THREAD_2) {
|
|||
TEST_F(DBTest, BACK_TIMER_THREAD_3) {
|
||||
fiu_init(0);
|
||||
milvus::Status stat;
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
|
||||
stat = db_->CreateCollection(collection_info);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
// insert some vector to create some tablefiles
|
||||
// insert some vector to create some collection files
|
||||
int loop = 10;
|
||||
for (auto i = 0; i < loop; ++i) {
|
||||
int64_t nb = VECTOR_COUNT;
|
||||
milvus::engine::VectorsData xb;
|
||||
BuildVectors(nb, i, xb);
|
||||
db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
ASSERT_EQ(xb.id_array_.size(), nb);
|
||||
}
|
||||
|
||||
|
@ -682,18 +682,18 @@ TEST_F(DBTest, BACK_TIMER_THREAD_3) {
|
|||
TEST_F(DBTest, BACK_TIMER_THREAD_4) {
|
||||
fiu_init(0);
|
||||
milvus::Status stat;
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
|
||||
stat = db_->CreateCollection(collection_info);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
// insert some vector to create some tablefiles
|
||||
// insert some vector to create some collection files
|
||||
int loop = 10;
|
||||
for (auto i = 0; i < loop; ++i) {
|
||||
int64_t nb = VECTOR_COUNT;
|
||||
milvus::engine::VectorsData xb;
|
||||
BuildVectors(nb, i, xb);
|
||||
db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
ASSERT_EQ(xb.id_array_.size(), nb);
|
||||
}
|
||||
|
||||
|
@ -705,14 +705,14 @@ TEST_F(DBTest, BACK_TIMER_THREAD_4) {
|
|||
}
|
||||
|
||||
TEST_F(DBTest, INDEX_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
uint64_t nb = VECTOR_COUNT;
|
||||
milvus::engine::VectorsData xb;
|
||||
BuildVectors(nb, 0, xb);
|
||||
|
||||
db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
ASSERT_EQ(xb.id_array_.size(), nb);
|
||||
|
||||
milvus::engine::CollectionIndex index;
|
||||
|
@ -755,14 +755,14 @@ TEST_F(DBTest, INDEX_TEST) {
|
|||
}
|
||||
|
||||
TEST_F(DBTest, PARTITION_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
// create partition and insert data
|
||||
const int64_t PARTITION_COUNT = 5;
|
||||
const int64_t INSERT_BATCH = 2000;
|
||||
std::string collection_name = TABLE_NAME;
|
||||
std::string collection_name = COLLECTION_NAME;
|
||||
for (int64_t i = 0; i < PARTITION_COUNT; i++) {
|
||||
std::string partition_tag = std::to_string(i);
|
||||
std::string partition_name = collection_name + "_" + partition_tag;
|
||||
|
@ -790,7 +790,7 @@ TEST_F(DBTest, PARTITION_TEST) {
|
|||
ASSERT_EQ(vector_ids.size(), INSERT_BATCH);
|
||||
|
||||
// insert data into not existed partition
|
||||
stat = db_->InsertVectors(TABLE_NAME, "notexist", xb);
|
||||
stat = db_->InsertVectors(COLLECTION_NAME, "notexist", xb);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
}
|
||||
|
||||
|
@ -835,17 +835,17 @@ TEST_F(DBTest, PARTITION_TEST) {
|
|||
fiu_disable("DBImpl.WaitCollectionIndexRecursively.not_empty_err_msg");
|
||||
|
||||
uint64_t row_count = 0;
|
||||
stat = db_->GetCollectionRowCount(TABLE_NAME, row_count);
|
||||
stat = db_->GetCollectionRowCount(COLLECTION_NAME, row_count);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(row_count, INSERT_BATCH * PARTITION_COUNT);
|
||||
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.Count.throw_exception");
|
||||
stat = db_->GetCollectionRowCount(TABLE_NAME, row_count);
|
||||
stat = db_->GetCollectionRowCount(COLLECTION_NAME, row_count);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
fiu_disable("SqliteMetaImpl.Count.throw_exception");
|
||||
|
||||
FIU_ENABLE_FIU("DBImpl.GetCollectionRowCountRecursively.fail_get_collection_rowcount_for_partition");
|
||||
stat = db_->GetCollectionRowCount(TABLE_NAME, row_count);
|
||||
stat = db_->GetCollectionRowCount(COLLECTION_NAME, row_count);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
fiu_disable("DBImpl.GetCollectionRowCountRecursively.fail_get_collection_rowcount_for_partition");
|
||||
}
|
||||
|
@ -863,7 +863,7 @@ TEST_F(DBTest, PARTITION_TEST) {
|
|||
milvus::engine::ResultDistances result_distances;
|
||||
milvus::json json_params = {{"nprobe", nprobe}};
|
||||
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, tags, topk, json_params, xq, result_ids, result_distances);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, topk, json_params, xq, result_ids, result_distances);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(result_ids.size() / topk, nq);
|
||||
|
||||
|
@ -871,7 +871,7 @@ TEST_F(DBTest, PARTITION_TEST) {
|
|||
tags.clear();
|
||||
result_ids.clear();
|
||||
result_distances.clear();
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, tags, topk, json_params, xq, result_ids, result_distances);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, topk, json_params, xq, result_ids, result_distances);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(result_ids.size() / topk, nq);
|
||||
|
||||
|
@ -879,7 +879,7 @@ TEST_F(DBTest, PARTITION_TEST) {
|
|||
tags.push_back("\\d");
|
||||
result_ids.clear();
|
||||
result_distances.clear();
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, tags, topk, json_params, xq, result_ids, result_distances);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, topk, json_params, xq, result_ids, result_distances);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(result_ids.size() / topk, nq);
|
||||
}
|
||||
|
@ -908,15 +908,15 @@ TEST_F(DBTest, PARTITION_TEST) {
|
|||
}
|
||||
|
||||
TEST_F(DBTest2, ARHIVE_DISK_CHECK) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
std::vector<milvus::engine::meta::CollectionSchema> table_schema_array;
|
||||
stat = db_->AllCollections(table_schema_array);
|
||||
std::vector<milvus::engine::meta::CollectionSchema> collection_schema_array;
|
||||
stat = db_->AllCollections(collection_schema_array);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
bool bfound = false;
|
||||
for (auto& schema : table_schema_array) {
|
||||
if (schema.collection_id_ == TABLE_NAME) {
|
||||
for (auto& schema : collection_schema_array) {
|
||||
if (schema.collection_id_ == COLLECTION_NAME) {
|
||||
bfound = true;
|
||||
break;
|
||||
}
|
||||
|
@ -924,10 +924,10 @@ TEST_F(DBTest2, ARHIVE_DISK_CHECK) {
|
|||
ASSERT_TRUE(bfound);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = TABLE_NAME;
|
||||
collection_info_get.collection_id_ = COLLECTION_NAME;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
uint64_t size;
|
||||
db_->Size(size);
|
||||
|
@ -938,7 +938,7 @@ TEST_F(DBTest2, ARHIVE_DISK_CHECK) {
|
|||
milvus::engine::VectorsData xb;
|
||||
BuildVectors(nb, i, xb);
|
||||
|
||||
db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(1));
|
||||
}
|
||||
|
||||
|
@ -950,16 +950,16 @@ TEST_F(DBTest2, ARHIVE_DISK_CHECK) {
|
|||
}
|
||||
|
||||
TEST_F(DBTest2, DELETE_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = TABLE_NAME;
|
||||
collection_info_get.collection_id_ = COLLECTION_NAME;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
bool has_collection = false;
|
||||
db_->HasCollection(TABLE_NAME, has_collection);
|
||||
db_->HasCollection(COLLECTION_NAME, has_collection);
|
||||
ASSERT_TRUE(has_collection);
|
||||
|
||||
uint64_t size;
|
||||
|
@ -970,34 +970,34 @@ TEST_F(DBTest2, DELETE_TEST) {
|
|||
BuildVectors(nb, 0, xb);
|
||||
|
||||
milvus::engine::IDNumbers vector_ids;
|
||||
stat = db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
stat = db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
milvus::engine::CollectionIndex index;
|
||||
stat = db_->CreateIndex(TABLE_NAME, index);
|
||||
stat = db_->CreateIndex(COLLECTION_NAME, index);
|
||||
|
||||
// create partition, drop collection will drop partition recursively
|
||||
stat = db_->CreatePartition(TABLE_NAME, "part0", "0");
|
||||
stat = db_->CreatePartition(COLLECTION_NAME, "part0", "0");
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
// fail drop collection
|
||||
fiu_init(0);
|
||||
FIU_ENABLE_FIU("DBImpl.DropCollectionRecursively.failed");
|
||||
stat = db_->DropCollection(TABLE_NAME);
|
||||
stat = db_->DropCollection(COLLECTION_NAME);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
fiu_disable("DBImpl.DropCollectionRecursively.failed");
|
||||
|
||||
stat = db_->DropCollection(TABLE_NAME);
|
||||
stat = db_->DropCollection(COLLECTION_NAME);
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
db_->HasCollection(TABLE_NAME, has_collection);
|
||||
db_->HasCollection(COLLECTION_NAME, has_collection);
|
||||
ASSERT_FALSE(has_collection);
|
||||
}
|
||||
|
||||
TEST_F(DBTest2, SHOW_TABLE_INFO_TEST) {
|
||||
std::string collection_name = TABLE_NAME;
|
||||
milvus::engine::meta::CollectionSchema table_schema = BuildTableSchema();
|
||||
auto stat = db_->CreateCollection(table_schema);
|
||||
TEST_F(DBTest2, SHOW_COLLECTION_INFO_TEST) {
|
||||
std::string collection_name = COLLECTION_NAME;
|
||||
milvus::engine::meta::CollectionSchema collection_schema = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_schema);
|
||||
|
||||
uint64_t nb = VECTOR_COUNT;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -1046,7 +1046,7 @@ TEST_F(DBTest2, SHOW_TABLE_INFO_TEST) {
|
|||
}
|
||||
|
||||
TEST_F(DBTestWAL, DB_INSERT_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
|
@ -1075,7 +1075,7 @@ TEST_F(DBTestWAL, DB_INSERT_TEST) {
|
|||
}
|
||||
|
||||
TEST_F(DBTestWAL, DB_STOP_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
|
@ -1107,7 +1107,7 @@ TEST_F(DBTestWAL, DB_STOP_TEST) {
|
|||
}
|
||||
|
||||
TEST_F(DBTestWALRecovery, RECOVERY_WITH_NO_ERROR) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
|
@ -1156,7 +1156,7 @@ TEST_F(DBTestWALRecovery, RECOVERY_WITH_NO_ERROR) {
|
|||
}
|
||||
|
||||
TEST_F(DBTestWALRecovery_Error, RECOVERY_WITH_INVALID_LOG_FILE) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
|
@ -1178,19 +1178,19 @@ TEST_F(DBTestWALRecovery_Error, RECOVERY_WITH_INVALID_LOG_FILE) {
|
|||
ASSERT_ANY_THROW(db_ = milvus::engine::DBFactory::Build(options));
|
||||
}
|
||||
|
||||
TEST_F(DBTest2, FLUSH_NON_EXISTING_TABLE) {
|
||||
auto status = db_->Flush("non_existing_table");
|
||||
TEST_F(DBTest2, FLUSH_NON_EXISTING_COLLECTION) {
|
||||
auto status = db_->Flush("non_existing");
|
||||
ASSERT_FALSE(status.ok());
|
||||
}
|
||||
|
||||
TEST_F(DBTest2, GET_VECTOR_NON_EXISTING_TABLE) {
|
||||
TEST_F(DBTest2, GET_VECTOR_NON_EXISTING_COLLECTION) {
|
||||
milvus::engine::VectorsData vector;
|
||||
auto status = db_->GetVectorByID("non_existing_table", 0, vector);
|
||||
auto status = db_->GetVectorByID("non_existing", 0, vector);
|
||||
ASSERT_FALSE(status.ok());
|
||||
}
|
||||
|
||||
TEST_F(DBTest2, GET_VECTOR_BY_ID_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
|
@ -1209,41 +1209,41 @@ TEST_F(DBTest2, GET_VECTOR_BY_ID_TEST) {
|
|||
db_->Flush(collection_info.collection_id_);
|
||||
|
||||
milvus::engine::VectorsData vector_data;
|
||||
stat = db_->GetVectorByID(TABLE_NAME, qxb.id_array_[0], vector_data);
|
||||
stat = db_->GetVectorByID(COLLECTION_NAME, qxb.id_array_[0], vector_data);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(vector_data.vector_count_, 1);
|
||||
ASSERT_EQ(vector_data.float_data_.size(), TABLE_DIM);
|
||||
ASSERT_EQ(vector_data.float_data_.size(), COLLECTION_DIM);
|
||||
|
||||
for (int64_t i = 0; i < TABLE_DIM; i++) {
|
||||
for (int64_t i = 0; i < COLLECTION_DIM; i++) {
|
||||
ASSERT_FLOAT_EQ(vector_data.float_data_[i], qxb.float_data_[i]);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(DBTest2, GET_VECTOR_IDS_TEST) {
|
||||
milvus::engine::meta::CollectionSchema table_schema = BuildTableSchema();
|
||||
auto stat = db_->CreateCollection(table_schema);
|
||||
milvus::engine::meta::CollectionSchema collection_schema = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_schema);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
uint64_t BATCH_COUNT = 1000;
|
||||
milvus::engine::VectorsData vector_1;
|
||||
BuildVectors(BATCH_COUNT, 0, vector_1);
|
||||
|
||||
stat = db_->InsertVectors(TABLE_NAME, "", vector_1);
|
||||
stat = db_->InsertVectors(COLLECTION_NAME, "", vector_1);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
std::string partition_tag = "part_tag";
|
||||
stat = db_->CreatePartition(TABLE_NAME, "", partition_tag);
|
||||
stat = db_->CreatePartition(COLLECTION_NAME, "", partition_tag);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
milvus::engine::VectorsData vector_2;
|
||||
BuildVectors(BATCH_COUNT, 1, vector_2);
|
||||
stat = db_->InsertVectors(TABLE_NAME, partition_tag, vector_2);
|
||||
stat = db_->InsertVectors(COLLECTION_NAME, partition_tag, vector_2);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
db_->Flush();
|
||||
|
||||
milvus::engine::CollectionInfo collection_info;
|
||||
stat = db_->GetCollectionInfo(TABLE_NAME, collection_info);
|
||||
stat = db_->GetCollectionInfo(COLLECTION_NAME, collection_info);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info.partitions_stat_.size(), 2UL);
|
||||
|
||||
|
@ -1251,25 +1251,25 @@ TEST_F(DBTest2, GET_VECTOR_IDS_TEST) {
|
|||
std::string partition_segment = collection_info.partitions_stat_[1].segments_stat_[0].name_;
|
||||
|
||||
milvus::engine::IDNumbers vector_ids;
|
||||
stat = db_->GetVectorIDs(TABLE_NAME, default_segment, vector_ids);
|
||||
stat = db_->GetVectorIDs(COLLECTION_NAME, default_segment, vector_ids);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(vector_ids.size(), BATCH_COUNT);
|
||||
|
||||
stat = db_->GetVectorIDs(TABLE_NAME, partition_segment, vector_ids);
|
||||
stat = db_->GetVectorIDs(COLLECTION_NAME, partition_segment, vector_ids);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(vector_ids.size(), BATCH_COUNT);
|
||||
|
||||
milvus::engine::IDNumbers ids_to_delete{0, 100, 999, 1000, 1500, 1888, 1999};
|
||||
stat = db_->DeleteVectors(TABLE_NAME, ids_to_delete);
|
||||
stat = db_->DeleteVectors(COLLECTION_NAME, ids_to_delete);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
db_->Flush();
|
||||
|
||||
stat = db_->GetVectorIDs(TABLE_NAME, default_segment, vector_ids);
|
||||
stat = db_->GetVectorIDs(COLLECTION_NAME, default_segment, vector_ids);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(vector_ids.size(), BATCH_COUNT - 3);
|
||||
|
||||
stat = db_->GetVectorIDs(TABLE_NAME, partition_segment, vector_ids);
|
||||
stat = db_->GetVectorIDs(COLLECTION_NAME, partition_segment, vector_ids);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
// ASSERT_EQ(vector_ids.size(), BATCH_COUNT - 4);
|
||||
}
|
||||
|
@ -1279,8 +1279,8 @@ TEST_F(DBTest2, INSERT_DUPLICATE_ID) {
|
|||
options.wal_enable_ = false;
|
||||
db_ = milvus::engine::DBFactory::Build(options);
|
||||
|
||||
milvus::engine::meta::CollectionSchema table_schema = BuildTableSchema();
|
||||
auto stat = db_->CreateCollection(table_schema);
|
||||
milvus::engine::meta::CollectionSchema collection_schema = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_schema);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
uint64_t size = 20;
|
||||
|
@ -1291,16 +1291,16 @@ TEST_F(DBTest2, INSERT_DUPLICATE_ID) {
|
|||
vector.id_array_.emplace_back(0);
|
||||
}
|
||||
|
||||
stat = db_->InsertVectors(TABLE_NAME, "", vector);
|
||||
stat = db_->InsertVectors(COLLECTION_NAME, "", vector);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
stat = db_->Flush(TABLE_NAME);
|
||||
stat = db_->Flush(COLLECTION_NAME);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
}
|
||||
|
||||
/*
|
||||
TEST_F(DBTest2, SEARCH_WITH_DIFFERENT_INDEX) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
// collection_info.index_file_size_ = 1 * milvus::engine::M;
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
|
@ -1310,7 +1310,7 @@ TEST_F(DBTest2, SEARCH_WITH_DIFFERENT_INDEX) {
|
|||
milvus::engine::VectorsData xb;
|
||||
BuildVectors(nb, i, xb);
|
||||
|
||||
db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
stat = db_->Flush();
|
||||
ASSERT_TRUE(stat.ok());
|
||||
}
|
||||
|
|
|
@ -24,16 +24,16 @@
|
|||
|
||||
namespace {
|
||||
|
||||
static const char* TABLE_NAME = "test_group";
|
||||
static constexpr int64_t TABLE_DIM = 256;
|
||||
static const char* COLLECTION_NAME = "test_group";
|
||||
static constexpr int64_t COLLECTION_DIM = 256;
|
||||
static constexpr int64_t VECTOR_COUNT = 25000;
|
||||
static constexpr int64_t INSERT_LOOP = 1000;
|
||||
|
||||
milvus::engine::meta::CollectionSchema
|
||||
BuildTableSchema() {
|
||||
BuildCollectionSchema() {
|
||||
milvus::engine::meta::CollectionSchema collection_info;
|
||||
collection_info.dimension_ = TABLE_DIM;
|
||||
collection_info.collection_id_ = TABLE_NAME;
|
||||
collection_info.dimension_ = COLLECTION_DIM;
|
||||
collection_info.collection_id_ = COLLECTION_NAME;
|
||||
collection_info.engine_type_ = (int)milvus::engine::EngineType::FAISS_IDMAP;
|
||||
return collection_info;
|
||||
}
|
||||
|
@ -42,11 +42,11 @@ void
|
|||
BuildVectors(uint64_t n, uint64_t batch_index, milvus::engine::VectorsData& vectors) {
|
||||
vectors.vector_count_ = n;
|
||||
vectors.float_data_.clear();
|
||||
vectors.float_data_.resize(n * TABLE_DIM);
|
||||
vectors.float_data_.resize(n * COLLECTION_DIM);
|
||||
float* data = vectors.float_data_.data();
|
||||
for (uint64_t i = 0; i < n; i++) {
|
||||
for (int64_t j = 0; j < TABLE_DIM; j++) data[TABLE_DIM * i + j] = drand48();
|
||||
data[TABLE_DIM * i] += i / 2000.;
|
||||
for (int64_t j = 0; j < COLLECTION_DIM; j++) data[COLLECTION_DIM * i + j] = drand48();
|
||||
data[COLLECTION_DIM * i] += i / 2000.;
|
||||
|
||||
vectors.id_array_.push_back(n * batch_index + i);
|
||||
}
|
||||
|
@ -55,14 +55,14 @@ BuildVectors(uint64_t n, uint64_t batch_index, milvus::engine::VectorsData& vect
|
|||
} // namespace
|
||||
|
||||
TEST_F(MySqlDBTest, DB_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = TABLE_NAME;
|
||||
collection_info_get.collection_id_ = COLLECTION_NAME;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
uint64_t qb = 5;
|
||||
milvus::engine::VectorsData qxb;
|
||||
|
@ -91,7 +91,7 @@ TEST_F(MySqlDBTest, DB_TEST) {
|
|||
START_TIMER;
|
||||
|
||||
std::vector<std::string> tags;
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, tags, k, json_params, qxb, result_ids, result_distances);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, k, json_params, qxb, result_ids, result_distances);
|
||||
ss << "Search " << j << " With Size " << count / milvus::engine::M << " M";
|
||||
STOP_TIMER(ss.str());
|
||||
|
||||
|
@ -114,14 +114,14 @@ TEST_F(MySqlDBTest, DB_TEST) {
|
|||
|
||||
for (auto i = 0; i < loop; ++i) {
|
||||
if (i == 40) {
|
||||
db_->InsertVectors(TABLE_NAME, "", qxb);
|
||||
db_->InsertVectors(COLLECTION_NAME, "", qxb);
|
||||
ASSERT_EQ(qxb.id_array_.size(), qb);
|
||||
} else {
|
||||
uint64_t nb = 50;
|
||||
milvus::engine::VectorsData xb;
|
||||
BuildVectors(nb, i, xb);
|
||||
|
||||
db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
ASSERT_EQ(xb.id_array_.size(), nb);
|
||||
}
|
||||
|
||||
|
@ -134,20 +134,20 @@ TEST_F(MySqlDBTest, DB_TEST) {
|
|||
search.join();
|
||||
|
||||
uint64_t count;
|
||||
stat = db_->GetCollectionRowCount(TABLE_NAME, count);
|
||||
stat = db_->GetCollectionRowCount(COLLECTION_NAME, count);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_GT(count, 0);
|
||||
}
|
||||
|
||||
TEST_F(MySqlDBTest, SEARCH_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = TABLE_NAME;
|
||||
collection_info_get.collection_id_ = COLLECTION_NAME;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
// prepare raw data
|
||||
size_t nb = VECTOR_COUNT;
|
||||
|
@ -155,21 +155,21 @@ TEST_F(MySqlDBTest, SEARCH_TEST) {
|
|||
size_t k = 5;
|
||||
milvus::engine::VectorsData xb, xq;
|
||||
xb.vector_count_ = nb;
|
||||
xb.float_data_.resize(nb * TABLE_DIM);
|
||||
xb.float_data_.resize(nb * COLLECTION_DIM);
|
||||
xq.vector_count_ = nq;
|
||||
xq.float_data_.resize(nq * TABLE_DIM);
|
||||
xq.float_data_.resize(nq * COLLECTION_DIM);
|
||||
xb.id_array_.resize(nb);
|
||||
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
std::uniform_real_distribution<> dis_xt(-1.0, 1.0);
|
||||
for (size_t i = 0; i < nb * TABLE_DIM; i++) {
|
||||
for (size_t i = 0; i < nb * COLLECTION_DIM; i++) {
|
||||
xb.float_data_[i] = dis_xt(gen);
|
||||
if (i < nb) {
|
||||
xb.id_array_[i] = i;
|
||||
}
|
||||
}
|
||||
for (size_t i = 0; i < nq * TABLE_DIM; i++) {
|
||||
for (size_t i = 0; i < nq * COLLECTION_DIM; i++) {
|
||||
xq.float_data_[i] = dis_xt(gen);
|
||||
}
|
||||
|
||||
|
@ -180,7 +180,7 @@ TEST_F(MySqlDBTest, SEARCH_TEST) {
|
|||
std::vector<float> dis(k * nq);
|
||||
|
||||
// insert data
|
||||
stat = db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
stat = db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
// sleep(2); // wait until build index finish
|
||||
|
@ -191,12 +191,12 @@ TEST_F(MySqlDBTest, SEARCH_TEST) {
|
|||
milvus::engine::ResultIds result_ids;
|
||||
milvus::engine::ResultDistances result_distances;
|
||||
milvus::json json_params = {{"nprobe", 10}};
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, k, json_params, xq, result_ids, result_distances);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
}
|
||||
|
||||
TEST_F(MySqlDBTest, ARHIVE_DISK_CHECK) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
std::vector<milvus::engine::meta::CollectionSchema> table_schema_array;
|
||||
|
@ -204,7 +204,7 @@ TEST_F(MySqlDBTest, ARHIVE_DISK_CHECK) {
|
|||
ASSERT_TRUE(stat.ok());
|
||||
bool bfound = false;
|
||||
for (auto& schema : table_schema_array) {
|
||||
if (schema.collection_id_ == TABLE_NAME) {
|
||||
if (schema.collection_id_ == COLLECTION_NAME) {
|
||||
bfound = true;
|
||||
break;
|
||||
}
|
||||
|
@ -212,21 +212,21 @@ TEST_F(MySqlDBTest, ARHIVE_DISK_CHECK) {
|
|||
ASSERT_TRUE(bfound);
|
||||
|
||||
fiu_init(0);
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.AllTable.null_connection");
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.AllCollection.null_connection");
|
||||
stat = db_->AllCollections(table_schema_array);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.AllTable.throw_exception");
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.AllCollection.throw_exception");
|
||||
stat = db_->AllCollections(table_schema_array);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
fiu_disable("MySQLMetaImpl.AllTable.null_connection");
|
||||
fiu_disable("MySQLMetaImpl.AllTable.throw_exception");
|
||||
fiu_disable("MySQLMetaImpl.AllCollection.null_connection");
|
||||
fiu_disable("MySQLMetaImpl.AllCollection.throw_exception");
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = TABLE_NAME;
|
||||
collection_info_get.collection_id_ = COLLECTION_NAME;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
milvus::engine::IDNumbers vector_ids;
|
||||
milvus::engine::IDNumbers target_ids;
|
||||
|
@ -240,7 +240,7 @@ TEST_F(MySqlDBTest, ARHIVE_DISK_CHECK) {
|
|||
for (auto i = 0; i < loop; ++i) {
|
||||
milvus::engine::VectorsData xb;
|
||||
BuildVectors(nb, i, xb);
|
||||
db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(1));
|
||||
}
|
||||
|
||||
|
@ -263,17 +263,17 @@ TEST_F(MySqlDBTest, ARHIVE_DISK_CHECK) {
|
|||
}
|
||||
|
||||
TEST_F(MySqlDBTest, DELETE_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
// std::cout << stat.ToString() << std::endl;
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = TABLE_NAME;
|
||||
collection_info_get.collection_id_ = COLLECTION_NAME;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
bool has_collection = false;
|
||||
db_->HasCollection(TABLE_NAME, has_collection);
|
||||
db_->HasCollection(COLLECTION_NAME, has_collection);
|
||||
ASSERT_TRUE(has_collection);
|
||||
|
||||
milvus::engine::IDNumbers vector_ids;
|
||||
|
@ -287,32 +287,32 @@ TEST_F(MySqlDBTest, DELETE_TEST) {
|
|||
for (auto i = 0; i < loop; ++i) {
|
||||
milvus::engine::VectorsData xb;
|
||||
BuildVectors(nb, i, xb);
|
||||
db_->InsertVectors(TABLE_NAME, "", xb);
|
||||
db_->InsertVectors(COLLECTION_NAME, "", xb);
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(1));
|
||||
}
|
||||
|
||||
stat = db_->Flush();
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
stat = db_->DropCollection(TABLE_NAME);
|
||||
stat = db_->DropCollection(COLLECTION_NAME);
|
||||
//// std::cout << "5 sec start" << std::endl;
|
||||
// std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||
//// std::cout << "5 sec finish" << std::endl;
|
||||
ASSERT_TRUE(stat.ok());
|
||||
//
|
||||
db_->HasCollection(TABLE_NAME, has_collection);
|
||||
db_->HasCollection(COLLECTION_NAME, has_collection);
|
||||
ASSERT_FALSE(has_collection);
|
||||
}
|
||||
|
||||
TEST_F(MySqlDBTest, PARTITION_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
// create partition and insert data
|
||||
const int64_t PARTITION_COUNT = 5;
|
||||
const int64_t INSERT_BATCH = 2000;
|
||||
std::string collection_name = TABLE_NAME;
|
||||
std::string collection_name = COLLECTION_NAME;
|
||||
for (int64_t i = 0; i < PARTITION_COUNT; i++) {
|
||||
std::string partition_tag = std::to_string(i);
|
||||
std::string partition_name = collection_name + "_" + partition_tag;
|
||||
|
@ -366,7 +366,7 @@ TEST_F(MySqlDBTest, PARTITION_TEST) {
|
|||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
uint64_t row_count = 0;
|
||||
stat = db_->GetCollectionRowCount(TABLE_NAME, row_count);
|
||||
stat = db_->GetCollectionRowCount(COLLECTION_NAME, row_count);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(row_count, INSERT_BATCH * PARTITION_COUNT);
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ TEST_F(MySqlDBTest, PARTITION_TEST) {
|
|||
milvus::engine::ResultIds result_ids;
|
||||
milvus::engine::ResultDistances result_distances;
|
||||
milvus::json json_params = {{"nprobe", nprobe}};
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, tags, topk, json_params, xq, result_ids, result_distances);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, topk, json_params, xq, result_ids, result_distances);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(result_ids.size() / topk, nq);
|
||||
|
||||
|
@ -391,7 +391,7 @@ TEST_F(MySqlDBTest, PARTITION_TEST) {
|
|||
tags.clear();
|
||||
result_ids.clear();
|
||||
result_distances.clear();
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, tags, topk, json_params, xq, result_ids, result_distances);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, topk, json_params, xq, result_ids, result_distances);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(result_ids.size() / topk, nq);
|
||||
|
||||
|
@ -399,7 +399,7 @@ TEST_F(MySqlDBTest, PARTITION_TEST) {
|
|||
tags.push_back("\\d");
|
||||
result_ids.clear();
|
||||
result_distances.clear();
|
||||
stat = db_->Query(dummy_context_, TABLE_NAME, tags, topk, json_params, xq, result_ids, result_distances);
|
||||
stat = db_->Query(dummy_context_, COLLECTION_NAME, tags, topk, json_params, xq, result_ids, result_distances);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(result_ids.size() / topk, nq);
|
||||
}
|
||||
|
@ -459,13 +459,13 @@ TEST_F(MySqlDBTest, PARTITION_TEST) {
|
|||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
stat = db_->CreatePartition(collection_name, collection_name + "_1", "1");
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.DeleteTableFiles.null_connection");
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.DeleteCollectionFiles.null_connection");
|
||||
stat = db_->DropPartition(collection_name + "_1");
|
||||
fiu_disable("MySQLMetaImpl.DeleteTableFiles.null_connection");
|
||||
fiu_disable("MySQLMetaImpl.DeleteCollectionFiles.null_connection");
|
||||
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.DeleteTableFiles.throw_exception");
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.DeleteCollectionFiles.throw_exception");
|
||||
stat = db_->DropPartition(collection_name + "_1");
|
||||
fiu_disable("MySQLMetaImpl.DeleteTableFiles.throw_exception");
|
||||
fiu_disable("MySQLMetaImpl.DeleteCollectionFiles.throw_exception");
|
||||
}
|
||||
|
||||
{
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
|
||||
namespace {
|
||||
|
||||
static constexpr int64_t TABLE_DIM = 256;
|
||||
static constexpr int64_t COLLECTION_DIM = 256;
|
||||
|
||||
std::string
|
||||
GetTableName() {
|
||||
GetCollectionName() {
|
||||
auto now = std::chrono::system_clock::now();
|
||||
auto micros = std::chrono::duration_cast<std::chrono::microseconds>(now.time_since_epoch()).count();
|
||||
static std::string collection_name = std::to_string(micros);
|
||||
|
@ -42,10 +42,10 @@ GetTableName() {
|
|||
}
|
||||
|
||||
milvus::engine::meta::CollectionSchema
|
||||
BuildTableSchema() {
|
||||
BuildCollectionSchema() {
|
||||
milvus::engine::meta::CollectionSchema collection_info;
|
||||
collection_info.dimension_ = TABLE_DIM;
|
||||
collection_info.collection_id_ = GetTableName();
|
||||
collection_info.dimension_ = COLLECTION_DIM;
|
||||
collection_info.collection_id_ = GetCollectionName();
|
||||
collection_info.metric_type_ = (int32_t)milvus::engine::MetricType::L2;
|
||||
collection_info.engine_type_ = (int)milvus::engine::EngineType::FAISS_IDMAP;
|
||||
return collection_info;
|
||||
|
@ -55,23 +55,23 @@ void
|
|||
BuildVectors(uint64_t n, milvus::engine::VectorsData& vectors) {
|
||||
vectors.vector_count_ = n;
|
||||
vectors.float_data_.clear();
|
||||
vectors.float_data_.resize(n * TABLE_DIM);
|
||||
vectors.float_data_.resize(n * COLLECTION_DIM);
|
||||
float* data = vectors.float_data_.data();
|
||||
for (int i = 0; i < n; i++) {
|
||||
for (int j = 0; j < TABLE_DIM; j++) data[TABLE_DIM * i + j] = drand48();
|
||||
for (int j = 0; j < COLLECTION_DIM; j++) data[COLLECTION_DIM * i + j] = drand48();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
TEST_F(DeleteTest, delete_in_mem) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 100000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -94,8 +94,8 @@ TEST_F(DeleteTest, delete_in_mem) {
|
|||
int64_t index = dis(gen);
|
||||
milvus::engine::VectorsData search;
|
||||
search.vector_count_ = 1;
|
||||
for (int64_t j = 0; j < TABLE_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * TABLE_DIM + j]);
|
||||
for (int64_t j = 0; j < COLLECTION_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * COLLECTION_DIM + j]);
|
||||
}
|
||||
search_vectors.insert(std::make_pair(xb.id_array_[index], search));
|
||||
}
|
||||
|
@ -133,14 +133,14 @@ TEST_F(DeleteTest, delete_in_mem) {
|
|||
}
|
||||
|
||||
TEST_F(DeleteTest, delete_on_disk) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 100000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -163,8 +163,8 @@ TEST_F(DeleteTest, delete_on_disk) {
|
|||
int64_t index = dis(gen);
|
||||
milvus::engine::VectorsData search;
|
||||
search.vector_count_ = 1;
|
||||
for (int64_t j = 0; j < TABLE_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * TABLE_DIM + j]);
|
||||
for (int64_t j = 0; j < COLLECTION_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * COLLECTION_DIM + j]);
|
||||
}
|
||||
search_vectors.insert(std::make_pair(xb.id_array_[index], search));
|
||||
}
|
||||
|
@ -202,14 +202,14 @@ TEST_F(DeleteTest, delete_on_disk) {
|
|||
}
|
||||
|
||||
TEST_F(DeleteTest, delete_multiple_times) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 100000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -232,8 +232,8 @@ TEST_F(DeleteTest, delete_multiple_times) {
|
|||
int64_t index = dis(gen);
|
||||
milvus::engine::VectorsData search;
|
||||
search.vector_count_ = 1;
|
||||
for (int64_t j = 0; j < TABLE_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * TABLE_DIM + j]);
|
||||
for (int64_t j = 0; j < COLLECTION_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * COLLECTION_DIM + j]);
|
||||
}
|
||||
search_vectors.insert(std::make_pair(xb.id_array_[index], search));
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ TEST_F(DeleteTest, delete_multiple_times) {
|
|||
}
|
||||
|
||||
TEST_F(DeleteTest, delete_before_create_index) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
collection_info.engine_type_ = (int32_t)milvus::engine::EngineType::FAISS_IVFFLAT;
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
|
@ -273,7 +273,7 @@ TEST_F(DeleteTest, delete_before_create_index) {
|
|||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 10000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -299,8 +299,8 @@ TEST_F(DeleteTest, delete_before_create_index) {
|
|||
int64_t index = dis(gen);
|
||||
milvus::engine::VectorsData search;
|
||||
search.vector_count_ = 1;
|
||||
for (int64_t j = 0; j < TABLE_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * TABLE_DIM + j]);
|
||||
for (int64_t j = 0; j < COLLECTION_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * COLLECTION_DIM + j]);
|
||||
}
|
||||
search_vectors.insert(std::make_pair(xb.id_array_[index], search));
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ TEST_F(DeleteTest, delete_before_create_index) {
|
|||
}
|
||||
|
||||
TEST_F(DeleteTest, delete_with_index) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
collection_info.engine_type_ = (int32_t)milvus::engine::EngineType::FAISS_IVFFLAT;
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
|
@ -349,7 +349,7 @@ TEST_F(DeleteTest, delete_with_index) {
|
|||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 10000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -372,8 +372,8 @@ TEST_F(DeleteTest, delete_with_index) {
|
|||
int64_t index = dis(gen);
|
||||
milvus::engine::VectorsData search;
|
||||
search.vector_count_ = 1;
|
||||
for (int64_t j = 0; j < TABLE_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * TABLE_DIM + j]);
|
||||
for (int64_t j = 0; j < COLLECTION_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * COLLECTION_DIM + j]);
|
||||
}
|
||||
search_vectors.insert(std::make_pair(xb.id_array_[index], search));
|
||||
}
|
||||
|
@ -418,14 +418,14 @@ TEST_F(DeleteTest, delete_with_index) {
|
|||
}
|
||||
|
||||
TEST_F(DeleteTest, delete_multiple_times_with_index) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 100000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -448,8 +448,8 @@ TEST_F(DeleteTest, delete_multiple_times_with_index) {
|
|||
int64_t index = dis(gen);
|
||||
milvus::engine::VectorsData search;
|
||||
search.vector_count_ = 1;
|
||||
for (int64_t j = 0; j < TABLE_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * TABLE_DIM + j]);
|
||||
for (int64_t j = 0; j < COLLECTION_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * COLLECTION_DIM + j]);
|
||||
}
|
||||
search_vectors.insert(std::make_pair(xb.id_array_[index], search));
|
||||
}
|
||||
|
@ -496,14 +496,14 @@ TEST_F(DeleteTest, delete_multiple_times_with_index) {
|
|||
}
|
||||
|
||||
TEST_F(DeleteTest, delete_single_vector) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 1;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -543,14 +543,14 @@ TEST_F(DeleteTest, delete_single_vector) {
|
|||
}
|
||||
|
||||
TEST_F(DeleteTest, delete_add_create_index) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 3000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -595,7 +595,7 @@ TEST_F(DeleteTest, delete_add_create_index) {
|
|||
milvus::engine::ResultIds result_ids;
|
||||
milvus::engine::ResultDistances result_distances;
|
||||
milvus::engine::VectorsData qb = xb;
|
||||
qb.float_data_.resize(TABLE_DIM);
|
||||
qb.float_data_.resize(COLLECTION_DIM);
|
||||
qb.vector_count_ = 1;
|
||||
qb.id_array_.clear();
|
||||
stat = db_->Query(dummy_context_,
|
||||
|
@ -613,14 +613,14 @@ TEST_F(DeleteTest, delete_add_create_index) {
|
|||
}
|
||||
|
||||
TEST_F(DeleteTest, delete_add_auto_flush) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 3000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -667,7 +667,7 @@ TEST_F(DeleteTest, delete_add_auto_flush) {
|
|||
milvus::engine::ResultIds result_ids;
|
||||
milvus::engine::ResultDistances result_distances;
|
||||
milvus::engine::VectorsData qb = xb;
|
||||
qb.float_data_.resize(TABLE_DIM);
|
||||
qb.float_data_.resize(COLLECTION_DIM);
|
||||
qb.vector_count_ = 1;
|
||||
qb.id_array_.clear();
|
||||
stat = db_->Query(dummy_context_,
|
||||
|
@ -686,14 +686,14 @@ TEST_F(DeleteTest, delete_add_auto_flush) {
|
|||
}
|
||||
|
||||
TEST_F(CompactTest, compact_basic) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 100;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -739,7 +739,7 @@ TEST_F(CompactTest, compact_basic) {
|
|||
}
|
||||
|
||||
TEST_F(CompactTest, compact_with_index) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
collection_info.index_file_size_ = milvus::engine::ONE_KB;
|
||||
collection_info.engine_type_ = (int32_t)milvus::engine::EngineType::FAISS_IVFSQ8;
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
@ -748,7 +748,7 @@ TEST_F(CompactTest, compact_with_index) {
|
|||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 3000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -772,8 +772,8 @@ TEST_F(CompactTest, compact_with_index) {
|
|||
int64_t index = dis(gen);
|
||||
milvus::engine::VectorsData search;
|
||||
search.vector_count_ = 1;
|
||||
for (int64_t j = 0; j < TABLE_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * TABLE_DIM + j]);
|
||||
for (int64_t j = 0; j < COLLECTION_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * COLLECTION_DIM + j]);
|
||||
}
|
||||
search_vectors.insert(std::make_pair(xb.id_array_[index], search));
|
||||
}
|
||||
|
|
|
@ -33,10 +33,10 @@
|
|||
|
||||
namespace {
|
||||
|
||||
static constexpr int64_t TABLE_DIM = 256;
|
||||
static constexpr int64_t COLLECTION_DIM = 256;
|
||||
|
||||
std::string
|
||||
GetTableName() {
|
||||
GetCollectionName() {
|
||||
auto now = std::chrono::system_clock::now();
|
||||
auto micros = std::chrono::duration_cast<std::chrono::microseconds>(now.time_since_epoch()).count();
|
||||
static std::string collection_name = std::to_string(micros);
|
||||
|
@ -44,10 +44,10 @@ GetTableName() {
|
|||
}
|
||||
|
||||
milvus::engine::meta::CollectionSchema
|
||||
BuildTableSchema() {
|
||||
BuildCollectionSchema() {
|
||||
milvus::engine::meta::CollectionSchema collection_info;
|
||||
collection_info.dimension_ = TABLE_DIM;
|
||||
collection_info.collection_id_ = GetTableName();
|
||||
collection_info.dimension_ = COLLECTION_DIM;
|
||||
collection_info.collection_id_ = GetCollectionName();
|
||||
collection_info.engine_type_ = (int)milvus::engine::EngineType::FAISS_IDMAP;
|
||||
return collection_info;
|
||||
}
|
||||
|
@ -56,21 +56,21 @@ void
|
|||
BuildVectors(uint64_t n, milvus::engine::VectorsData& vectors) {
|
||||
vectors.vector_count_ = n;
|
||||
vectors.float_data_.clear();
|
||||
vectors.float_data_.resize(n * TABLE_DIM);
|
||||
vectors.float_data_.resize(n * COLLECTION_DIM);
|
||||
float* data = vectors.float_data_.data();
|
||||
for (int i = 0; i < n; i++) {
|
||||
for (int j = 0; j < TABLE_DIM; j++) data[TABLE_DIM * i + j] = drand48();
|
||||
for (int j = 0; j < COLLECTION_DIM; j++) data[COLLECTION_DIM * i + j] = drand48();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
TEST_F(MemManagerTest, VECTOR_SOURCE_TEST) {
|
||||
milvus::engine::meta::CollectionSchema table_schema = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema table_schema = BuildCollectionSchema();
|
||||
auto status = impl_->CreateCollection(table_schema);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
milvus::engine::meta::SegmentSchema table_file_schema;
|
||||
table_file_schema.collection_id_ = GetTableName();
|
||||
table_file_schema.collection_id_ = GetCollectionName();
|
||||
status = impl_->CreateCollectionFile(table_file_schema);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
|
@ -113,11 +113,11 @@ TEST_F(MemManagerTest, MEM_TABLE_FILE_TEST) {
|
|||
auto options = GetOptions();
|
||||
fiu_init(0);
|
||||
|
||||
milvus::engine::meta::CollectionSchema table_schema = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema table_schema = BuildCollectionSchema();
|
||||
auto status = impl_->CreateCollection(table_schema);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
milvus::engine::MemTableFile mem_table_file(GetTableName(), impl_, options);
|
||||
milvus::engine::MemTableFile mem_table_file(GetCollectionName(), impl_, options);
|
||||
|
||||
int64_t n_100 = 100;
|
||||
milvus::engine::VectorsData vectors_100;
|
||||
|
@ -130,7 +130,7 @@ TEST_F(MemManagerTest, MEM_TABLE_FILE_TEST) {
|
|||
|
||||
// std::cout << mem_table_file.GetCurrentMem() << " " << mem_table_file.GetMemLeft() << std::endl;
|
||||
|
||||
size_t singleVectorMem = sizeof(float) * TABLE_DIM;
|
||||
size_t singleVectorMem = sizeof(float) * COLLECTION_DIM;
|
||||
ASSERT_EQ(mem_table_file.GetCurrentMem(), n_100 * singleVectorMem);
|
||||
|
||||
int64_t n_max = milvus::engine::MAX_TABLE_FILE_MEM / singleVectorMem;
|
||||
|
@ -152,7 +152,7 @@ TEST_F(MemManagerTest, MEM_TABLE_FILE_TEST) {
|
|||
{
|
||||
//test fail create collection file
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.CreateCollectionFile.throw_exception");
|
||||
milvus::engine::MemTableFile mem_table_file_1(GetTableName(), impl_, options);
|
||||
milvus::engine::MemTableFile mem_table_file_1(GetCollectionName(), impl_, options);
|
||||
fiu_disable("SqliteMetaImpl.CreateCollectionFile.throw_exception");
|
||||
|
||||
status = mem_table_file_1.Add(source);
|
||||
|
@ -162,7 +162,7 @@ TEST_F(MemManagerTest, MEM_TABLE_FILE_TEST) {
|
|||
|
||||
{
|
||||
options.insert_cache_immediately_ = true;
|
||||
milvus::engine::meta::CollectionSchema table_schema = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema table_schema = BuildCollectionSchema();
|
||||
table_schema.collection_id_ = "faiss_pq";
|
||||
table_schema.engine_type_ = (int)milvus::engine::EngineType::FAISS_PQ;
|
||||
auto status = impl_->CreateCollection(table_schema);
|
||||
|
@ -176,7 +176,7 @@ TEST_F(MemManagerTest, MEM_TABLE_FILE_TEST) {
|
|||
TEST_F(MemManagerTest, MEM_TABLE_TEST) {
|
||||
auto options = GetOptions();
|
||||
|
||||
milvus::engine::meta::CollectionSchema table_schema = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema table_schema = BuildCollectionSchema();
|
||||
auto status = impl_->CreateCollection(table_schema);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
|
@ -185,7 +185,7 @@ TEST_F(MemManagerTest, MEM_TABLE_TEST) {
|
|||
BuildVectors(n_100, vectors_100);
|
||||
|
||||
milvus::engine::VectorSourcePtr source_100 = std::make_shared<milvus::engine::VectorSource>(vectors_100);
|
||||
milvus::engine::MemTable mem_table(GetTableName(), impl_, options);
|
||||
milvus::engine::MemTable mem_table(GetCollectionName(), impl_, options);
|
||||
|
||||
status = mem_table.Add(source_100);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
@ -193,7 +193,7 @@ TEST_F(MemManagerTest, MEM_TABLE_TEST) {
|
|||
|
||||
milvus::engine::MemTableFilePtr mem_table_file;
|
||||
mem_table.GetCurrentMemTableFile(mem_table_file);
|
||||
size_t singleVectorMem = sizeof(float) * TABLE_DIM;
|
||||
size_t singleVectorMem = sizeof(float) * COLLECTION_DIM;
|
||||
ASSERT_EQ(mem_table_file->GetCurrentMem(), n_100 * singleVectorMem);
|
||||
|
||||
int64_t n_max = milvus::engine::MAX_TABLE_FILE_MEM / singleVectorMem;
|
||||
|
@ -245,14 +245,14 @@ TEST_F(MemManagerTest, MEM_TABLE_TEST) {
|
|||
}
|
||||
|
||||
TEST_F(MemManagerTest2, SERIAL_INSERT_SEARCH_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = GetTableName();
|
||||
collection_info_get.collection_id_ = GetCollectionName();
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 100000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -262,7 +262,7 @@ TEST_F(MemManagerTest2, SERIAL_INSERT_SEARCH_TEST) {
|
|||
xb.id_array_.push_back(i);
|
||||
}
|
||||
|
||||
stat = db_->InsertVectors(GetTableName(), "", xb);
|
||||
stat = db_->InsertVectors(GetCollectionName(), "", xb);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
// std::this_thread::sleep_for(std::chrono::seconds(3)); // ensure raw data write to disk
|
||||
|
@ -279,8 +279,8 @@ TEST_F(MemManagerTest2, SERIAL_INSERT_SEARCH_TEST) {
|
|||
int64_t index = dis(gen);
|
||||
milvus::engine::VectorsData search;
|
||||
search.vector_count_ = 1;
|
||||
for (int64_t j = 0; j < TABLE_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * TABLE_DIM + j]);
|
||||
for (int64_t j = 0; j < COLLECTION_DIM; j++) {
|
||||
search.float_data_.push_back(xb.float_data_[index * COLLECTION_DIM + j]);
|
||||
}
|
||||
search_vectors.insert(std::make_pair(xb.id_array_[index], search));
|
||||
}
|
||||
|
@ -295,21 +295,28 @@ TEST_F(MemManagerTest2, SERIAL_INSERT_SEARCH_TEST) {
|
|||
milvus::engine::ResultDistances result_distances;
|
||||
|
||||
stat =
|
||||
db_->Query(dummy_context_, GetTableName(), tags, topk, json_params, search, result_ids, result_distances);
|
||||
db_->Query(dummy_context_,
|
||||
GetCollectionName(),
|
||||
tags,
|
||||
topk,
|
||||
json_params,
|
||||
search,
|
||||
result_ids,
|
||||
result_distances);
|
||||
ASSERT_EQ(result_ids[0], pair.first);
|
||||
ASSERT_LT(result_distances[0], 1e-4);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(MemManagerTest2, INSERT_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = GetTableName();
|
||||
collection_info_get.collection_id_ = GetCollectionName();
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
auto start_time = METRICS_NOW_TIME;
|
||||
|
||||
|
@ -319,7 +326,7 @@ TEST_F(MemManagerTest2, INSERT_TEST) {
|
|||
milvus::engine::VectorsData xb;
|
||||
BuildVectors(nb, xb);
|
||||
milvus::engine::IDNumbers vector_ids;
|
||||
stat = db_->InsertVectors(GetTableName(), "", xb);
|
||||
stat = db_->InsertVectors(GetCollectionName(), "", xb);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
}
|
||||
auto end_time = METRICS_NOW_TIME;
|
||||
|
@ -329,18 +336,18 @@ TEST_F(MemManagerTest2, INSERT_TEST) {
|
|||
|
||||
TEST_F(MemManagerTest2, INSERT_BINARY_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info;
|
||||
collection_info.dimension_ = TABLE_DIM;
|
||||
collection_info.collection_id_ = GetTableName();
|
||||
collection_info.dimension_ = COLLECTION_DIM;
|
||||
collection_info.collection_id_ = GetCollectionName();
|
||||
collection_info.engine_type_ = (int)milvus::engine::EngineType::FAISS_BIN_IDMAP;
|
||||
collection_info.metric_type_ = (int32_t)milvus::engine::MetricType::JACCARD;
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = GetTableName();
|
||||
collection_info_get.collection_id_ = GetCollectionName();
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int insert_loop = 10;
|
||||
for (int k = 0; k < insert_loop; ++k) {
|
||||
|
@ -348,29 +355,30 @@ TEST_F(MemManagerTest2, INSERT_BINARY_TEST) {
|
|||
int64_t nb = 10000;
|
||||
vectors.vector_count_ = nb;
|
||||
vectors.binary_data_.clear();
|
||||
vectors.binary_data_.resize(nb * TABLE_DIM);
|
||||
vectors.binary_data_.resize(nb * COLLECTION_DIM);
|
||||
uint8_t* data = vectors.binary_data_.data();
|
||||
|
||||
std::random_device rd;
|
||||
std::mt19937 gen(rd());
|
||||
std::uniform_int_distribution<> distribution{0, std::numeric_limits<uint8_t>::max()};
|
||||
for (int i = 0; i < nb; i++) {
|
||||
for (int j = 0; j < TABLE_DIM; j++) data[TABLE_DIM * i + j] = distribution(gen);
|
||||
for (int j = 0; j < COLLECTION_DIM; j++) data[COLLECTION_DIM * i + j] = distribution(gen);
|
||||
}
|
||||
milvus::engine::IDNumbers vector_ids;
|
||||
stat = db_->InsertVectors(GetTableName(), "", vectors);
|
||||
stat = db_->InsertVectors(GetCollectionName(), "", vectors);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
}
|
||||
}
|
||||
// TEST_F(MemManagerTest2, CONCURRENT_INSERT_SEARCH_TEST) {
|
||||
// milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
|
||||
//TEST_F(MemManagerTest2, CONCURRENT_INSERT_SEARCH_TEST) {
|
||||
// milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
// auto stat = db_->CreateCollection(collection_info);
|
||||
//
|
||||
// milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
// collection_info_get.collection_id_ = GetTableName();
|
||||
// collection_info_get.collection_id_ = GetCollectionName();
|
||||
// stat = db_->DescribeCollection(collection_info_get);
|
||||
// ASSERT_TRUE(stat.ok());
|
||||
// ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
// ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
//
|
||||
// int64_t nb = 40960;
|
||||
// milvus::engine::VectorsData xb;
|
||||
|
@ -401,7 +409,14 @@ TEST_F(MemManagerTest2, INSERT_BINARY_TEST) {
|
|||
//
|
||||
// std::vector<std::string> tags;
|
||||
// stat =
|
||||
// db_->Query(dummy_context_, GetTableName(), tags, k, json_params, qxb, result_ids, result_distances);
|
||||
// db_->Query(dummy_context_,
|
||||
// GetCollectionName(),
|
||||
// tags,
|
||||
// k,
|
||||
// json_params,
|
||||
// qxb,
|
||||
// result_ids,
|
||||
// result_distances);
|
||||
// ss << "Search " << j << " With Size " << count / milvus::engine::M << " M";
|
||||
// STOP_TIMER(ss.str());
|
||||
//
|
||||
|
@ -425,11 +440,11 @@ TEST_F(MemManagerTest2, INSERT_BINARY_TEST) {
|
|||
// for (auto i = 0; i < loop; ++i) {
|
||||
// if (i == 0) {
|
||||
// qxb.id_array_.clear();
|
||||
// db_->InsertVectors(GetTableName(), "", qxb);
|
||||
// db_->InsertVectors(GetCollectionName(), "", qxb);
|
||||
// ASSERT_EQ(qxb.id_array_.size(), qb);
|
||||
// } else {
|
||||
// xb.id_array_.clear();
|
||||
// db_->InsertVectors(GetTableName(), "", xb);
|
||||
// db_->InsertVectors(GetCollectionName(), "", xb);
|
||||
// ASSERT_EQ(xb.id_array_.size(), nb);
|
||||
// }
|
||||
// std::this_thread::sleep_for(std::chrono::microseconds(1));
|
||||
|
@ -439,14 +454,14 @@ TEST_F(MemManagerTest2, INSERT_BINARY_TEST) {
|
|||
//}
|
||||
|
||||
TEST_F(MemManagerTest2, VECTOR_IDS_TEST) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = GetTableName();
|
||||
collection_info_get.collection_id_ = GetCollectionName();
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 100000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -457,7 +472,7 @@ TEST_F(MemManagerTest2, VECTOR_IDS_TEST) {
|
|||
xb.id_array_[i] = i;
|
||||
}
|
||||
|
||||
stat = db_->InsertVectors(GetTableName(), "", xb);
|
||||
stat = db_->InsertVectors(GetCollectionName(), "", xb);
|
||||
ASSERT_EQ(xb.id_array_[0], 0);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
|
@ -468,7 +483,7 @@ TEST_F(MemManagerTest2, VECTOR_IDS_TEST) {
|
|||
for (auto i = 0; i < nb; i++) {
|
||||
xb.id_array_[i] = i + nb;
|
||||
}
|
||||
stat = db_->InsertVectors(GetTableName(), "", xb);
|
||||
stat = db_->InsertVectors(GetCollectionName(), "", xb);
|
||||
ASSERT_EQ(xb.id_array_[0], nb);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
|
@ -479,14 +494,14 @@ TEST_F(MemManagerTest2, VECTOR_IDS_TEST) {
|
|||
for (auto i = 0; i < nb; i++) {
|
||||
xb.id_array_[i] = i + nb / 2;
|
||||
}
|
||||
stat = db_->InsertVectors(GetTableName(), "", xb);
|
||||
stat = db_->InsertVectors(GetCollectionName(), "", xb);
|
||||
ASSERT_EQ(xb.id_array_[0], nb / 2);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
nb = 65536; // 128M
|
||||
BuildVectors(nb, xb);
|
||||
xb.id_array_.clear();
|
||||
stat = db_->InsertVectors(GetTableName(), "", xb);
|
||||
stat = db_->InsertVectors(GetCollectionName(), "", xb);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
|
||||
nb = 100;
|
||||
|
@ -496,7 +511,7 @@ TEST_F(MemManagerTest2, VECTOR_IDS_TEST) {
|
|||
for (auto i = 0; i < nb; i++) {
|
||||
xb.id_array_[i] = i + nb;
|
||||
}
|
||||
stat = db_->InsertVectors(GetTableName(), "", xb);
|
||||
stat = db_->InsertVectors(GetCollectionName(), "", xb);
|
||||
for (auto i = 0; i < nb; i++) {
|
||||
ASSERT_EQ(xb.id_array_[i], i + nb);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <boost/filesystem/operations.hpp>
|
||||
#include "src/db/OngoingFileChecker.h"
|
||||
|
||||
TEST_F(MetaTest, TABLE_TEST) {
|
||||
TEST_F(MetaTest, COLLECTION_TEST) {
|
||||
auto collection_id = "meta_test_table";
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection;
|
||||
|
@ -143,22 +143,22 @@ TEST_F(MetaTest, FALID_TEST) {
|
|||
fiu_disable("SqliteMetaImpl.CreateCollectionFile.throw_exception");
|
||||
}
|
||||
{
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.DeleteTableFiles.throw_exception");
|
||||
status = impl_->DeleteTableFiles(collection.collection_id_);
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.DeleteCollectionFiles.throw_exception");
|
||||
status = impl_->DeleteCollectionFiles(collection.collection_id_);
|
||||
ASSERT_FALSE(status.ok());
|
||||
fiu_disable("SqliteMetaImpl.DeleteTableFiles.throw_exception");
|
||||
fiu_disable("SqliteMetaImpl.DeleteCollectionFiles.throw_exception");
|
||||
}
|
||||
{
|
||||
milvus::engine::meta::SegmentsSchema schemas;
|
||||
std::vector<size_t> ids;
|
||||
status = impl_->GetTableFiles("notexist", ids, schemas);
|
||||
status = impl_->GetCollectionFiles("notexist", ids, schemas);
|
||||
ASSERT_FALSE(status.ok());
|
||||
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.GetTableFiles.throw_exception");
|
||||
status = impl_->GetTableFiles(collection_id, ids, schemas);
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.GetCollectionFiles.throw_exception");
|
||||
status = impl_->GetCollectionFiles(collection_id, ids, schemas);
|
||||
ASSERT_FALSE(status.ok());
|
||||
ASSERT_EQ(status.code(), milvus::DB_META_TRANSACTION_FAILED);
|
||||
fiu_disable("SqliteMetaImpl.GetTableFiles.throw_exception");
|
||||
fiu_disable("SqliteMetaImpl.GetCollectionFiles.throw_exception");
|
||||
}
|
||||
{
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.UpdateCollectionFlag.throw_exception");
|
||||
|
@ -278,10 +278,10 @@ TEST_F(MetaTest, FALID_TEST) {
|
|||
impl_->UpdateCollectionFile(file);
|
||||
|
||||
milvus::engine::meta::SegmentsSchema files;
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl_FilesToIndex_TableNotFound");
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl_FilesToIndex_CollectionNotFound");
|
||||
status = impl_->FilesToIndex(files);
|
||||
ASSERT_EQ(status.code(), milvus::DB_NOT_FOUND);
|
||||
fiu_disable("SqliteMetaImpl_FilesToIndex_TableNotFound");
|
||||
fiu_disable("SqliteMetaImpl_FilesToIndex_CollectionNotFound");
|
||||
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.FilesToIndex.throw_exception");
|
||||
status = impl_->FilesToIndex(files);
|
||||
|
@ -336,24 +336,24 @@ TEST_F(MetaTest, FALID_TEST) {
|
|||
ASSERT_EQ(status.code(), milvus::DB_META_TRANSACTION_FAILED);
|
||||
fiu_disable("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveFile_FailCommited");
|
||||
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveTable_Failcommited");
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveCollection_Failcommited");
|
||||
status = impl_->CleanUpFilesWithTTL(1);
|
||||
ASSERT_EQ(status.code(), milvus::DB_META_TRANSACTION_FAILED);
|
||||
fiu_disable("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveTable_Failcommited");
|
||||
fiu_disable("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveCollection_Failcommited");
|
||||
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveTable_ThrowException");
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveCollection_ThrowException");
|
||||
status = impl_->CleanUpFilesWithTTL(1);
|
||||
ASSERT_EQ(status.code(), milvus::DB_META_TRANSACTION_FAILED);
|
||||
fiu_disable("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveTable_ThrowException");
|
||||
fiu_disable("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveCollection_ThrowException");
|
||||
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveTableFolder_ThrowException");
|
||||
FIU_ENABLE_FIU("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveCollectionFolder_ThrowException");
|
||||
status = impl_->CleanUpFilesWithTTL(1);
|
||||
ASSERT_EQ(status.code(), milvus::DB_META_TRANSACTION_FAILED);
|
||||
fiu_disable("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveTableFolder_ThrowException");
|
||||
fiu_disable("SqliteMetaImpl.CleanUpFilesWithTTL.RemoveCollectionFolder_ThrowException");
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(MetaTest, TABLE_FILE_TEST) {
|
||||
TEST_F(MetaTest, COLLECTION_FILE_TEST) {
|
||||
auto collection_id = "meta_test_table";
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection;
|
||||
|
@ -382,7 +382,7 @@ TEST_F(MetaTest, TABLE_FILE_TEST) {
|
|||
ASSERT_EQ(table_file.file_type_, new_file_type);
|
||||
}
|
||||
|
||||
TEST_F(MetaTest, TABLE_FILE_ROW_COUNT_TEST) {
|
||||
TEST_F(MetaTest, COLLECTION_FILE_ROW_COUNT_TEST) {
|
||||
auto collection_id = "row_count_test_table";
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection;
|
||||
|
@ -411,7 +411,7 @@ TEST_F(MetaTest, TABLE_FILE_ROW_COUNT_TEST) {
|
|||
|
||||
std::vector<size_t> ids = {table_file.id_};
|
||||
milvus::engine::meta::SegmentsSchema schemas;
|
||||
status = impl_->GetTableFiles(collection_id, ids, schemas);
|
||||
status = impl_->GetCollectionFiles(collection_id, ids, schemas);
|
||||
ASSERT_EQ(schemas.size(), 1UL);
|
||||
ASSERT_EQ(table_file.row_count_, schemas[0].row_count_);
|
||||
ASSERT_EQ(table_file.file_id_, schemas[0].file_id_);
|
||||
|
@ -471,7 +471,7 @@ TEST_F(MetaTest, ARCHIVE_TEST_DAYS) {
|
|||
int i = 0;
|
||||
|
||||
milvus::engine::meta::SegmentsSchema files_get;
|
||||
status = impl.GetTableFiles(table_file.collection_id_, ids, files_get);
|
||||
status = impl.GetCollectionFiles(table_file.collection_id_, ids, files_get);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
for (auto& file : files_get) {
|
||||
|
@ -527,7 +527,7 @@ TEST_F(MetaTest, ARCHIVE_TEST_DISK) {
|
|||
int i = 0;
|
||||
|
||||
milvus::engine::meta::SegmentsSchema files_get;
|
||||
status = impl.GetTableFiles(table_file.collection_id_, ids, files_get);
|
||||
status = impl.GetCollectionFiles(table_file.collection_id_, ids, files_get);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
for (auto& file : files_get) {
|
||||
|
@ -540,7 +540,7 @@ TEST_F(MetaTest, ARCHIVE_TEST_DISK) {
|
|||
impl.DropAll();
|
||||
}
|
||||
|
||||
TEST_F(MetaTest, TABLE_FILES_TEST) {
|
||||
TEST_F(MetaTest, COLLECTION_FILES_TEST) {
|
||||
auto collection_id = "meta_test_group";
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection;
|
||||
|
@ -656,7 +656,7 @@ TEST_F(MetaTest, TABLE_FILES_TEST) {
|
|||
to_index_files_cnt + index_files_cnt;
|
||||
ASSERT_EQ(table_files.size(), total_cnt);
|
||||
|
||||
status = impl_->DeleteTableFiles(collection_id);
|
||||
status = impl_->DeleteCollectionFiles(collection_id);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
status = impl_->CreateCollectionFile(table_file);
|
||||
|
@ -733,7 +733,7 @@ TEST_F(MetaTest, LSN_TEST) {
|
|||
collection.collection_id_ = collection_id;
|
||||
auto status = impl_->CreateCollection(collection);
|
||||
|
||||
status = impl_->UpdateTableFlushLSN(collection_id, lsn);
|
||||
status = impl_->UpdateCollectionFlushLSN(collection_id, lsn);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
uint64_t temp_lsb = 0;
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
#include <src/db/OngoingFileChecker.h>
|
||||
|
||||
const char* FAILED_CONNECT_SQL_SERVER = "Failed to connect to meta server(mysql)";
|
||||
const char* TABLE_ALREADY_EXISTS = "Collection already exists and it is in delete state, please wait a second";
|
||||
const char* COLLECTION_ALREADY_EXISTS = "Collection already exists and it is in delete state, please wait a second";
|
||||
|
||||
TEST_F(MySqlMetaTest, TABLE_TEST) {
|
||||
TEST_F(MySqlMetaTest, COLLECTION_TEST) {
|
||||
auto collection_id = "meta_test_table";
|
||||
fiu_init(0);
|
||||
|
||||
|
@ -70,11 +70,11 @@ TEST_F(MySqlMetaTest, TABLE_TEST) {
|
|||
|
||||
//ensure collection exists
|
||||
stat = impl_->CreateCollection(collection);
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.CreateCollectionTable.schema_TO_DELETE");
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.CreateCollection.schema_TO_DELETE");
|
||||
stat = impl_->CreateCollection(collection);
|
||||
ASSERT_FALSE(stat.ok());
|
||||
ASSERT_EQ(stat.message(), TABLE_ALREADY_EXISTS);
|
||||
fiu_disable("MySQLMetaImpl.CreateCollectionTable.schema_TO_DELETE");
|
||||
ASSERT_EQ(stat.message(), COLLECTION_ALREADY_EXISTS);
|
||||
fiu_disable("MySQLMetaImpl.CreateCollection.schema_TO_DELETE");
|
||||
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.DescribeCollection.null_connection");
|
||||
stat = impl_->DescribeCollection(collection);
|
||||
|
@ -122,7 +122,7 @@ TEST_F(MySqlMetaTest, TABLE_TEST) {
|
|||
ASSERT_TRUE(status.ok());
|
||||
}
|
||||
|
||||
TEST_F(MySqlMetaTest, TABLE_FILE_TEST) {
|
||||
TEST_F(MySqlMetaTest, COLLECTION_FILE_TEST) {
|
||||
auto collection_id = "meta_test_table";
|
||||
fiu_init(0);
|
||||
|
||||
|
@ -232,21 +232,21 @@ TEST_F(MySqlMetaTest, TABLE_FILE_TEST) {
|
|||
|
||||
std::vector<size_t> ids = {table_file.id_};
|
||||
milvus::engine::meta::SegmentsSchema files;
|
||||
status = impl_->GetTableFiles(table_file.collection_id_, ids, files);
|
||||
status = impl_->GetCollectionFiles(table_file.collection_id_, ids, files);
|
||||
ASSERT_EQ(files.size(), 0UL);
|
||||
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.GetTableFiles.null_connection");
|
||||
status = impl_->GetTableFiles(table_file.collection_id_, ids, files);
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.GetCollectionFiles.null_connection");
|
||||
status = impl_->GetCollectionFiles(table_file.collection_id_, ids, files);
|
||||
ASSERT_FALSE(status.ok());
|
||||
fiu_disable("MySQLMetaImpl.GetTableFiles.null_connection");
|
||||
fiu_disable("MySQLMetaImpl.GetCollectionFiles.null_connection");
|
||||
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.GetTableFiles.throw_exception");
|
||||
status = impl_->GetTableFiles(table_file.collection_id_, ids, files);
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.GetCollectionFiles.throw_exception");
|
||||
status = impl_->GetCollectionFiles(table_file.collection_id_, ids, files);
|
||||
ASSERT_FALSE(status.ok());
|
||||
fiu_disable("MySQLMetaImpl.GetTableFiles.throw_exception");
|
||||
fiu_disable("MySQLMetaImpl.GetCollectionFiles.throw_exception");
|
||||
|
||||
ids.clear();
|
||||
status = impl_->GetTableFiles(table_file.collection_id_, ids, files);
|
||||
status = impl_->GetCollectionFiles(table_file.collection_id_, ids, files);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
table_file.collection_id_ = collection.collection_id_;
|
||||
|
@ -278,7 +278,7 @@ TEST_F(MySqlMetaTest, TABLE_FILE_TEST) {
|
|||
ASSERT_TRUE(status.ok());
|
||||
}
|
||||
|
||||
TEST_F(MySqlMetaTest, TABLE_FILE_ROW_COUNT_TEST) {
|
||||
TEST_F(MySqlMetaTest, COLLECTION_FILE_ROW_COUNT_TEST) {
|
||||
auto collection_id = "row_count_test_table";
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection;
|
||||
|
@ -307,7 +307,7 @@ TEST_F(MySqlMetaTest, TABLE_FILE_ROW_COUNT_TEST) {
|
|||
|
||||
std::vector<size_t> ids = {table_file.id_};
|
||||
milvus::engine::meta::SegmentsSchema schemas;
|
||||
status = impl_->GetTableFiles(collection_id, ids, schemas);
|
||||
status = impl_->GetCollectionFiles(collection_id, ids, schemas);
|
||||
ASSERT_EQ(schemas.size(), 1UL);
|
||||
ASSERT_EQ(table_file.row_count_, schemas[0].row_count_);
|
||||
ASSERT_EQ(table_file.file_id_, schemas[0].file_id_);
|
||||
|
@ -372,7 +372,7 @@ TEST_F(MySqlMetaTest, ARCHIVE_TEST_DAYS) {
|
|||
int i = 0;
|
||||
|
||||
milvus::engine::meta::SegmentsSchema files_get;
|
||||
status = impl.GetTableFiles(table_file.collection_id_, ids, files_get);
|
||||
status = impl.GetCollectionFiles(table_file.collection_id_, ids, files_get);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
for (auto& file : files_get) {
|
||||
|
@ -464,7 +464,7 @@ TEST_F(MySqlMetaTest, ARCHIVE_TEST_DISK) {
|
|||
int i = 0;
|
||||
|
||||
milvus::engine::meta::SegmentsSchema files_get;
|
||||
status = impl.GetTableFiles(table_file.collection_id_, ids, files_get);
|
||||
status = impl.GetCollectionFiles(table_file.collection_id_, ids, files_get);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
for (auto& file : files_get) {
|
||||
|
@ -505,14 +505,14 @@ TEST_F(MySqlMetaTest, INVALID_INITILIZE_TEST) {
|
|||
fiu_disable("MySQLMetaImpl.Initialize.is_thread_aware");
|
||||
}
|
||||
{
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.Initialize.fail_create_table_scheme");
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.Initialize.fail_create_collection_scheme");
|
||||
ASSERT_ANY_THROW(milvus::engine::meta::MySQLMetaImpl impl(GetOptions().meta_, GetOptions().mode_));
|
||||
fiu_disable("MySQLMetaImpl.Initialize.fail_create_table_scheme");
|
||||
fiu_disable("MySQLMetaImpl.Initialize.fail_create_collection_scheme");
|
||||
}
|
||||
{
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.Initialize.fail_create_table_files");
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.Initialize.fail_create_collection_files");
|
||||
ASSERT_ANY_THROW(milvus::engine::meta::MySQLMetaImpl impl(GetOptions().meta_, GetOptions().mode_));
|
||||
fiu_disable("MySQLMetaImpl.Initialize.fail_create_table_files");
|
||||
fiu_disable("MySQLMetaImpl.Initialize.fail_create_collection_files");
|
||||
}
|
||||
{
|
||||
FIU_ENABLE_FIU("MySQLConnectionPool.create.throw_exception");
|
||||
|
@ -526,7 +526,7 @@ TEST_F(MySqlMetaTest, INVALID_INITILIZE_TEST) {
|
|||
}
|
||||
}
|
||||
|
||||
TEST_F(MySqlMetaTest, TABLE_FILES_TEST) {
|
||||
TEST_F(MySqlMetaTest, COLLECTION_FILES_TEST) {
|
||||
auto collection_id = "meta_test_group";
|
||||
fiu_init(0);
|
||||
|
||||
|
@ -687,17 +687,17 @@ TEST_F(MySqlMetaTest, TABLE_FILES_TEST) {
|
|||
to_index_files_cnt + index_files_cnt;
|
||||
ASSERT_EQ(table_files.size(), total_cnt);
|
||||
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.DeleteTableFiles.null_connection");
|
||||
status = impl_->DeleteTableFiles(collection_id);
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.DeleteCollectionFiles.null_connection");
|
||||
status = impl_->DeleteCollectionFiles(collection_id);
|
||||
ASSERT_FALSE(status.ok());
|
||||
fiu_disable("MySQLMetaImpl.DeleteTableFiles.null_connection");
|
||||
fiu_disable("MySQLMetaImpl.DeleteCollectionFiles.null_connection");
|
||||
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.DeleteTableFiles.throw_exception");
|
||||
status = impl_->DeleteTableFiles(collection_id);
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.DeleteCollectionFiles.throw_exception");
|
||||
status = impl_->DeleteCollectionFiles(collection_id);
|
||||
ASSERT_FALSE(status.ok());
|
||||
fiu_disable("MySQLMetaImpl.DeleteTableFiles.throw_exception");
|
||||
fiu_disable("MySQLMetaImpl.DeleteCollectionFiles.throw_exception");
|
||||
|
||||
status = impl_->DeleteTableFiles(collection_id);
|
||||
status = impl_->DeleteCollectionFiles(collection_id);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
status = impl_->DropCollection(collection_id);
|
||||
|
@ -716,25 +716,25 @@ TEST_F(MySqlMetaTest, TABLE_FILES_TEST) {
|
|||
ASSERT_FALSE(status.ok());
|
||||
fiu_disable("MySQLMetaImpl.CleanUpFilesWithTTL.RomoveToDeleteFiles_ThrowException");
|
||||
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveToDeleteTables_NUllConnection");
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveToDeleteCollections_NUllConnection");
|
||||
status = impl_->CleanUpFilesWithTTL(0UL);
|
||||
ASSERT_FALSE(status.ok());
|
||||
fiu_disable("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveToDeleteTables_NUllConnection");
|
||||
fiu_disable("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveToDeleteCollections_NUllConnection");
|
||||
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveToDeleteTables_ThrowException");
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveToDeleteCollections_ThrowException");
|
||||
status = impl_->CleanUpFilesWithTTL(0UL);
|
||||
ASSERT_FALSE(status.ok());
|
||||
fiu_disable("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveToDeleteTables_ThrowException");
|
||||
fiu_disable("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveToDeleteCollections_ThrowException");
|
||||
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveDeletedTableFolder_NUllConnection");
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveDeletedCollectionFolder_NUllConnection");
|
||||
status = impl_->CleanUpFilesWithTTL(0UL);
|
||||
ASSERT_FALSE(status.ok());
|
||||
fiu_disable("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveDeletedTableFolder_NUllConnection");
|
||||
fiu_disable("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveDeletedCollectionFolder_NUllConnection");
|
||||
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveDeletedTableFolder_ThrowException");
|
||||
FIU_ENABLE_FIU("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveDeletedCollectionFolder_ThrowException");
|
||||
status = impl_->CleanUpFilesWithTTL(0UL);
|
||||
ASSERT_FALSE(status.ok());
|
||||
fiu_disable("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveDeletedTableFolder_ThrowException");
|
||||
fiu_disable("MySQLMetaImpl.CleanUpFilesWithTTL.RemoveDeletedCollectionFolder_ThrowException");
|
||||
}
|
||||
|
||||
TEST_F(MySqlMetaTest, INDEX_TEST) {
|
||||
|
|
|
@ -90,21 +90,21 @@ TEST(DBMiscTest, UTILS_TEST) {
|
|||
options.slave_paths_.push_back("/tmp/milvus_test/slave_1");
|
||||
options.slave_paths_.push_back("/tmp/milvus_test/slave_2");
|
||||
|
||||
const std::string TABLE_NAME = "test_tbl";
|
||||
const std::string COLLECTION_NAME = "test_tbl";
|
||||
|
||||
fiu_init(0);
|
||||
milvus::Status status;
|
||||
FIU_ENABLE_FIU("CommonUtil.CreateDirectory.create_parent_fail");
|
||||
status = milvus::engine::utils::CreateCollectionPath(options, TABLE_NAME);
|
||||
status = milvus::engine::utils::CreateCollectionPath(options, COLLECTION_NAME);
|
||||
ASSERT_FALSE(status.ok());
|
||||
fiu_disable("CommonUtil.CreateDirectory.create_parent_fail");
|
||||
|
||||
FIU_ENABLE_FIU("CreateCollectionPath.creat_slave_path");
|
||||
status = milvus::engine::utils::CreateCollectionPath(options, TABLE_NAME);
|
||||
status = milvus::engine::utils::CreateCollectionPath(options, COLLECTION_NAME);
|
||||
ASSERT_FALSE(status.ok());
|
||||
fiu_disable("CreateCollectionPath.creat_slave_path");
|
||||
|
||||
status = milvus::engine::utils::CreateCollectionPath(options, TABLE_NAME);
|
||||
status = milvus::engine::utils::CreateCollectionPath(options, COLLECTION_NAME);
|
||||
ASSERT_TRUE(status.ok());
|
||||
ASSERT_TRUE(boost::filesystem::exists(options.path_));
|
||||
for (auto& path : options.slave_paths_) {
|
||||
|
@ -112,26 +112,26 @@ TEST(DBMiscTest, UTILS_TEST) {
|
|||
}
|
||||
|
||||
// options.slave_paths.push_back("/");
|
||||
// status = engine::utils::CreateCollectionPath(options, TABLE_NAME);
|
||||
// status = engine::utils::CreateCollectionPath(options, COLLECTION_NAME);
|
||||
// ASSERT_FALSE(status.ok());
|
||||
//
|
||||
// options.path = "/";
|
||||
// status = engine::utils::CreateCollectionPath(options, TABLE_NAME);
|
||||
// status = engine::utils::CreateCollectionPath(options, COLLECTION_NAME);
|
||||
// ASSERT_FALSE(status.ok());
|
||||
|
||||
milvus::engine::meta::SegmentSchema file;
|
||||
file.id_ = 50;
|
||||
file.collection_id_ = TABLE_NAME;
|
||||
file.collection_id_ = COLLECTION_NAME;
|
||||
file.file_type_ = 3;
|
||||
file.date_ = 155000;
|
||||
status = milvus::engine::utils::GetTableFilePath(options, file);
|
||||
status = milvus::engine::utils::GetCollectionFilePath(options, file);
|
||||
ASSERT_TRUE(status.ok());
|
||||
ASSERT_FALSE(file.location_.empty());
|
||||
|
||||
status = milvus::engine::utils::DeleteTablePath(options, TABLE_NAME);
|
||||
status = milvus::engine::utils::DeleteCollectionPath(options, COLLECTION_NAME);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
status = milvus::engine::utils::DeleteTableFilePath(options, file);
|
||||
status = milvus::engine::utils::DeleteCollectionFilePath(options, file);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
status = milvus::engine::utils::CreateCollectionFilePath(options, file);
|
||||
|
@ -142,20 +142,20 @@ TEST(DBMiscTest, UTILS_TEST) {
|
|||
ASSERT_FALSE(status.ok());
|
||||
fiu_disable("CreateCollectionFilePath.fail_create");
|
||||
|
||||
status = milvus::engine::utils::GetTableFilePath(options, file);
|
||||
status = milvus::engine::utils::GetCollectionFilePath(options, file);
|
||||
ASSERT_FALSE(file.location_.empty());
|
||||
|
||||
FIU_ENABLE_FIU("CommonUtil.CreateDirectory.create_parent_fail");
|
||||
status = milvus::engine::utils::GetTableFilePath(options, file);
|
||||
status = milvus::engine::utils::GetCollectionFilePath(options, file);
|
||||
ASSERT_FALSE(file.location_.empty());
|
||||
fiu_disable("CommonUtil.CreateDirectory.create_parent_fail");
|
||||
|
||||
FIU_ENABLE_FIU("GetTableFilePath.enable_s3");
|
||||
status = milvus::engine::utils::GetTableFilePath(options, file);
|
||||
FIU_ENABLE_FIU("GetCollectionFilePath.enable_s3");
|
||||
status = milvus::engine::utils::GetCollectionFilePath(options, file);
|
||||
ASSERT_FALSE(file.location_.empty());
|
||||
fiu_disable("GetTableFilePath.enable_s3");
|
||||
fiu_disable("GetCollectionFilePath.enable_s3");
|
||||
|
||||
status = milvus::engine::utils::DeleteTableFilePath(options, file);
|
||||
status = milvus::engine::utils::DeleteCollectionFilePath(options, file);
|
||||
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
|
||||
namespace {
|
||||
|
||||
static constexpr int64_t TABLE_DIM = 256;
|
||||
static constexpr int64_t COLLECTION_DIM = 256;
|
||||
|
||||
std::string
|
||||
GetTableName() {
|
||||
GetCollectionName() {
|
||||
auto now = std::chrono::system_clock::now();
|
||||
auto micros = std::chrono::duration_cast<std::chrono::microseconds>(now.time_since_epoch()).count();
|
||||
static std::string collection_name = std::to_string(micros);
|
||||
|
@ -42,10 +42,10 @@ GetTableName() {
|
|||
}
|
||||
|
||||
milvus::engine::meta::CollectionSchema
|
||||
BuildTableSchema() {
|
||||
BuildCollectionSchema() {
|
||||
milvus::engine::meta::CollectionSchema collection_info;
|
||||
collection_info.dimension_ = TABLE_DIM;
|
||||
collection_info.collection_id_ = GetTableName();
|
||||
collection_info.dimension_ = COLLECTION_DIM;
|
||||
collection_info.collection_id_ = GetCollectionName();
|
||||
collection_info.metric_type_ = (int32_t)milvus::engine::MetricType::L2;
|
||||
collection_info.engine_type_ = (int)milvus::engine::EngineType::FAISS_IVFFLAT;
|
||||
return collection_info;
|
||||
|
@ -55,23 +55,23 @@ void
|
|||
BuildVectors(uint64_t n, milvus::engine::VectorsData& vectors) {
|
||||
vectors.vector_count_ = n;
|
||||
vectors.float_data_.clear();
|
||||
vectors.float_data_.resize(n * TABLE_DIM);
|
||||
vectors.float_data_.resize(n * COLLECTION_DIM);
|
||||
float* data = vectors.float_data_.data();
|
||||
for (int i = 0; i < n; i++) {
|
||||
for (int j = 0; j < TABLE_DIM; j++) data[TABLE_DIM * i + j] = drand48();
|
||||
for (int j = 0; j < COLLECTION_DIM; j++) data[COLLECTION_DIM * i + j] = drand48();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
TEST_F(SearchByIdTest, basic) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 100000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -116,14 +116,14 @@ TEST_F(SearchByIdTest, basic) {
|
|||
}
|
||||
|
||||
TEST_F(SearchByIdTest, with_index) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 10000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -174,14 +174,14 @@ TEST_F(SearchByIdTest, with_index) {
|
|||
}
|
||||
|
||||
TEST_F(SearchByIdTest, with_delete) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 100000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -235,14 +235,14 @@ TEST_F(SearchByIdTest, with_delete) {
|
|||
}
|
||||
|
||||
TEST_F(GetVectorByIdTest, basic) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 100000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -292,14 +292,14 @@ TEST_F(GetVectorByIdTest, basic) {
|
|||
}
|
||||
|
||||
TEST_F(GetVectorByIdTest, with_index) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 10000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -354,14 +354,14 @@ TEST_F(GetVectorByIdTest, with_index) {
|
|||
}
|
||||
|
||||
TEST_F(GetVectorByIdTest, with_delete) {
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildTableSchema();
|
||||
milvus::engine::meta::CollectionSchema collection_info = BuildCollectionSchema();
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
||||
milvus::engine::meta::CollectionSchema collection_info_get;
|
||||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int64_t nb = 100000;
|
||||
milvus::engine::VectorsData xb;
|
||||
|
@ -414,8 +414,8 @@ TEST_F(GetVectorByIdTest, with_delete) {
|
|||
|
||||
TEST_F(SearchByIdTest, BINARY) {
|
||||
milvus::engine::meta::CollectionSchema collection_info;
|
||||
collection_info.dimension_ = TABLE_DIM;
|
||||
collection_info.collection_id_ = GetTableName();
|
||||
collection_info.dimension_ = COLLECTION_DIM;
|
||||
collection_info.collection_id_ = GetCollectionName();
|
||||
collection_info.engine_type_ = (int)milvus::engine::EngineType::FAISS_BIN_IDMAP;
|
||||
collection_info.metric_type_ = (int32_t)milvus::engine::MetricType::JACCARD;
|
||||
auto stat = db_->CreateCollection(collection_info);
|
||||
|
@ -425,7 +425,7 @@ TEST_F(SearchByIdTest, BINARY) {
|
|||
collection_info_get.collection_id_ = collection_info.collection_id_;
|
||||
stat = db_->DescribeCollection(collection_info_get);
|
||||
ASSERT_TRUE(stat.ok());
|
||||
ASSERT_EQ(collection_info_get.dimension_, TABLE_DIM);
|
||||
ASSERT_EQ(collection_info_get.dimension_, COLLECTION_DIM);
|
||||
|
||||
int insert_loop = 10;
|
||||
int64_t nb = 1000;
|
||||
|
@ -434,7 +434,7 @@ TEST_F(SearchByIdTest, BINARY) {
|
|||
milvus::engine::VectorsData vectors;
|
||||
vectors.vector_count_ = nb;
|
||||
vectors.binary_data_.clear();
|
||||
vectors.binary_data_.resize(nb * TABLE_DIM);
|
||||
vectors.binary_data_.resize(nb * COLLECTION_DIM);
|
||||
uint8_t* data = vectors.binary_data_.data();
|
||||
vectors.id_array_.clear();
|
||||
|
||||
|
@ -442,8 +442,8 @@ TEST_F(SearchByIdTest, BINARY) {
|
|||
std::mt19937 gen(rd());
|
||||
std::uniform_int_distribution<> distribution{0, std::numeric_limits<uint8_t>::max()};
|
||||
for (int i = 0; i < nb; i++) {
|
||||
for (int j = 0; j < TABLE_DIM; j++) {
|
||||
data[TABLE_DIM * i + j] = distribution(gen);
|
||||
for (int j = 0; j < COLLECTION_DIM; j++) {
|
||||
data[COLLECTION_DIM * i + j] = distribution(gen);
|
||||
}
|
||||
vectors.id_array_.emplace_back(k * nb + i);
|
||||
}
|
||||
|
|
|
@ -639,7 +639,7 @@ TEST(WalTest, MANAGER_TEST) {
|
|||
ASSERT_TRUE(record.collection_id.empty());
|
||||
}
|
||||
|
||||
TEST(WalTest, MANAGER_SAME_NAME_TABLE) {
|
||||
TEST(WalTest, MANAGER_SAME_NAME_COLLECTION) {
|
||||
MakeEmptyTestPath();
|
||||
|
||||
milvus::engine::DBMetaOptions opt = {WAL_GTEST_PATH};
|
||||
|
|
|
@ -26,17 +26,17 @@
|
|||
#include "metrics/Metrics.h"
|
||||
|
||||
namespace {
|
||||
static constexpr int64_t TABLE_DIM = 256;
|
||||
static constexpr int64_t COLLECTION_DIM = 256;
|
||||
|
||||
void
|
||||
BuildVectors(uint64_t n, milvus::engine::VectorsData& vectors) {
|
||||
vectors.vector_count_ = n;
|
||||
vectors.float_data_.clear();
|
||||
vectors.float_data_.resize(n * TABLE_DIM);
|
||||
vectors.float_data_.resize(n * COLLECTION_DIM);
|
||||
float* data = vectors.float_data_.data();
|
||||
for (uint64_t i = 0; i < n; i++) {
|
||||
for (int64_t j = 0; j < TABLE_DIM; j++) data[TABLE_DIM * i + j] = drand48();
|
||||
data[TABLE_DIM * i] += i / 2000.;
|
||||
for (int64_t j = 0; j < COLLECTION_DIM; j++) data[COLLECTION_DIM * i + j] = drand48();
|
||||
data[COLLECTION_DIM * i] += i / 2000.;
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
|
|
@ -36,8 +36,8 @@
|
|||
|
||||
namespace {
|
||||
|
||||
static const char* TABLE_NAME = "test_grpc";
|
||||
static constexpr int64_t TABLE_DIM = 256;
|
||||
static const char* COLLECTION_NAME = "test_grpc";
|
||||
static constexpr int64_t COLLECTION_DIM = 256;
|
||||
static constexpr int64_t INDEX_FILE_SIZE = 1024;
|
||||
static constexpr int64_t VECTOR_COUNT = 1000;
|
||||
static constexpr int64_t INSERT_LOOP = 10;
|
||||
|
@ -114,15 +114,15 @@ class RpcHandlerTest : public testing::Test {
|
|||
dummy_context->SetTraceContext(trace_context);
|
||||
::grpc::ServerContext context;
|
||||
handler->SetContext(&context, dummy_context);
|
||||
::milvus::grpc::TableSchema request;
|
||||
::milvus::grpc::CollectionSchema request;
|
||||
::milvus::grpc::Status status;
|
||||
request.set_table_name(TABLE_NAME);
|
||||
request.set_dimension(TABLE_DIM);
|
||||
request.set_collection_name(COLLECTION_NAME);
|
||||
request.set_dimension(COLLECTION_DIM);
|
||||
request.set_index_file_size(INDEX_FILE_SIZE);
|
||||
request.set_metric_type(1);
|
||||
handler->SetContext(&context, dummy_context);
|
||||
handler->random_id();
|
||||
::grpc::Status grpc_status = handler->CreateTable(&context, &request, &status);
|
||||
::grpc::Status grpc_status = handler->CreateCollection(&context, &request, &status);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -148,8 +148,8 @@ BuildVectors(int64_t from, int64_t to, std::vector<std::vector<float>>& vector_r
|
|||
vector_record_array.clear();
|
||||
for (int64_t k = from; k < to; k++) {
|
||||
std::vector<float> record;
|
||||
record.resize(TABLE_DIM);
|
||||
for (int64_t i = 0; i < TABLE_DIM; i++) {
|
||||
record.resize(COLLECTION_DIM);
|
||||
for (int64_t i = 0; i < COLLECTION_DIM; i++) {
|
||||
record[i] = (float)(i + k);
|
||||
}
|
||||
|
||||
|
@ -166,8 +166,8 @@ BuildBinVectors(int64_t from, int64_t to, std::vector<std::vector<uint8_t>>& vec
|
|||
vector_record_array.clear();
|
||||
for (int64_t k = from; k < to; k++) {
|
||||
std::vector<uint8_t> record;
|
||||
record.resize(TABLE_DIM / 8);
|
||||
for (int64_t i = 0; i < TABLE_DIM / 8; i++) {
|
||||
record.resize(COLLECTION_DIM / 8);
|
||||
for (int64_t i = 0; i < COLLECTION_DIM / 8; i++) {
|
||||
record[i] = (i + k) % 256;
|
||||
}
|
||||
|
||||
|
@ -196,11 +196,11 @@ TEST_F(RpcHandlerTest, HAS_COLLECTION_TEST) {
|
|||
::grpc::ServerContext context;
|
||||
handler->SetContext(&context, dummy_context);
|
||||
handler->RegisterRequestHandler(milvus::server::RequestHandler());
|
||||
::milvus::grpc::TableName request;
|
||||
::milvus::grpc::CollectionName request;
|
||||
::milvus::grpc::BoolReply reply;
|
||||
::grpc::Status status = handler->HasTable(&context, &request, &reply);
|
||||
request.set_table_name(TABLE_NAME);
|
||||
status = handler->HasTable(&context, &request, &reply);
|
||||
::grpc::Status status = handler->HasCollection(&context, &request, &reply);
|
||||
request.set_collection_name(COLLECTION_NAME);
|
||||
status = handler->HasCollection(&context, &request, &reply);
|
||||
ASSERT_TRUE(status.error_code() == ::grpc::Status::OK.error_code());
|
||||
int error_code = reply.status().error_code();
|
||||
ASSERT_EQ(error_code, ::milvus::grpc::ErrorCode::SUCCESS);
|
||||
|
@ -208,7 +208,7 @@ TEST_F(RpcHandlerTest, HAS_COLLECTION_TEST) {
|
|||
fiu_init(0);
|
||||
|
||||
fiu_enable("HasCollectionRequest.OnExecute.throw_std_exception", 1, NULL, 0);
|
||||
handler->HasTable(&context, &request, &reply);
|
||||
handler->HasCollection(&context, &request, &reply);
|
||||
ASSERT_NE(reply.status().error_code(), ::milvus::grpc::ErrorCode::SUCCESS);
|
||||
fiu_disable("HasCollectionRequest.OnExecute.throw_std_exception");
|
||||
}
|
||||
|
@ -220,10 +220,10 @@ TEST_F(RpcHandlerTest, INDEX_TEST) {
|
|||
::milvus::grpc::IndexParam request;
|
||||
::milvus::grpc::Status response;
|
||||
::grpc::Status grpc_status = handler->CreateIndex(&context, &request, &response);
|
||||
request.set_table_name("test1");
|
||||
request.set_collection_name("test1");
|
||||
handler->CreateIndex(&context, &request, &response);
|
||||
|
||||
request.set_table_name(TABLE_NAME);
|
||||
request.set_collection_name(COLLECTION_NAME);
|
||||
handler->CreateIndex(&context, &request, &response);
|
||||
|
||||
request.set_index_type(1);
|
||||
|
@ -261,12 +261,12 @@ TEST_F(RpcHandlerTest, INDEX_TEST) {
|
|||
fiu_disable("CreateIndexRequest.OnExecute.ip_meteric");
|
||||
#endif
|
||||
|
||||
::milvus::grpc::TableName collection_name;
|
||||
::milvus::grpc::CollectionName collection_name;
|
||||
::milvus::grpc::IndexParam index_param;
|
||||
handler->DescribeIndex(&context, &collection_name, &index_param);
|
||||
collection_name.set_table_name("test4");
|
||||
collection_name.set_collection_name("test4");
|
||||
handler->DescribeIndex(&context, &collection_name, &index_param);
|
||||
collection_name.set_table_name(TABLE_NAME);
|
||||
collection_name.set_collection_name(COLLECTION_NAME);
|
||||
handler->DescribeIndex(&context, &collection_name, &index_param);
|
||||
|
||||
fiu_init(0);
|
||||
|
@ -277,15 +277,15 @@ TEST_F(RpcHandlerTest, INDEX_TEST) {
|
|||
::milvus::grpc::Status status;
|
||||
collection_name.Clear();
|
||||
handler->DropIndex(&context, &collection_name, &status);
|
||||
collection_name.set_table_name("test5");
|
||||
collection_name.set_collection_name("test5");
|
||||
handler->DropIndex(&context, &collection_name, &status);
|
||||
|
||||
collection_name.set_table_name(TABLE_NAME);
|
||||
collection_name.set_collection_name(COLLECTION_NAME);
|
||||
|
||||
fiu_init(0);
|
||||
fiu_enable("DropIndexRequest.OnExecute.table_not_exist", 1, NULL, 0);
|
||||
fiu_enable("DropIndexRequest.OnExecute.collection_not_exist", 1, NULL, 0);
|
||||
handler->DropIndex(&context, &collection_name, &status);
|
||||
fiu_disable("DropIndexRequest.OnExecute.table_not_exist");
|
||||
fiu_disable("DropIndexRequest.OnExecute.collection_not_exist");
|
||||
|
||||
fiu_enable("DropIndexRequest.OnExecute.drop_index_fail", 1, NULL, 0);
|
||||
handler->DropIndex(&context, &collection_name, &status);
|
||||
|
@ -305,7 +305,7 @@ TEST_F(RpcHandlerTest, INSERT_TEST) {
|
|||
::milvus::grpc::InsertParam request;
|
||||
::milvus::grpc::Status response;
|
||||
|
||||
request.set_table_name(TABLE_NAME);
|
||||
request.set_collection_name(COLLECTION_NAME);
|
||||
std::vector<std::vector<float>> record_array;
|
||||
BuildVectors(0, VECTOR_COUNT, record_array);
|
||||
::milvus::grpc::VectorIds vector_ids;
|
||||
|
@ -326,10 +326,10 @@ TEST_F(RpcHandlerTest, INSERT_TEST) {
|
|||
ASSERT_NE(vector_ids.vector_id_array_size(), VECTOR_COUNT);
|
||||
fiu_disable("InsertRequest.OnExecute.db_not_found");
|
||||
|
||||
fiu_enable("InsertRequest.OnExecute.describe_table_fail", 1, NULL, 0);
|
||||
fiu_enable("InsertRequest.OnExecute.describe_collection_fail", 1, NULL, 0);
|
||||
handler->Insert(&context, &request, &vector_ids);
|
||||
ASSERT_NE(vector_ids.vector_id_array_size(), VECTOR_COUNT);
|
||||
fiu_disable("InsertRequest.OnExecute.describe_table_fail");
|
||||
fiu_disable("InsertRequest.OnExecute.describe_collection_fail");
|
||||
|
||||
fiu_enable("InsertRequest.OnExecute.illegal_vector_id", 1, NULL, 0);
|
||||
handler->Insert(&context, &request, &vector_ids);
|
||||
|
@ -360,7 +360,7 @@ TEST_F(RpcHandlerTest, INSERT_TEST) {
|
|||
fiu_disable("InsertRequest.OnExecute.invalid_ids_size");
|
||||
|
||||
// insert vectors with wrong dim
|
||||
std::vector<float> record_wrong_dim(TABLE_DIM - 1, 0.5f);
|
||||
std::vector<float> record_wrong_dim(COLLECTION_DIM - 1, 0.5f);
|
||||
::milvus::grpc::RowRecord* grpc_record = request.add_row_record_array();
|
||||
CopyRowRecord(grpc_record, record_wrong_dim);
|
||||
handler->Insert(&context, &request, &vector_ids);
|
||||
|
@ -380,11 +380,11 @@ TEST_F(RpcHandlerTest, SEARCH_TEST) {
|
|||
handler->Search(&context, &request, &response);
|
||||
|
||||
// test collection not exist
|
||||
request.set_table_name("test3");
|
||||
request.set_collection_name("test3");
|
||||
handler->Search(&context, &request, &response);
|
||||
|
||||
// test invalid topk
|
||||
request.set_table_name(TABLE_NAME);
|
||||
request.set_collection_name(COLLECTION_NAME);
|
||||
handler->Search(&context, &request, &response);
|
||||
|
||||
// test invalid nprobe
|
||||
|
@ -406,14 +406,14 @@ TEST_F(RpcHandlerTest, SEARCH_TEST) {
|
|||
CopyRowRecord(grpc_record, record);
|
||||
}
|
||||
// insert vectors
|
||||
insert_param.set_table_name(TABLE_NAME);
|
||||
insert_param.set_collection_name(COLLECTION_NAME);
|
||||
::milvus::grpc::VectorIds vector_ids;
|
||||
handler->Insert(&context, &insert_param, &vector_ids);
|
||||
|
||||
// flush
|
||||
::milvus::grpc::Status grpc_status;
|
||||
::milvus::grpc::FlushParam flush_param;
|
||||
flush_param.add_table_name_array(TABLE_NAME);
|
||||
flush_param.add_collection_name_array(COLLECTION_NAME);
|
||||
handler->Flush(&context, &flush_param, &grpc_status);
|
||||
|
||||
// search
|
||||
|
@ -438,15 +438,15 @@ TEST_F(RpcHandlerTest, COMBINE_SEARCH_TEST) {
|
|||
handler->SetContext(&context, dummy_context);
|
||||
handler->RegisterRequestHandler(milvus::server::RequestHandler());
|
||||
|
||||
// create table
|
||||
std::string table_name = "combine";
|
||||
::milvus::grpc::TableSchema tableschema;
|
||||
tableschema.set_table_name(table_name);
|
||||
tableschema.set_dimension(TABLE_DIM);
|
||||
tableschema.set_index_file_size(INDEX_FILE_SIZE);
|
||||
tableschema.set_metric_type(1); // L2 metric
|
||||
// create collection
|
||||
std::string collection_name = "combine";
|
||||
::milvus::grpc::CollectionSchema collection_schema;
|
||||
collection_schema.set_collection_name(collection_name);
|
||||
collection_schema.set_dimension(COLLECTION_DIM);
|
||||
collection_schema.set_index_file_size(INDEX_FILE_SIZE);
|
||||
collection_schema.set_metric_type(1); // L2 metric
|
||||
::milvus::grpc::Status status;
|
||||
handler->CreateTable(&context, &tableschema, &status);
|
||||
handler->CreateCollection(&context, &collection_schema, &status);
|
||||
ASSERT_EQ(status.error_code(), 0);
|
||||
|
||||
// insert vectors
|
||||
|
@ -460,14 +460,14 @@ TEST_F(RpcHandlerTest, COMBINE_SEARCH_TEST) {
|
|||
insert_param.add_row_id_array(++vec_id);
|
||||
}
|
||||
|
||||
insert_param.set_table_name(table_name);
|
||||
insert_param.set_collection_name(collection_name);
|
||||
::milvus::grpc::VectorIds vector_ids;
|
||||
handler->Insert(&context, &insert_param, &vector_ids);
|
||||
|
||||
// flush
|
||||
::milvus::grpc::Status grpc_status;
|
||||
::milvus::grpc::FlushParam flush_param;
|
||||
flush_param.add_table_name_array(table_name);
|
||||
flush_param.add_collection_name_array(collection_name);
|
||||
handler->Flush(&context, &flush_param, &grpc_status);
|
||||
|
||||
// multi thread search requests will be combined
|
||||
|
@ -478,7 +478,7 @@ TEST_F(RpcHandlerTest, COMBINE_SEARCH_TEST) {
|
|||
std::vector<RequestPtr> request_array;
|
||||
for (int i = 0; i < QUERY_COUNT; i++) {
|
||||
RequestPtr request = std::make_shared<::milvus::grpc::SearchParam>();
|
||||
request->set_table_name(table_name);
|
||||
request->set_collection_name(collection_name);
|
||||
request->set_topk(TOPK);
|
||||
milvus::grpc::KeyValuePair* kv = request->add_extra_params();
|
||||
kv->set_key(milvus::server::grpc::EXTRA_PARAM_KEY);
|
||||
|
@ -540,15 +540,15 @@ TEST_F(RpcHandlerTest, COMBINE_SEARCH_BINARY_TEST) {
|
|||
handler->SetContext(&context, dummy_context);
|
||||
handler->RegisterRequestHandler(milvus::server::RequestHandler());
|
||||
|
||||
// create table
|
||||
std::string table_name = "combine_bin";
|
||||
::milvus::grpc::TableSchema tableschema;
|
||||
tableschema.set_table_name(table_name);
|
||||
tableschema.set_dimension(TABLE_DIM);
|
||||
tableschema.set_index_file_size(INDEX_FILE_SIZE);
|
||||
tableschema.set_metric_type(5); // tanimoto metric
|
||||
// create collection
|
||||
std::string collection_name = "combine_bin";
|
||||
::milvus::grpc::CollectionSchema collection_schema;
|
||||
collection_schema.set_collection_name(collection_name);
|
||||
collection_schema.set_dimension(COLLECTION_DIM);
|
||||
collection_schema.set_index_file_size(INDEX_FILE_SIZE);
|
||||
collection_schema.set_metric_type(5); // tanimoto metric
|
||||
::milvus::grpc::Status status;
|
||||
handler->CreateTable(&context, &tableschema, &status);
|
||||
handler->CreateCollection(&context, &collection_schema, &status);
|
||||
ASSERT_EQ(status.error_code(), 0);
|
||||
|
||||
// insert vectors
|
||||
|
@ -562,14 +562,14 @@ TEST_F(RpcHandlerTest, COMBINE_SEARCH_BINARY_TEST) {
|
|||
insert_param.add_row_id_array(++vec_id);
|
||||
}
|
||||
|
||||
insert_param.set_table_name(table_name);
|
||||
insert_param.set_collection_name(collection_name);
|
||||
::milvus::grpc::VectorIds vector_ids;
|
||||
handler->Insert(&context, &insert_param, &vector_ids);
|
||||
|
||||
// flush
|
||||
::milvus::grpc::Status grpc_status;
|
||||
::milvus::grpc::FlushParam flush_param;
|
||||
flush_param.add_table_name_array(table_name);
|
||||
flush_param.add_collection_name_array(collection_name);
|
||||
handler->Flush(&context, &flush_param, &grpc_status);
|
||||
|
||||
// multi thread search requests will be combined
|
||||
|
@ -580,7 +580,7 @@ TEST_F(RpcHandlerTest, COMBINE_SEARCH_BINARY_TEST) {
|
|||
std::vector<RequestPtr> request_array;
|
||||
for (int i = 0; i < QUERY_COUNT; i++) {
|
||||
RequestPtr request = std::make_shared<::milvus::grpc::SearchParam>();
|
||||
request->set_table_name(table_name);
|
||||
request->set_collection_name(collection_name);
|
||||
request->set_topk(TOPK);
|
||||
milvus::grpc::KeyValuePair* kv = request->add_extra_params();
|
||||
kv->set_key(milvus::server::grpc::EXTRA_PARAM_KEY);
|
||||
|
@ -640,46 +640,50 @@ TEST_F(RpcHandlerTest, TABLES_TEST) {
|
|||
::grpc::ServerContext context;
|
||||
handler->SetContext(&context, dummy_context);
|
||||
handler->RegisterRequestHandler(milvus::server::RequestHandler());
|
||||
::milvus::grpc::TableSchema tableschema;
|
||||
::milvus::grpc::Status response;
|
||||
std::string tablename = "tbl";
|
||||
|
||||
// create collection test
|
||||
// test null input
|
||||
handler->CreateTable(&context, nullptr, &response);
|
||||
// test invalid collection name
|
||||
handler->CreateTable(&context, &tableschema, &response);
|
||||
// test invalid collection dimension
|
||||
tableschema.set_table_name(tablename);
|
||||
handler->CreateTable(&context, &tableschema, &response);
|
||||
// test invalid index file size
|
||||
tableschema.set_dimension(TABLE_DIM);
|
||||
// handler->CreateTable(&context, &tableschema, &response);
|
||||
// test invalid index metric type
|
||||
tableschema.set_index_file_size(INDEX_FILE_SIZE);
|
||||
handler->CreateTable(&context, &tableschema, &response);
|
||||
// test collection already exist
|
||||
tableschema.set_metric_type(1);
|
||||
handler->CreateTable(&context, &tableschema, &response);
|
||||
::milvus::grpc::Status response;
|
||||
std::string collection_name = "tbl";
|
||||
{
|
||||
::milvus::grpc::CollectionSchema collection_schema;
|
||||
// create collection test
|
||||
// test null input
|
||||
handler->CreateCollection(&context, nullptr, &response);
|
||||
// test invalid collection name
|
||||
handler->CreateCollection(&context, &collection_schema, &response);
|
||||
// test invalid collection dimension
|
||||
collection_schema.set_collection_name(collection_name);
|
||||
handler->CreateCollection(&context, &collection_schema, &response);
|
||||
// test invalid index file size
|
||||
collection_schema.set_dimension(COLLECTION_DIM);
|
||||
// handler->CreateCollection(&context, &collection_schema, &response);
|
||||
// test invalid index metric type
|
||||
collection_schema.set_index_file_size(INDEX_FILE_SIZE);
|
||||
handler->CreateCollection(&context, &collection_schema, &response);
|
||||
// test collection already exist
|
||||
collection_schema.set_metric_type(1);
|
||||
handler->CreateCollection(&context, &collection_schema, &response);
|
||||
}
|
||||
|
||||
// describe collection test
|
||||
// test invalid collection name
|
||||
::milvus::grpc::TableName collection_name;
|
||||
::milvus::grpc::TableSchema table_schema;
|
||||
handler->DescribeTable(&context, &collection_name, &table_schema);
|
||||
::milvus::grpc::CollectionName grpc_collection_name;
|
||||
{
|
||||
::milvus::grpc::CollectionSchema collection_schema;
|
||||
handler->DescribeCollection(&context, &grpc_collection_name, &collection_schema);
|
||||
|
||||
collection_name.set_table_name(TABLE_NAME);
|
||||
::grpc::Status status = handler->DescribeTable(&context, &collection_name, &table_schema);
|
||||
ASSERT_EQ(status.error_code(), ::grpc::Status::OK.error_code());
|
||||
grpc_collection_name.set_collection_name(COLLECTION_NAME);
|
||||
::grpc::Status status = handler->DescribeCollection(&context, &grpc_collection_name, &collection_schema);
|
||||
ASSERT_EQ(status.error_code(), ::grpc::Status::OK.error_code());
|
||||
|
||||
fiu_init(0);
|
||||
fiu_enable("DescribeCollectionRequest.OnExecute.describe_table_fail", 1, NULL, 0);
|
||||
handler->DescribeTable(&context, &collection_name, &table_schema);
|
||||
fiu_disable("DescribeCollectionRequest.OnExecute.describe_table_fail");
|
||||
fiu_init(0);
|
||||
fiu_enable("DescribeCollectionRequest.OnExecute.describe_collection_fail", 1, NULL, 0);
|
||||
handler->DescribeCollection(&context, &grpc_collection_name, &collection_schema);
|
||||
fiu_disable("DescribeCollectionRequest.OnExecute.describe_collection_fail");
|
||||
|
||||
fiu_enable("DescribeCollectionRequest.OnExecute.throw_std_exception", 1, NULL, 0);
|
||||
handler->DescribeTable(&context, &collection_name, &table_schema);
|
||||
fiu_disable("DescribeCollectionRequest.OnExecute.throw_std_exception");
|
||||
fiu_enable("DescribeCollectionRequest.OnExecute.throw_std_exception", 1, NULL, 0);
|
||||
handler->DescribeCollection(&context, &grpc_collection_name, &collection_schema);
|
||||
fiu_disable("DescribeCollectionRequest.OnExecute.throw_std_exception");
|
||||
}
|
||||
|
||||
::milvus::grpc::InsertParam request;
|
||||
std::vector<std::vector<float>> record_array;
|
||||
|
@ -691,7 +695,7 @@ TEST_F(RpcHandlerTest, TABLES_TEST) {
|
|||
// Insert vectors
|
||||
// test invalid collection name
|
||||
handler->Insert(&context, &request, &vector_ids);
|
||||
request.set_table_name(tablename);
|
||||
request.set_collection_name(collection_name);
|
||||
// test empty row record
|
||||
handler->Insert(&context, &request, &vector_ids);
|
||||
|
||||
|
@ -716,164 +720,178 @@ TEST_F(RpcHandlerTest, TABLES_TEST) {
|
|||
}
|
||||
handler->Insert(&context, &request, &vector_ids);
|
||||
|
||||
// show tables
|
||||
::milvus::grpc::Command cmd;
|
||||
::milvus::grpc::TableNameList table_name_list;
|
||||
status = handler->ShowTables(&context, &cmd, &table_name_list);
|
||||
ASSERT_EQ(status.error_code(), ::grpc::Status::OK.error_code());
|
||||
// show collections
|
||||
{
|
||||
::milvus::grpc::Command cmd;
|
||||
::milvus::grpc::CollectionNameList collection_name_list;
|
||||
auto status = handler->ShowCollections(&context, &cmd, &collection_name_list);
|
||||
ASSERT_EQ(status.error_code(), ::grpc::Status::OK.error_code());
|
||||
|
||||
// show collection info
|
||||
::milvus::grpc::TableInfo collection_info;
|
||||
status = handler->ShowTableInfo(&context, &collection_name, &collection_info);
|
||||
ASSERT_EQ(status.error_code(), ::grpc::Status::OK.error_code());
|
||||
// show collection info
|
||||
::milvus::grpc::CollectionInfo collection_info;
|
||||
status = handler->ShowCollectionInfo(&context, &grpc_collection_name, &collection_info);
|
||||
ASSERT_EQ(status.error_code(), ::grpc::Status::OK.error_code());
|
||||
|
||||
fiu_init(0);
|
||||
fiu_enable("ShowCollectionsRequest.OnExecute.show_tables_fail", 1, NULL, 0);
|
||||
handler->ShowTables(&context, &cmd, &table_name_list);
|
||||
fiu_disable("ShowCollectionsRequest.OnExecute.show_tables_fail");
|
||||
fiu_init(0);
|
||||
fiu_enable("ShowCollectionsRequest.OnExecute.show_collections_fail", 1, NULL, 0);
|
||||
handler->ShowCollections(&context, &cmd, &collection_name_list);
|
||||
fiu_disable("ShowCollectionsRequest.OnExecute.show_collections_fail");
|
||||
}
|
||||
|
||||
// Count Collection
|
||||
::milvus::grpc::TableRowCount count;
|
||||
collection_name.Clear();
|
||||
status = handler->CountTable(&context, &collection_name, &count);
|
||||
collection_name.set_table_name(tablename);
|
||||
status = handler->CountTable(&context, &collection_name, &count);
|
||||
ASSERT_EQ(status.error_code(), ::grpc::Status::OK.error_code());
|
||||
// ASSERT_EQ(count.table_row_count(), vector_ids.vector_id_array_size());
|
||||
fiu_init(0);
|
||||
fiu_enable("CountCollectionRequest.OnExecute.db_not_found", 1, NULL, 0);
|
||||
status = handler->CountTable(&context, &collection_name, &count);
|
||||
fiu_disable("CountCollectionRequest.OnExecute.db_not_found");
|
||||
{
|
||||
::milvus::grpc::CollectionRowCount count;
|
||||
grpc_collection_name.Clear();
|
||||
auto status = handler->CountCollection(&context, &grpc_collection_name, &count);
|
||||
grpc_collection_name.set_collection_name(collection_name);
|
||||
status = handler->CountCollection(&context, &grpc_collection_name, &count);
|
||||
ASSERT_EQ(status.error_code(), ::grpc::Status::OK.error_code());
|
||||
// ASSERT_EQ(count.collection_row_count(), vector_ids.vector_id_array_size());
|
||||
fiu_init(0);
|
||||
fiu_enable("CountCollectionRequest.OnExecute.db_not_found", 1, NULL, 0);
|
||||
status = handler->CountCollection(&context, &grpc_collection_name, &count);
|
||||
fiu_disable("CountCollectionRequest.OnExecute.db_not_found");
|
||||
|
||||
fiu_enable("CountCollectionRequest.OnExecute.status_error", 1, NULL, 0);
|
||||
status = handler->CountTable(&context, &collection_name, &count);
|
||||
fiu_disable("CountCollectionRequest.OnExecute.status_error");
|
||||
fiu_enable("CountCollectionRequest.OnExecute.status_error", 1, NULL, 0);
|
||||
status = handler->CountCollection(&context, &grpc_collection_name, &count);
|
||||
fiu_disable("CountCollectionRequest.OnExecute.status_error");
|
||||
|
||||
fiu_enable("CountCollectionRequest.OnExecute.throw_std_exception", 1, NULL, 0);
|
||||
status = handler->CountTable(&context, &collection_name, &count);
|
||||
fiu_disable("CountCollectionRequest.OnExecute.throw_std_exception");
|
||||
fiu_enable("CountCollectionRequest.OnExecute.throw_std_exception", 1, NULL, 0);
|
||||
status = handler->CountCollection(&context, &grpc_collection_name, &count);
|
||||
fiu_disable("CountCollectionRequest.OnExecute.throw_std_exception");
|
||||
}
|
||||
|
||||
// Preload Collection
|
||||
collection_name.Clear();
|
||||
status = handler->PreloadTable(&context, &collection_name, &response);
|
||||
collection_name.set_table_name(TABLE_NAME);
|
||||
status = handler->PreloadTable(&context, &collection_name, &response);
|
||||
ASSERT_EQ(status.error_code(), ::grpc::Status::OK.error_code());
|
||||
{
|
||||
::milvus::grpc::CollectionSchema collection_schema;
|
||||
|
||||
fiu_enable("PreloadCollectionRequest.OnExecute.preload_table_fail", 1, NULL, 0);
|
||||
handler->PreloadTable(&context, &collection_name, &response);
|
||||
fiu_disable("PreloadCollectionRequest.OnExecute.preload_table_fail");
|
||||
grpc_collection_name.Clear();
|
||||
auto status = handler->PreloadCollection(&context, &grpc_collection_name, &response);
|
||||
grpc_collection_name.set_collection_name(COLLECTION_NAME);
|
||||
status = handler->PreloadCollection(&context, &grpc_collection_name, &response);
|
||||
ASSERT_EQ(status.error_code(), ::grpc::Status::OK.error_code());
|
||||
|
||||
fiu_enable("PreloadCollectionRequest.OnExecute.throw_std_exception", 1, NULL, 0);
|
||||
handler->PreloadTable(&context, &collection_name, &response);
|
||||
fiu_disable("PreloadCollectionRequest.OnExecute.throw_std_exception");
|
||||
fiu_enable("PreloadCollectionRequest.OnExecute.preload_collection_fail", 1, NULL, 0);
|
||||
handler->PreloadCollection(&context, &grpc_collection_name, &response);
|
||||
fiu_disable("PreloadCollectionRequest.OnExecute.preload_collection_fail");
|
||||
|
||||
fiu_init(0);
|
||||
fiu_enable("CreateCollectionRequest.OnExecute.invalid_index_file_size", 1, NULL, 0);
|
||||
tableschema.set_table_name(tablename);
|
||||
handler->CreateTable(&context, &tableschema, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("CreateCollectionRequest.OnExecute.invalid_index_file_size");
|
||||
fiu_enable("PreloadCollectionRequest.OnExecute.throw_std_exception", 1, NULL, 0);
|
||||
handler->PreloadCollection(&context, &grpc_collection_name, &response);
|
||||
fiu_disable("PreloadCollectionRequest.OnExecute.throw_std_exception");
|
||||
|
||||
fiu_enable("CreateCollectionRequest.OnExecute.db_already_exist", 1, NULL, 0);
|
||||
tableschema.set_table_name(tablename);
|
||||
handler->CreateTable(&context, &tableschema, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("CreateCollectionRequest.OnExecute.db_already_exist");
|
||||
fiu_init(0);
|
||||
fiu_enable("CreateCollectionRequest.OnExecute.invalid_index_file_size", 1, NULL, 0);
|
||||
collection_schema.set_collection_name(collection_name);
|
||||
handler->CreateCollection(&context, &collection_schema, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("CreateCollectionRequest.OnExecute.invalid_index_file_size");
|
||||
|
||||
fiu_enable("CreateCollectionRequest.OnExecute.create_table_fail", 1, NULL, 0);
|
||||
tableschema.set_table_name(tablename);
|
||||
handler->CreateTable(&context, &tableschema, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("CreateCollectionRequest.OnExecute.create_table_fail");
|
||||
fiu_enable("CreateCollectionRequest.OnExecute.db_already_exist", 1, NULL, 0);
|
||||
collection_schema.set_collection_name(collection_name);
|
||||
handler->CreateCollection(&context, &collection_schema, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("CreateCollectionRequest.OnExecute.db_already_exist");
|
||||
|
||||
fiu_enable("CreateCollectionRequest.OnExecute.throw_std_exception", 1, NULL, 0);
|
||||
tableschema.set_table_name(tablename);
|
||||
handler->CreateTable(&context, &tableschema, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("CreateCollectionRequest.OnExecute.throw_std_exception");
|
||||
fiu_enable("CreateCollectionRequest.OnExecute.create_collection_fail", 1, NULL, 0);
|
||||
collection_schema.set_collection_name(collection_name);
|
||||
handler->CreateCollection(&context, &collection_schema, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("CreateCollectionRequest.OnExecute.create_collection_fail");
|
||||
|
||||
fiu_enable("CreateCollectionRequest.OnExecute.throw_std_exception", 1, NULL, 0);
|
||||
collection_schema.set_collection_name(collection_name);
|
||||
handler->CreateCollection(&context, &collection_schema, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("CreateCollectionRequest.OnExecute.throw_std_exception");
|
||||
}
|
||||
|
||||
// Drop collection
|
||||
collection_name.set_table_name("");
|
||||
// test invalid collection name
|
||||
::grpc::Status grpc_status = handler->DropTable(&context, &collection_name, &response);
|
||||
collection_name.set_table_name(tablename);
|
||||
{
|
||||
::milvus::grpc::CollectionSchema collection_schema;
|
||||
collection_schema.set_dimension(128);
|
||||
collection_schema.set_index_file_size(1024);
|
||||
collection_schema.set_metric_type(1);
|
||||
grpc_collection_name.set_collection_name("");
|
||||
// test invalid collection name
|
||||
::grpc::Status grpc_status = handler->DropCollection(&context, &grpc_collection_name, &response);
|
||||
grpc_collection_name.set_collection_name(collection_name);
|
||||
|
||||
fiu_enable("DropCollectionRequest.OnExecute.db_not_found", 1, NULL, 0);
|
||||
handler->DropTable(&context, &collection_name, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("DropCollectionRequest.OnExecute.db_not_found");
|
||||
fiu_enable("DropCollectionRequest.OnExecute.db_not_found", 1, NULL, 0);
|
||||
handler->DropCollection(&context, &grpc_collection_name, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("DropCollectionRequest.OnExecute.db_not_found");
|
||||
|
||||
fiu_enable("DropCollectionRequest.OnExecute.describe_table_fail", 1, NULL, 0);
|
||||
handler->DropTable(&context, &collection_name, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("DropCollectionRequest.OnExecute.describe_table_fail");
|
||||
fiu_enable("DropCollectionRequest.OnExecute.describe_collection_fail", 1, NULL, 0);
|
||||
handler->DropCollection(&context, &grpc_collection_name, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("DropCollectionRequest.OnExecute.describe_collection_fail");
|
||||
|
||||
fiu_enable("DropCollectionRequest.OnExecute.throw_std_exception", 1, NULL, 0);
|
||||
handler->DropTable(&context, &collection_name, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("DropCollectionRequest.OnExecute.throw_std_exception");
|
||||
fiu_enable("DropCollectionRequest.OnExecute.throw_std_exception", 1, NULL, 0);
|
||||
handler->DropCollection(&context, &grpc_collection_name, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("DropCollectionRequest.OnExecute.throw_std_exception");
|
||||
|
||||
grpc_status = handler->DropTable(&context, &collection_name, &response);
|
||||
ASSERT_EQ(grpc_status.error_code(), ::grpc::Status::OK.error_code());
|
||||
int error_code = response.error_code();
|
||||
ASSERT_EQ(error_code, ::milvus::grpc::ErrorCode::SUCCESS);
|
||||
grpc_status = handler->DropCollection(&context, &grpc_collection_name, &response);
|
||||
ASSERT_EQ(grpc_status.error_code(), ::grpc::Status::OK.error_code());
|
||||
int error_code = response.error_code();
|
||||
ASSERT_EQ(error_code, ::milvus::grpc::ErrorCode::SUCCESS);
|
||||
|
||||
tableschema.set_table_name(collection_name.table_name());
|
||||
handler->DropTable(&context, &collection_name, &response);
|
||||
sleep(1);
|
||||
handler->CreateTable(&context, &tableschema, &response);
|
||||
ASSERT_EQ(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
collection_schema.set_collection_name(grpc_collection_name.collection_name());
|
||||
handler->DropCollection(&context, &grpc_collection_name, &response);
|
||||
sleep(1);
|
||||
handler->CreateCollection(&context, &collection_schema, &response);
|
||||
ASSERT_EQ(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
|
||||
fiu_enable("DropCollectionRequest.OnExecute.drop_table_fail", 1, NULL, 0);
|
||||
handler->DropTable(&context, &collection_name, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("DropCollectionRequest.OnExecute.drop_table_fail");
|
||||
fiu_enable("DropCollectionRequest.OnExecute.drop_collection_fail", 1, NULL, 0);
|
||||
handler->DropCollection(&context, &grpc_collection_name, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("DropCollectionRequest.OnExecute.drop_collection_fail");
|
||||
|
||||
handler->DropTable(&context, &collection_name, &response);
|
||||
handler->DropCollection(&context, &grpc_collection_name, &response);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(RpcHandlerTest, PARTITION_TEST) {
|
||||
::grpc::ServerContext context;
|
||||
handler->SetContext(&context, dummy_context);
|
||||
handler->RegisterRequestHandler(milvus::server::RequestHandler());
|
||||
::milvus::grpc::TableSchema table_schema;
|
||||
::milvus::grpc::CollectionSchema collection_schema;
|
||||
::milvus::grpc::Status response;
|
||||
std::string str_table_name = "tbl_partition";
|
||||
table_schema.set_table_name(str_table_name);
|
||||
table_schema.set_dimension(TABLE_DIM);
|
||||
table_schema.set_index_file_size(INDEX_FILE_SIZE);
|
||||
table_schema.set_metric_type(1);
|
||||
handler->CreateTable(&context, &table_schema, &response);
|
||||
std::string str_collection_name = "tbl_partition";
|
||||
collection_schema.set_collection_name(str_collection_name);
|
||||
collection_schema.set_dimension(COLLECTION_DIM);
|
||||
collection_schema.set_index_file_size(INDEX_FILE_SIZE);
|
||||
collection_schema.set_metric_type(1);
|
||||
handler->CreateCollection(&context, &collection_schema, &response);
|
||||
|
||||
::milvus::grpc::PartitionParam partition_param;
|
||||
partition_param.set_table_name(str_table_name);
|
||||
partition_param.set_collection_name(str_collection_name);
|
||||
std::string partition_tag = "0";
|
||||
partition_param.set_tag(partition_tag);
|
||||
handler->CreatePartition(&context, &partition_param, &response);
|
||||
ASSERT_EQ(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
|
||||
::milvus::grpc::TableName collection_name;
|
||||
collection_name.set_table_name(str_table_name);
|
||||
::milvus::grpc::CollectionName collection_name;
|
||||
collection_name.set_collection_name(str_collection_name);
|
||||
::milvus::grpc::PartitionList partition_list;
|
||||
handler->ShowPartitions(&context, &collection_name, &partition_list);
|
||||
ASSERT_EQ(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
ASSERT_EQ(partition_list.partition_tag_array_size(), 2);
|
||||
|
||||
fiu_init(0);
|
||||
fiu_enable("ShowPartitionsRequest.OnExecute.invalid_table_name", 1, NULL, 0);
|
||||
fiu_enable("ShowPartitionsRequest.OnExecute.invalid_collection_name", 1, NULL, 0);
|
||||
handler->ShowPartitions(&context, &collection_name, &partition_list);
|
||||
fiu_disable("ShowPartitionsRequest.OnExecute.invalid_table_name");
|
||||
fiu_disable("ShowPartitionsRequest.OnExecute.invalid_collection_name");
|
||||
|
||||
fiu_enable("ShowPartitionsRequest.OnExecute.show_partition_fail", 1, NULL, 0);
|
||||
handler->ShowPartitions(&context, &collection_name, &partition_list);
|
||||
fiu_disable("ShowPartitionsRequest.OnExecute.show_partition_fail");
|
||||
|
||||
fiu_init(0);
|
||||
fiu_enable("CreatePartitionRequest.OnExecute.invalid_table_name", 1, NULL, 0);
|
||||
fiu_enable("CreatePartitionRequest.OnExecute.invalid_collection_name", 1, NULL, 0);
|
||||
handler->CreatePartition(&context, &partition_param, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("CreatePartitionRequest.OnExecute.invalid_table_name");
|
||||
fiu_disable("CreatePartitionRequest.OnExecute.invalid_collection_name");
|
||||
|
||||
fiu_enable("CreatePartitionRequest.OnExecute.invalid_partition_name", 1, NULL, 0);
|
||||
handler->CreatePartition(&context, &partition_param, &response);
|
||||
|
@ -901,13 +919,13 @@ TEST_F(RpcHandlerTest, PARTITION_TEST) {
|
|||
fiu_disable("CreatePartitionRequest.OnExecute.throw_std_exception");
|
||||
|
||||
::milvus::grpc::PartitionParam partition_parm;
|
||||
partition_parm.set_table_name(str_table_name);
|
||||
partition_parm.set_collection_name(str_collection_name);
|
||||
partition_parm.set_tag(partition_tag);
|
||||
|
||||
fiu_enable("DropPartitionRequest.OnExecute.invalid_table_name", 1, NULL, 0);
|
||||
fiu_enable("DropPartitionRequest.OnExecute.invalid_collection_name", 1, NULL, 0);
|
||||
handler->DropPartition(&context, &partition_parm, &response);
|
||||
ASSERT_NE(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
fiu_disable("DropPartitionRequest.OnExecute.invalid_table_name");
|
||||
fiu_disable("DropPartitionRequest.OnExecute.invalid_collection_name");
|
||||
|
||||
handler->DropPartition(&context, &partition_parm, &response);
|
||||
ASSERT_EQ(response.error_code(), ::grpc::Status::OK.error_code());
|
||||
|
|
|
@ -319,18 +319,18 @@ TEST(UtilTest, STATUS_TEST) {
|
|||
ASSERT_EQ(status_move.ToString(), status_ref.ToString());
|
||||
}
|
||||
|
||||
TEST(ValidationUtilTest, VALIDATE_TABLENAME_TEST) {
|
||||
TEST(ValidationUtilTest, VALIDATE_COLLECTION_NAME_TEST) {
|
||||
std::string collection_name = "Normal123_";
|
||||
auto status = milvus::server::ValidationUtil::ValidateCollectionName(collection_name);
|
||||
ASSERT_TRUE(status.ok());
|
||||
|
||||
collection_name = "12sds";
|
||||
status = milvus::server::ValidationUtil::ValidateCollectionName(collection_name);
|
||||
ASSERT_EQ(status.code(), milvus::SERVER_INVALID_TABLE_NAME);
|
||||
ASSERT_EQ(status.code(), milvus::SERVER_INVALID_COLLECTION_NAME);
|
||||
|
||||
collection_name = "";
|
||||
status = milvus::server::ValidationUtil::ValidateCollectionName(collection_name);
|
||||
ASSERT_EQ(status.code(), milvus::SERVER_INVALID_TABLE_NAME);
|
||||
ASSERT_EQ(status.code(), milvus::SERVER_INVALID_COLLECTION_NAME);
|
||||
|
||||
collection_name = "_asdasd";
|
||||
status = milvus::server::ValidationUtil::ValidateCollectionName(collection_name);
|
||||
|
@ -338,23 +338,23 @@ TEST(ValidationUtilTest, VALIDATE_TABLENAME_TEST) {
|
|||
|
||||
collection_name = "!@#!@";
|
||||
status = milvus::server::ValidationUtil::ValidateCollectionName(collection_name);
|
||||
ASSERT_EQ(status.code(), milvus::SERVER_INVALID_TABLE_NAME);
|
||||
ASSERT_EQ(status.code(), milvus::SERVER_INVALID_COLLECTION_NAME);
|
||||
|
||||
collection_name = "_!@#!@";
|
||||
status = milvus::server::ValidationUtil::ValidateCollectionName(collection_name);
|
||||
ASSERT_EQ(status.code(), milvus::SERVER_INVALID_TABLE_NAME);
|
||||
ASSERT_EQ(status.code(), milvus::SERVER_INVALID_COLLECTION_NAME);
|
||||
|
||||
collection_name = "中文";
|
||||
status = milvus::server::ValidationUtil::ValidateCollectionName(collection_name);
|
||||
ASSERT_EQ(status.code(), milvus::SERVER_INVALID_TABLE_NAME);
|
||||
ASSERT_EQ(status.code(), milvus::SERVER_INVALID_COLLECTION_NAME);
|
||||
|
||||
collection_name = std::string(10000, 'a');
|
||||
status = milvus::server::ValidationUtil::ValidateCollectionName(collection_name);
|
||||
ASSERT_EQ(status.code(), milvus::SERVER_INVALID_TABLE_NAME);
|
||||
ASSERT_EQ(status.code(), milvus::SERVER_INVALID_COLLECTION_NAME);
|
||||
|
||||
collection_name = "";
|
||||
status = milvus::server::ValidationUtil::ValidatePartitionName(collection_name);
|
||||
ASSERT_EQ(status.code(), milvus::SERVER_INVALID_TABLE_NAME);
|
||||
ASSERT_EQ(status.code(), milvus::SERVER_INVALID_COLLECTION_NAME);
|
||||
}
|
||||
|
||||
TEST(ValidationUtilTest, VALIDATE_DIMENSION_TEST) {
|
||||
|
|
|
@ -43,8 +43,8 @@
|
|||
#include "version.h"
|
||||
|
||||
|
||||
static const char* TABLE_NAME = "test_web";
|
||||
static constexpr int64_t TABLE_DIM = 256;
|
||||
static const char* COLLECTION_NAME = "test_web";
|
||||
static constexpr int64_t COLLECTION_DIM = 256;
|
||||
static constexpr int64_t INDEX_FILE_SIZE = 1024;
|
||||
static constexpr int64_t VECTOR_COUNT = 1000;
|
||||
static constexpr int64_t INSERT_LOOP = 10;
|
||||
|
@ -255,11 +255,11 @@ class WebHandlerTest : public testing::Test {
|
|||
|
||||
TEST_F(WebHandlerTest, TABLE) {
|
||||
handler->RegisterRequestHandler(milvus::server::RequestHandler());
|
||||
auto collection_name = milvus::server::web::OString(TABLE_NAME) + RandomName().c_str();
|
||||
auto collection_name = milvus::server::web::OString(COLLECTION_NAME) + RandomName().c_str();
|
||||
|
||||
auto collection_dto = milvus::server::web::TableRequestDto::createShared();
|
||||
collection_dto->collection_name = collection_name;
|
||||
collection_dto->dimension = TABLE_DIM + 100000;
|
||||
collection_dto->dimension = COLLECTION_DIM + 100000;
|
||||
collection_dto->index_file_size = INDEX_FILE_SIZE;
|
||||
collection_dto->metric_type = "L2";
|
||||
|
||||
|
@ -268,7 +268,7 @@ TEST_F(WebHandlerTest, TABLE) {
|
|||
ASSERT_EQ(StatusCode::ILLEGAL_DIMENSION, status_dto->code->getValue());
|
||||
|
||||
// invalid index file size
|
||||
collection_dto->dimension = TABLE_DIM;
|
||||
collection_dto->dimension = COLLECTION_DIM;
|
||||
collection_dto->index_file_size = -1;
|
||||
status_dto = handler->CreateTable(collection_dto);
|
||||
ASSERT_EQ(StatusCode::ILLEGAL_ARGUMENT, status_dto->code->getValue());
|
||||
|
@ -291,12 +291,12 @@ TEST_F(WebHandlerTest, TABLE) {
|
|||
|
||||
// drop collection which not exists.
|
||||
status_dto = handler->DropTable(collection_name + "57575yfhfdhfhdh436gdsgpppdgsgv3233");
|
||||
ASSERT_EQ(StatusCode::TABLE_NOT_EXISTS, status_dto->code->getValue());
|
||||
ASSERT_EQ(StatusCode::COLLECTION_NOT_EXISTS, status_dto->code->getValue());
|
||||
}
|
||||
|
||||
TEST_F(WebHandlerTest, HAS_COLLECTION_TEST) {
|
||||
handler->RegisterRequestHandler(milvus::server::RequestHandler());
|
||||
auto collection_name = milvus::server::web::OString(TABLE_NAME) + RandomName().c_str();
|
||||
auto collection_name = milvus::server::web::OString(COLLECTION_NAME) + RandomName().c_str();
|
||||
|
||||
GenTable(collection_name->std_str(), 10, 10, "L2");
|
||||
|
||||
|
@ -306,10 +306,10 @@ TEST_F(WebHandlerTest, HAS_COLLECTION_TEST) {
|
|||
ASSERT_EQ(0, status_dto->code->getValue());
|
||||
}
|
||||
|
||||
TEST_F(WebHandlerTest, GET_TABLE) {
|
||||
TEST_F(WebHandlerTest, GET_COLLECTION) {
|
||||
handler->RegisterRequestHandler(milvus::server::RequestHandler());
|
||||
|
||||
auto collection_name = milvus::server::web::OString(TABLE_NAME) + RandomName().c_str();
|
||||
auto collection_name = milvus::server::web::OString(COLLECTION_NAME) + RandomName().c_str();
|
||||
GenTable(collection_name->std_str(), 10, 10, "L2");
|
||||
|
||||
milvus::server::web::OQueryParams query_params;
|
||||
|
@ -326,7 +326,7 @@ TEST_F(WebHandlerTest, GET_TABLE) {
|
|||
TEST_F(WebHandlerTest, INSERT_COUNT) {
|
||||
handler->RegisterRequestHandler(milvus::server::RequestHandler());
|
||||
|
||||
auto collection_name = milvus::server::web::OString(TABLE_NAME) + RandomName().c_str();
|
||||
auto collection_name = milvus::server::web::OString(COLLECTION_NAME) + RandomName().c_str();
|
||||
GenTable(collection_name->std_str(), 16, 10, "L2");
|
||||
|
||||
nlohmann::json body_json;
|
||||
|
@ -351,7 +351,7 @@ TEST_F(WebHandlerTest, INSERT_COUNT) {
|
|||
TEST_F(WebHandlerTest, INDEX) {
|
||||
handler->RegisterRequestHandler(milvus::server::RequestHandler());
|
||||
|
||||
auto collection_name = milvus::server::web::OString(TABLE_NAME) + RandomName().c_str();
|
||||
auto collection_name = milvus::server::web::OString(COLLECTION_NAME) + RandomName().c_str();
|
||||
GenTable(collection_name->std_str(), 16, 10, "L2");
|
||||
|
||||
nlohmann::json index_json;
|
||||
|
@ -386,7 +386,7 @@ TEST_F(WebHandlerTest, INDEX) {
|
|||
TEST_F(WebHandlerTest, PARTITION) {
|
||||
handler->RegisterRequestHandler(milvus::server::RequestHandler());
|
||||
|
||||
auto collection_name = milvus::server::web::OString(TABLE_NAME) + RandomName().c_str();
|
||||
auto collection_name = milvus::server::web::OString(COLLECTION_NAME) + RandomName().c_str();
|
||||
GenTable(collection_name->std_str(), 16, 10, "L2");
|
||||
|
||||
auto partition_dto = milvus::server::web::PartitionRequestDto::createShared();
|
||||
|
@ -418,17 +418,17 @@ TEST_F(WebHandlerTest, PARTITION) {
|
|||
TEST_F(WebHandlerTest, SEARCH) {
|
||||
handler->RegisterRequestHandler(milvus::server::RequestHandler());
|
||||
|
||||
auto collection_name = milvus::server::web::OString(TABLE_NAME) + RandomName().c_str();
|
||||
GenTable(collection_name->std_str(), TABLE_DIM, 10, "L2");
|
||||
auto collection_name = milvus::server::web::OString(COLLECTION_NAME) + RandomName().c_str();
|
||||
GenTable(collection_name->std_str(), COLLECTION_DIM, 10, "L2");
|
||||
|
||||
nlohmann::json insert_json;
|
||||
insert_json["vectors"] = RandomRecordsJson(TABLE_DIM, 1000);
|
||||
insert_json["vectors"] = RandomRecordsJson(COLLECTION_DIM, 1000);
|
||||
auto ids_dto = milvus::server::web::VectorIdsDto::createShared();
|
||||
auto status_dto = handler->Insert(collection_name, insert_json.dump().c_str(), ids_dto);
|
||||
ASSERT_EQ(milvus::server::web::SUCCESS, status_dto->code->getValue());
|
||||
|
||||
nlohmann::json search_pram_json;
|
||||
search_pram_json["vectors"] = RandomRecordsJson(TABLE_DIM, 10);
|
||||
search_pram_json["vectors"] = RandomRecordsJson(COLLECTION_DIM, 10);
|
||||
search_pram_json["topk"] = 1;
|
||||
search_pram_json["params"] = nlohmann::json::parse("{\"nprobe\": 10}");
|
||||
|
||||
|
@ -459,7 +459,7 @@ TEST_F(WebHandlerTest, SYSTEM_INFO) {
|
|||
TEST_F(WebHandlerTest, FLUSH) {
|
||||
handler->RegisterRequestHandler(milvus::server::RequestHandler());
|
||||
|
||||
auto collection_name = milvus::server::web::OString(TABLE_NAME) + RandomName().c_str();
|
||||
auto collection_name = milvus::server::web::OString(COLLECTION_NAME) + RandomName().c_str();
|
||||
GenTable(collection_name->std_str(), 16, 10, "L2");
|
||||
|
||||
nlohmann::json body_json;
|
||||
|
@ -478,7 +478,7 @@ TEST_F(WebHandlerTest, FLUSH) {
|
|||
TEST_F(WebHandlerTest, COMPACT) {
|
||||
handler->RegisterRequestHandler(milvus::server::RequestHandler());
|
||||
|
||||
auto collection_name = milvus::server::web::OString(TABLE_NAME) + RandomName().c_str();
|
||||
auto collection_name = milvus::server::web::OString(COLLECTION_NAME) + RandomName().c_str();
|
||||
GenTable(collection_name->std_str(), 16, 10, "L2");
|
||||
|
||||
nlohmann::json body_json;
|
||||
|
@ -600,7 +600,7 @@ static const char* CONTROLLER_TEST_VALID_CONFIG_STR =
|
|||
"";
|
||||
} // namespace
|
||||
|
||||
static const char* CONTROLLER_TEST_TABLE_NAME = "controller_unit_test";
|
||||
static const char* CONTROLLER_TEST_COLLECTION_NAME = "controller_unit_test";
|
||||
static const char* CONTROLLER_TEST_CONFIG_DIR = "/tmp/milvus_web_controller_test/";
|
||||
static const char* CONTROLLER_TEST_CONFIG_FILE = "config.yaml";
|
||||
|
||||
|
@ -937,7 +937,7 @@ TEST_F(WebControllerTest, OPTIONS) {
|
|||
ASSERT_EQ(OStatus::CODE_204.code, response->getStatusCode());
|
||||
}
|
||||
|
||||
TEST_F(WebControllerTest, CREATE_TABLE) {
|
||||
TEST_F(WebControllerTest, CREATE_COLLECTION) {
|
||||
auto collection_dto = milvus::server::web::TableRequestDto::createShared();
|
||||
auto response = client_ptr->createTable(collection_dto, conncetion_ptr);
|
||||
ASSERT_EQ(OStatus::CODE_400.code, response->getStatusCode());
|
||||
|
@ -967,7 +967,7 @@ TEST_F(WebControllerTest, CREATE_TABLE) {
|
|||
ASSERT_EQ(OStatus::CODE_400.code, response->getStatusCode());
|
||||
}
|
||||
|
||||
TEST_F(WebControllerTest, GET_TABLE_META) {
|
||||
TEST_F(WebControllerTest, GET_COLLECTION_META) {
|
||||
OString collection_name = "web_test_create_collection" + OString(RandomName().c_str());
|
||||
GenTable(client_ptr, conncetion_ptr, collection_name, 10, 10, "L2");
|
||||
|
||||
|
@ -987,14 +987,14 @@ TEST_F(WebControllerTest, GET_TABLE_META) {
|
|||
response = client_ptr->getTable(collection_name, "", conncetion_ptr);
|
||||
ASSERT_EQ(OStatus::CODE_400.code, response->getStatusCode());
|
||||
auto status_sto = response->readBodyToDto<milvus::server::web::StatusDto>(object_mapper.get());
|
||||
ASSERT_EQ(milvus::server::web::StatusCode::ILLEGAL_TABLE_NAME, status_sto->code->getValue());
|
||||
ASSERT_EQ(milvus::server::web::StatusCode::ILLEGAL_COLLECTION_NAME, status_sto->code->getValue());
|
||||
|
||||
collection_name = "test_collection_not_found_000000000111010101002020203020aaaaa3030435";
|
||||
response = client_ptr->getTable(collection_name, "", conncetion_ptr);
|
||||
ASSERT_EQ(OStatus::CODE_404.code, response->getStatusCode());
|
||||
}
|
||||
|
||||
TEST_F(WebControllerTest, GET_TABLE_STAT) {
|
||||
TEST_F(WebControllerTest, GET_COLLECTION_STAT) {
|
||||
OString collection_name = "web_test_get_collection_stat" + OString(RandomName().c_str());
|
||||
GenTable(client_ptr, conncetion_ptr, collection_name, 128, 5, "L2");
|
||||
|
||||
|
@ -1025,7 +1025,7 @@ TEST_F(WebControllerTest, GET_TABLE_STAT) {
|
|||
ASSERT_TRUE(seg0_stat.contains("size"));
|
||||
}
|
||||
|
||||
TEST_F(WebControllerTest, SHOW_TABLES) {
|
||||
TEST_F(WebControllerTest, SHOW_COLLECTIONS) {
|
||||
// test query collection limit 1
|
||||
auto response = client_ptr->showTables("1", "1", conncetion_ptr);
|
||||
ASSERT_EQ(OStatus::CODE_200.code, response->getStatusCode());
|
||||
|
@ -1053,7 +1053,7 @@ TEST_F(WebControllerTest, SHOW_TABLES) {
|
|||
ASSERT_EQ(OStatus::CODE_400.code, response->getStatusCode());
|
||||
}
|
||||
|
||||
TEST_F(WebControllerTest, DROP_TABLE) {
|
||||
TEST_F(WebControllerTest, DROP_COLLECTION) {
|
||||
auto collection_name = "collection_drop_test" + OString(RandomName().c_str());
|
||||
GenTable(client_ptr, conncetion_ptr, collection_name, 128, 100, "L2");
|
||||
sleep(1);
|
||||
|
@ -1065,7 +1065,7 @@ TEST_F(WebControllerTest, DROP_TABLE) {
|
|||
response = client_ptr->dropTable(collection_name, conncetion_ptr);
|
||||
ASSERT_EQ(OStatus::CODE_404.code, response->getStatusCode());
|
||||
auto error_dto = response->readBodyToDto<milvus::server::web::StatusDto>(object_mapper.get());
|
||||
ASSERT_EQ(milvus::server::web::StatusCode::TABLE_NOT_EXISTS, error_dto->code->getValue());
|
||||
ASSERT_EQ(milvus::server::web::StatusCode::COLLECTION_NOT_EXISTS, error_dto->code->getValue());
|
||||
}
|
||||
|
||||
TEST_F(WebControllerTest, INSERT) {
|
||||
|
@ -1202,7 +1202,7 @@ TEST_F(WebControllerTest, INDEX) {
|
|||
response = client_ptr->getIndex(collection_name + "dfaedXXXdfdfet4t343aa4", conncetion_ptr);
|
||||
ASSERT_EQ(OStatus::CODE_404.code, response->getStatusCode());
|
||||
auto error_dto = response->readBodyToDto<milvus::server::web::StatusDto>(object_mapper.get());
|
||||
ASSERT_EQ(milvus::server::web::StatusCode::TABLE_NOT_EXISTS, error_dto->code->getValue());
|
||||
ASSERT_EQ(milvus::server::web::StatusCode::COLLECTION_NOT_EXISTS, error_dto->code->getValue());
|
||||
}
|
||||
|
||||
TEST_F(WebControllerTest, PARTITION) {
|
||||
|
@ -1229,7 +1229,7 @@ TEST_F(WebControllerTest, PARTITION) {
|
|||
response = client_ptr->createPartition(collection_name + "afafanotgitdiexists", par_param);
|
||||
ASSERT_EQ(OStatus::CODE_404.code, response->getStatusCode());
|
||||
error_dto = response->readBodyToDto<milvus::server::web::StatusDto>(object_mapper.get());
|
||||
ASSERT_EQ(milvus::server::web::StatusCode::TABLE_NOT_EXISTS, error_dto->code);
|
||||
ASSERT_EQ(milvus::server::web::StatusCode::COLLECTION_NOT_EXISTS, error_dto->code);
|
||||
|
||||
// insert 200 vectors into collection with tag = 'tag01'
|
||||
auto status = InsertData(client_ptr, conncetion_ptr, collection_name, 64, 200, "tag01");
|
||||
|
@ -1255,7 +1255,7 @@ TEST_F(WebControllerTest, PARTITION) {
|
|||
response = client_ptr->showPartitions(collection_name + "dfafaefaluanqibazao990099", "0", "10", conncetion_ptr);
|
||||
ASSERT_EQ(OStatus::CODE_404.code, response->getStatusCode());
|
||||
error_dto = response->readBodyToDto<milvus::server::web::StatusDto>(object_mapper.get());
|
||||
ASSERT_EQ(milvus::server::web::StatusCode::TABLE_NOT_EXISTS, error_dto->code->getValue());
|
||||
ASSERT_EQ(milvus::server::web::StatusCode::COLLECTION_NOT_EXISTS, error_dto->code->getValue());
|
||||
|
||||
response = client_ptr->dropPartition(collection_name, "{\"partition_tag\": \"tag01\"}", conncetion_ptr);
|
||||
ASSERT_EQ(OStatus::CODE_204.code, response->getStatusCode());
|
||||
|
@ -1428,7 +1428,7 @@ TEST_F(WebControllerTest, SEARCH) {
|
|||
response = client_ptr->vectorsOp(collection_name + "999piyanning", search_json.dump().c_str(), conncetion_ptr);
|
||||
ASSERT_EQ(OStatus::CODE_404.code, response->getStatusCode());
|
||||
error_dto = response->readBodyToDto<milvus::server::web::StatusDto>(object_mapper.get());
|
||||
ASSERT_EQ(milvus::server::web::StatusCode::TABLE_NOT_EXISTS, error_dto->code->getValue());
|
||||
ASSERT_EQ(milvus::server::web::StatusCode::COLLECTION_NOT_EXISTS, error_dto->code->getValue());
|
||||
}
|
||||
|
||||
TEST_F(WebControllerTest, SEARCH_BIN) {
|
||||
|
@ -1794,7 +1794,7 @@ TEST_F(WebControllerTest, DEVICES_CONFIG) {
|
|||
}
|
||||
|
||||
TEST_F(WebControllerTest, FLUSH) {
|
||||
auto collection_name = milvus::server::web::OString(TABLE_NAME) + RandomName().c_str();
|
||||
auto collection_name = milvus::server::web::OString(COLLECTION_NAME) + RandomName().c_str();
|
||||
GenTable(client_ptr, conncetion_ptr, collection_name, 16, 10, "L2");
|
||||
|
||||
auto status = InsertData(client_ptr, conncetion_ptr, collection_name, 16, 1000);
|
||||
|
|
|
@ -20,13 +20,13 @@ namespace milvus {
|
|||
namespace grpc {
|
||||
|
||||
static const char* MilvusService_method_names[] = {
|
||||
"/milvus.grpc.MilvusService/CreateTable",
|
||||
"/milvus.grpc.MilvusService/HasTable",
|
||||
"/milvus.grpc.MilvusService/DescribeTable",
|
||||
"/milvus.grpc.MilvusService/CountTable",
|
||||
"/milvus.grpc.MilvusService/ShowTables",
|
||||
"/milvus.grpc.MilvusService/ShowTableInfo",
|
||||
"/milvus.grpc.MilvusService/DropTable",
|
||||
"/milvus.grpc.MilvusService/CreateCollection",
|
||||
"/milvus.grpc.MilvusService/HasCollection",
|
||||
"/milvus.grpc.MilvusService/DescribeCollection",
|
||||
"/milvus.grpc.MilvusService/CountCollection",
|
||||
"/milvus.grpc.MilvusService/ShowCollections",
|
||||
"/milvus.grpc.MilvusService/ShowCollectionInfo",
|
||||
"/milvus.grpc.MilvusService/DropCollection",
|
||||
"/milvus.grpc.MilvusService/CreateIndex",
|
||||
"/milvus.grpc.MilvusService/DescribeIndex",
|
||||
"/milvus.grpc.MilvusService/DropIndex",
|
||||
|
@ -41,7 +41,7 @@ static const char* MilvusService_method_names[] = {
|
|||
"/milvus.grpc.MilvusService/SearchInFiles",
|
||||
"/milvus.grpc.MilvusService/Cmd",
|
||||
"/milvus.grpc.MilvusService/DeleteByID",
|
||||
"/milvus.grpc.MilvusService/PreloadTable",
|
||||
"/milvus.grpc.MilvusService/PreloadCollection",
|
||||
"/milvus.grpc.MilvusService/Flush",
|
||||
"/milvus.grpc.MilvusService/Compact",
|
||||
};
|
||||
|
@ -53,13 +53,13 @@ std::unique_ptr< MilvusService::Stub> MilvusService::NewStub(const std::shared_p
|
|||
}
|
||||
|
||||
MilvusService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel)
|
||||
: channel_(channel), rpcmethod_CreateTable_(MilvusService_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_HasTable_(MilvusService_method_names[1], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_DescribeTable_(MilvusService_method_names[2], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_CountTable_(MilvusService_method_names[3], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_ShowTables_(MilvusService_method_names[4], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_ShowTableInfo_(MilvusService_method_names[5], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_DropTable_(MilvusService_method_names[6], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
: channel_(channel), rpcmethod_CreateCollection_(MilvusService_method_names[0], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_HasCollection_(MilvusService_method_names[1], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_DescribeCollection_(MilvusService_method_names[2], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_CountCollection_(MilvusService_method_names[3], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_ShowCollections_(MilvusService_method_names[4], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_ShowCollectionInfo_(MilvusService_method_names[5], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_DropCollection_(MilvusService_method_names[6], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_CreateIndex_(MilvusService_method_names[7], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_DescribeIndex_(MilvusService_method_names[8], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_DropIndex_(MilvusService_method_names[9], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
|
@ -74,205 +74,205 @@ MilvusService::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& chan
|
|||
, rpcmethod_SearchInFiles_(MilvusService_method_names[18], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_Cmd_(MilvusService_method_names[19], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_DeleteByID_(MilvusService_method_names[20], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_PreloadTable_(MilvusService_method_names[21], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_PreloadCollection_(MilvusService_method_names[21], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_Flush_(MilvusService_method_names[22], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_Compact_(MilvusService_method_names[23], ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
{}
|
||||
|
||||
::grpc::Status MilvusService::Stub::CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CreateTable_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionSchema& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CreateCollection_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionSchema* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CreateTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CreateTable(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionSchema* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CreateTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::CreateCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CreateCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncCreateTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateTable_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionSchema& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateCollection_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncCreateTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableSchema& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateTable_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncCreateCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionSchema& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateCollection_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::HasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::BoolReply* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_HasTable_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::BoolReply* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_HasCollection_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::HasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_HasTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::BoolReply* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_HasCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::HasTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_HasTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::HasCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_HasCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::HasTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_HasTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::HasCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_HasCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::HasTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_HasTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::HasCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::BoolReply* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_HasCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* MilvusService::Stub::AsyncHasTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::BoolReply>::Create(channel_.get(), cq, rpcmethod_HasTable_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* MilvusService::Stub::AsyncHasCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::BoolReply>::Create(channel_.get(), cq, rpcmethod_HasCollection_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* MilvusService::Stub::PrepareAsyncHasTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::BoolReply>::Create(channel_.get(), cq, rpcmethod_HasTable_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::BoolReply>* MilvusService::Stub::PrepareAsyncHasCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::BoolReply>::Create(channel_.get(), cq, rpcmethod_HasCollection_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::DescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::TableSchema* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DescribeTable_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::CollectionSchema* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DescribeCollection_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionSchema* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DescribeTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableSchema* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::DescribeCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionSchema* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DescribeTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::DescribeCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionSchema* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DescribeTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableSchema* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::DescribeCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionSchema* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableSchema>* MilvusService::Stub::AsyncDescribeTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableSchema>::Create(channel_.get(), cq, rpcmethod_DescribeTable_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionSchema>* MilvusService::Stub::AsyncDescribeCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionSchema>::Create(channel_.get(), cq, rpcmethod_DescribeCollection_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableSchema>* MilvusService::Stub::PrepareAsyncDescribeTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableSchema>::Create(channel_.get(), cq, rpcmethod_DescribeTable_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionSchema>* MilvusService::Stub::PrepareAsyncDescribeCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionSchema>::Create(channel_.get(), cq, rpcmethod_DescribeCollection_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::CountTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::TableRowCount* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CountTable_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::CollectionRowCount* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_CountCollection_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CountTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CountTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionRowCount* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CountCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CountTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableRowCount* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CountTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::CountCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionRowCount* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_CountCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CountTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CountTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::CountCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionRowCount* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CountCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::CountTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableRowCount* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CountTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::CountCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionRowCount* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_CountCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableRowCount>* MilvusService::Stub::AsyncCountTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableRowCount>::Create(channel_.get(), cq, rpcmethod_CountTable_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionRowCount>* MilvusService::Stub::AsyncCountCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionRowCount>::Create(channel_.get(), cq, rpcmethod_CountCollection_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableRowCount>* MilvusService::Stub::PrepareAsyncCountTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableRowCount>::Create(channel_.get(), cq, rpcmethod_CountTable_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionRowCount>* MilvusService::Stub::PrepareAsyncCountCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionRowCount>::Create(channel_.get(), cq, rpcmethod_CountCollection_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::ShowTables(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::TableNameList* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ShowTables_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::milvus::grpc::CollectionNameList* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ShowCollections_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTables(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::TableNameList* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowTables_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::CollectionNameList* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowCollections_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTables(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableNameList* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowTables_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::ShowCollections(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionNameList* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowCollections_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTables(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::TableNameList* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowTables_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::ShowCollections(::grpc::ClientContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::CollectionNameList* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowCollections_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTables(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableNameList* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowTables_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::ShowCollections(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionNameList* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowCollections_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableNameList>* MilvusService::Stub::AsyncShowTablesRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableNameList>::Create(channel_.get(), cq, rpcmethod_ShowTables_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionNameList>* MilvusService::Stub::AsyncShowCollectionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionNameList>::Create(channel_.get(), cq, rpcmethod_ShowCollections_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableNameList>* MilvusService::Stub::PrepareAsyncShowTablesRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableNameList>::Create(channel_.get(), cq, rpcmethod_ShowTables_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionNameList>* MilvusService::Stub::PrepareAsyncShowCollectionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::Command& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionNameList>::Create(channel_.get(), cq, rpcmethod_ShowCollections_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::ShowTableInfo(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::TableInfo* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ShowTableInfo_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::CollectionInfo* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ShowCollectionInfo_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTableInfo(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableInfo* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowTableInfo_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionInfo* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowCollectionInfo_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTableInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableInfo* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowTableInfo_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::ShowCollectionInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionInfo* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowCollectionInfo_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTableInfo(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableInfo* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowTableInfo_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::ShowCollectionInfo(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionInfo* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowCollectionInfo_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowTableInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::TableInfo* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowTableInfo_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::ShowCollectionInfo(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::CollectionInfo* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowCollectionInfo_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableInfo>* MilvusService::Stub::AsyncShowTableInfoRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableInfo>::Create(channel_.get(), cq, rpcmethod_ShowTableInfo_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionInfo>* MilvusService::Stub::AsyncShowCollectionInfoRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionInfo>::Create(channel_.get(), cq, rpcmethod_ShowCollectionInfo_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::TableInfo>* MilvusService::Stub::PrepareAsyncShowTableInfoRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::TableInfo>::Create(channel_.get(), cq, rpcmethod_ShowTableInfo_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::CollectionInfo>* MilvusService::Stub::PrepareAsyncShowCollectionInfoRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::CollectionInfo>::Create(channel_.get(), cq, rpcmethod_ShowCollectionInfo_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DropTable_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DropCollection_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DropTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::DropCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DropTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::DropCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DropTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::DropCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropTable_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncDropCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropCollection_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncDropTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropTable_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncDropCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropCollection_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::CreateIndex(::grpc::ClientContext* context, const ::milvus::grpc::IndexParam& request, ::milvus::grpc::Status* response) {
|
||||
|
@ -303,11 +303,11 @@ void MilvusService::Stub::experimental_async::CreateIndex(::grpc::ClientContext*
|
|||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreateIndex_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::IndexParam* response) {
|
||||
::grpc::Status MilvusService::Stub::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::IndexParam* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DescribeIndex_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::IndexParam* response, std::function<void(::grpc::Status)> f) {
|
||||
void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::IndexParam* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeIndex_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
|
@ -315,7 +315,7 @@ void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContex
|
|||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DescribeIndex_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::IndexParam* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::IndexParam* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeIndex_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
|
@ -323,19 +323,19 @@ void MilvusService::Stub::experimental_async::DescribeIndex(::grpc::ClientContex
|
|||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DescribeIndex_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>* MilvusService::Stub::AsyncDescribeIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>* MilvusService::Stub::AsyncDescribeIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::IndexParam>::Create(channel_.get(), cq, rpcmethod_DescribeIndex_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>* MilvusService::Stub::PrepareAsyncDescribeIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::IndexParam>* MilvusService::Stub::PrepareAsyncDescribeIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::IndexParam>::Create(channel_.get(), cq, rpcmethod_DescribeIndex_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::Status* response) {
|
||||
::grpc::Status MilvusService::Stub::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_DropIndex_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropIndex_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
|
@ -343,7 +343,7 @@ void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* c
|
|||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_DropIndex_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropIndex_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
|
@ -351,11 +351,11 @@ void MilvusService::Stub::experimental_async::DropIndex(::grpc::ClientContext* c
|
|||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_DropIndex_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncDropIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncDropIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropIndex_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncDropIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncDropIndexRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DropIndex_, context, request, false);
|
||||
}
|
||||
|
||||
|
@ -387,11 +387,11 @@ void MilvusService::Stub::experimental_async::CreatePartition(::grpc::ClientCont
|
|||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_CreatePartition_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::PartitionList* response) {
|
||||
::grpc::Status MilvusService::Stub::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::PartitionList* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_ShowPartitions_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::PartitionList* response, std::function<void(::grpc::Status)> f) {
|
||||
void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::PartitionList* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowPartitions_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
|
@ -399,7 +399,7 @@ void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientConte
|
|||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_ShowPartitions_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::PartitionList* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::PartitionList* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowPartitions_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
|
@ -407,11 +407,11 @@ void MilvusService::Stub::experimental_async::ShowPartitions(::grpc::ClientConte
|
|||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_ShowPartitions_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>* MilvusService::Stub::AsyncShowPartitionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>* MilvusService::Stub::AsyncShowPartitionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::PartitionList>::Create(channel_.get(), cq, rpcmethod_ShowPartitions_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>* MilvusService::Stub::PrepareAsyncShowPartitionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::PartitionList>* MilvusService::Stub::PrepareAsyncShowPartitionsRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::PartitionList>::Create(channel_.get(), cq, rpcmethod_ShowPartitions_, context, request, false);
|
||||
}
|
||||
|
||||
|
@ -667,32 +667,32 @@ void MilvusService::Stub::experimental_async::DeleteByID(::grpc::ClientContext*
|
|||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_DeleteByID_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::PreloadTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_PreloadTable_, context, request, response);
|
||||
::grpc::Status MilvusService::Stub::PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_PreloadCollection_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::PreloadTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_PreloadTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_PreloadCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::PreloadTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_PreloadTable_, context, request, response, std::move(f));
|
||||
void MilvusService::Stub::experimental_async::PreloadCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_PreloadCollection_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::PreloadTable(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_PreloadTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::PreloadCollection(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_PreloadCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::PreloadTable(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_PreloadTable_, context, request, response, reactor);
|
||||
void MilvusService::Stub::experimental_async::PreloadCollection(::grpc::ClientContext* context, const ::grpc::ByteBuffer* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_PreloadCollection_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncPreloadTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_PreloadTable_, context, request, true);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncPreloadCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_PreloadCollection_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncPreloadTableRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_PreloadTable_, context, request, false);
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncPreloadCollectionRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_PreloadCollection_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::Flush(::grpc::ClientContext* context, const ::milvus::grpc::FlushParam& request, ::milvus::grpc::Status* response) {
|
||||
|
@ -723,11 +723,11 @@ void MilvusService::Stub::experimental_async::Flush(::grpc::ClientContext* conte
|
|||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_Flush_, context, request, false);
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Stub::Compact(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::milvus::grpc::Status* response) {
|
||||
::grpc::Status MilvusService::Stub::Compact(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::milvus::grpc::Status* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall(channel_.get(), rpcmethod_Compact_, context, request, response);
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Compact_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
|
@ -735,7 +735,7 @@ void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* con
|
|||
::grpc_impl::internal::CallbackUnaryCall(stub_->channel_.get(), stub_->rpcmethod_Compact_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response, ::grpc::experimental::ClientUnaryReactor* reactor) {
|
||||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Compact_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
|
@ -743,11 +743,11 @@ void MilvusService::Stub::experimental_async::Compact(::grpc::ClientContext* con
|
|||
::grpc_impl::internal::ClientCallbackUnaryFactory::Create(stub_->channel_.get(), stub_->rpcmethod_Compact_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncCompactRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::AsyncCompactRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_Compact_, context, request, true);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncCompactRaw(::grpc::ClientContext* context, const ::milvus::grpc::TableName& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::milvus::grpc::Status>* MilvusService::Stub::PrepareAsyncCompactRaw(::grpc::ClientContext* context, const ::milvus::grpc::CollectionName& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc_impl::internal::ClientAsyncResponseReaderFactory< ::milvus::grpc::Status>::Create(channel_.get(), cq, rpcmethod_Compact_, context, request, false);
|
||||
}
|
||||
|
||||
|
@ -755,38 +755,38 @@ MilvusService::Service::Service() {
|
|||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[0],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableSchema, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::CreateTable), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionSchema, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::CreateCollection), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[1],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::BoolReply>(
|
||||
std::mem_fn(&MilvusService::Service::HasTable), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::BoolReply>(
|
||||
std::mem_fn(&MilvusService::Service::HasCollection), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[2],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::TableSchema>(
|
||||
std::mem_fn(&MilvusService::Service::DescribeTable), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionSchema>(
|
||||
std::mem_fn(&MilvusService::Service::DescribeCollection), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[3],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::TableRowCount>(
|
||||
std::mem_fn(&MilvusService::Service::CountTable), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionRowCount>(
|
||||
std::mem_fn(&MilvusService::Service::CountCollection), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[4],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::Command, ::milvus::grpc::TableNameList>(
|
||||
std::mem_fn(&MilvusService::Service::ShowTables), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::Command, ::milvus::grpc::CollectionNameList>(
|
||||
std::mem_fn(&MilvusService::Service::ShowCollections), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[5],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::TableInfo>(
|
||||
std::mem_fn(&MilvusService::Service::ShowTableInfo), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::CollectionInfo>(
|
||||
std::mem_fn(&MilvusService::Service::ShowCollectionInfo), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[6],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::DropTable), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::DropCollection), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[7],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
|
@ -795,12 +795,12 @@ MilvusService::Service::Service() {
|
|||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[8],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::IndexParam>(
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::IndexParam>(
|
||||
std::mem_fn(&MilvusService::Service::DescribeIndex), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[9],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::Status>(
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::DropIndex), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[10],
|
||||
|
@ -810,7 +810,7 @@ MilvusService::Service::Service() {
|
|||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[11],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::PartitionList>(
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::PartitionList>(
|
||||
std::mem_fn(&MilvusService::Service::ShowPartitions), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[12],
|
||||
|
@ -860,8 +860,8 @@ MilvusService::Service::Service() {
|
|||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[21],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::PreloadTable), this)));
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::PreloadCollection), this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[22],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
|
@ -870,56 +870,56 @@ MilvusService::Service::Service() {
|
|||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
MilvusService_method_names[23],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::TableName, ::milvus::grpc::Status>(
|
||||
new ::grpc::internal::RpcMethodHandler< MilvusService::Service, ::milvus::grpc::CollectionName, ::milvus::grpc::Status>(
|
||||
std::mem_fn(&MilvusService::Service::Compact), this)));
|
||||
}
|
||||
|
||||
MilvusService::Service::~Service() {
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::CreateTable(::grpc::ServerContext* context, const ::milvus::grpc::TableSchema* request, ::milvus::grpc::Status* response) {
|
||||
::grpc::Status MilvusService::Service::CreateCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionSchema* request, ::milvus::grpc::Status* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::HasTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::BoolReply* response) {
|
||||
::grpc::Status MilvusService::Service::HasCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::BoolReply* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::DescribeTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableSchema* response) {
|
||||
::grpc::Status MilvusService::Service::DescribeCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionSchema* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::CountTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableRowCount* response) {
|
||||
::grpc::Status MilvusService::Service::CountCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionRowCount* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::ShowTables(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::TableNameList* response) {
|
||||
::grpc::Status MilvusService::Service::ShowCollections(::grpc::ServerContext* context, const ::milvus::grpc::Command* request, ::milvus::grpc::CollectionNameList* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::ShowTableInfo(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::TableInfo* response) {
|
||||
::grpc::Status MilvusService::Service::ShowCollectionInfo(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::CollectionInfo* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::DropTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) {
|
||||
::grpc::Status MilvusService::Service::DropCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
|
@ -933,14 +933,14 @@ MilvusService::Service::~Service() {
|
|||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::DescribeIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::IndexParam* response) {
|
||||
::grpc::Status MilvusService::Service::DescribeIndex(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::IndexParam* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::DropIndex(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) {
|
||||
::grpc::Status MilvusService::Service::DropIndex(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
|
@ -954,7 +954,7 @@ MilvusService::Service::~Service() {
|
|||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::ShowPartitions(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::PartitionList* response) {
|
||||
::grpc::Status MilvusService::Service::ShowPartitions(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::PartitionList* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
|
@ -1024,7 +1024,7 @@ MilvusService::Service::~Service() {
|
|||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::PreloadTable(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) {
|
||||
::grpc::Status MilvusService::Service::PreloadCollection(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
|
@ -1038,7 +1038,7 @@ MilvusService::Service::~Service() {
|
|||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status MilvusService::Service::Compact(::grpc::ServerContext* context, const ::milvus::grpc::TableName* request, ::milvus::grpc::Status* response) {
|
||||
::grpc::Status MilvusService::Service::Compact(::grpc::ServerContext* context, const ::milvus::grpc::CollectionName* request, ::milvus::grpc::Status* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -61,21 +61,21 @@ static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] =
|
|||
const char descriptor_table_protodef_status_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
|
||||
"\n\014status.proto\022\013milvus.grpc\"D\n\006Status\022*\n"
|
||||
"\nerror_code\030\001 \001(\0162\026.milvus.grpc.ErrorCod"
|
||||
"e\022\016\n\006reason\030\002 \001(\t*\230\004\n\tErrorCode\022\013\n\007SUCCE"
|
||||
"e\022\016\n\006reason\030\002 \001(\t*\242\004\n\tErrorCode\022\013\n\007SUCCE"
|
||||
"SS\020\000\022\024\n\020UNEXPECTED_ERROR\020\001\022\022\n\016CONNECT_FA"
|
||||
"ILED\020\002\022\025\n\021PERMISSION_DENIED\020\003\022\024\n\020TABLE_N"
|
||||
"OT_EXISTS\020\004\022\024\n\020ILLEGAL_ARGUMENT\020\005\022\025\n\021ILL"
|
||||
"EGAL_DIMENSION\020\007\022\026\n\022ILLEGAL_INDEX_TYPE\020\010"
|
||||
"\022\026\n\022ILLEGAL_TABLE_NAME\020\t\022\020\n\014ILLEGAL_TOPK"
|
||||
"\020\n\022\025\n\021ILLEGAL_ROWRECORD\020\013\022\025\n\021ILLEGAL_VEC"
|
||||
"TOR_ID\020\014\022\031\n\025ILLEGAL_SEARCH_RESULT\020\r\022\022\n\016F"
|
||||
"ILE_NOT_FOUND\020\016\022\017\n\013META_FAILED\020\017\022\020\n\014CACH"
|
||||
"E_FAILED\020\020\022\030\n\024CANNOT_CREATE_FOLDER\020\021\022\026\n\022"
|
||||
"CANNOT_CREATE_FILE\020\022\022\030\n\024CANNOT_DELETE_FO"
|
||||
"LDER\020\023\022\026\n\022CANNOT_DELETE_FILE\020\024\022\025\n\021BUILD_"
|
||||
"INDEX_ERROR\020\025\022\021\n\rILLEGAL_NLIST\020\026\022\027\n\023ILLE"
|
||||
"GAL_METRIC_TYPE\020\027\022\021\n\rOUT_OF_MEMORY\020\030b\006pr"
|
||||
"oto3"
|
||||
"ILED\020\002\022\025\n\021PERMISSION_DENIED\020\003\022\031\n\025COLLECT"
|
||||
"ION_NOT_EXISTS\020\004\022\024\n\020ILLEGAL_ARGUMENT\020\005\022\025"
|
||||
"\n\021ILLEGAL_DIMENSION\020\007\022\026\n\022ILLEGAL_INDEX_T"
|
||||
"YPE\020\010\022\033\n\027ILLEGAL_COLLECTION_NAME\020\t\022\020\n\014IL"
|
||||
"LEGAL_TOPK\020\n\022\025\n\021ILLEGAL_ROWRECORD\020\013\022\025\n\021I"
|
||||
"LLEGAL_VECTOR_ID\020\014\022\031\n\025ILLEGAL_SEARCH_RES"
|
||||
"ULT\020\r\022\022\n\016FILE_NOT_FOUND\020\016\022\017\n\013META_FAILED"
|
||||
"\020\017\022\020\n\014CACHE_FAILED\020\020\022\030\n\024CANNOT_CREATE_FO"
|
||||
"LDER\020\021\022\026\n\022CANNOT_CREATE_FILE\020\022\022\030\n\024CANNOT"
|
||||
"_DELETE_FOLDER\020\023\022\026\n\022CANNOT_DELETE_FILE\020\024"
|
||||
"\022\025\n\021BUILD_INDEX_ERROR\020\025\022\021\n\rILLEGAL_NLIST"
|
||||
"\020\026\022\027\n\023ILLEGAL_METRIC_TYPE\020\027\022\021\n\rOUT_OF_ME"
|
||||
"MORY\020\030b\006proto3"
|
||||
;
|
||||
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_status_2eproto_deps[1] = {
|
||||
};
|
||||
|
@ -85,7 +85,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_sta
|
|||
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_status_2eproto_once;
|
||||
static bool descriptor_table_status_2eproto_initialized = false;
|
||||
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_status_2eproto = {
|
||||
&descriptor_table_status_2eproto_initialized, descriptor_table_protodef_status_2eproto, "status.proto", 644,
|
||||
&descriptor_table_status_2eproto_initialized, descriptor_table_protodef_status_2eproto, "status.proto", 654,
|
||||
&descriptor_table_status_2eproto_once, descriptor_table_status_2eproto_sccs, descriptor_table_status_2eproto_deps, 1, 0,
|
||||
schemas, file_default_instances, TableStruct_status_2eproto::offsets,
|
||||
file_level_metadata_status_2eproto, 1, file_level_enum_descriptors_status_2eproto, file_level_service_descriptors_status_2eproto,
|
||||
|
|
|
@ -73,11 +73,11 @@ enum ErrorCode : int {
|
|||
UNEXPECTED_ERROR = 1,
|
||||
CONNECT_FAILED = 2,
|
||||
PERMISSION_DENIED = 3,
|
||||
TABLE_NOT_EXISTS = 4,
|
||||
COLLECTION_NOT_EXISTS = 4,
|
||||
ILLEGAL_ARGUMENT = 5,
|
||||
ILLEGAL_DIMENSION = 7,
|
||||
ILLEGAL_INDEX_TYPE = 8,
|
||||
ILLEGAL_TABLE_NAME = 9,
|
||||
ILLEGAL_COLLECTION_NAME = 9,
|
||||
ILLEGAL_TOPK = 10,
|
||||
ILLEGAL_ROWRECORD = 11,
|
||||
ILLEGAL_VECTOR_ID = 12,
|
||||
|
|
|
@ -36,7 +36,7 @@ ConstructSearchParam(const std::string& collection_name,
|
|||
int64_t topk,
|
||||
const std::string& extra_params,
|
||||
T& search_param) {
|
||||
search_param.set_table_name(collection_name);
|
||||
search_param.set_collection_name(collection_name);
|
||||
search_param.set_topk(topk);
|
||||
milvus::grpc::KeyValuePair* kv = search_param.add_extra_params();
|
||||
kv->set_key(EXTRA_PARAM_KEY);
|
||||
|
@ -181,13 +181,13 @@ ClientProxy::SetConfig(const std::string& node_name, const std::string& value) c
|
|||
Status
|
||||
ClientProxy::CreateCollection(const CollectionParam& param) {
|
||||
try {
|
||||
::milvus::grpc::TableSchema schema;
|
||||
schema.set_table_name(param.collection_name);
|
||||
::milvus::grpc::CollectionSchema schema;
|
||||
schema.set_collection_name(param.collection_name);
|
||||
schema.set_dimension(param.dimension);
|
||||
schema.set_index_file_size(param.index_file_size);
|
||||
schema.set_metric_type(static_cast<int32_t>(param.metric_type));
|
||||
|
||||
return client_ptr_->CreateTable(schema);
|
||||
return client_ptr_->CreateCollection(schema);
|
||||
} catch (std::exception& ex) {
|
||||
return Status(StatusCode::UnknownError, "Failed to create collection: " + std::string(ex.what()));
|
||||
}
|
||||
|
@ -196,8 +196,8 @@ ClientProxy::CreateCollection(const CollectionParam& param) {
|
|||
bool
|
||||
ClientProxy::HasCollection(const std::string& collection_name) {
|
||||
Status status = Status::OK();
|
||||
::milvus::grpc::TableName grpc_collection_name;
|
||||
grpc_collection_name.set_table_name(collection_name);
|
||||
::milvus::grpc::CollectionName grpc_collection_name;
|
||||
grpc_collection_name.set_collection_name(collection_name);
|
||||
bool result = client_ptr_->HasCollection(grpc_collection_name, status);
|
||||
return result;
|
||||
}
|
||||
|
@ -205,9 +205,9 @@ ClientProxy::HasCollection(const std::string& collection_name) {
|
|||
Status
|
||||
ClientProxy::DropCollection(const std::string& collection_name) {
|
||||
try {
|
||||
::milvus::grpc::TableName grpc_collection_name;
|
||||
grpc_collection_name.set_table_name(collection_name);
|
||||
return client_ptr_->DropTable(grpc_collection_name);
|
||||
::milvus::grpc::CollectionName grpc_collection_name;
|
||||
grpc_collection_name.set_collection_name(collection_name);
|
||||
return client_ptr_->DropCollection(grpc_collection_name);
|
||||
} catch (std::exception& ex) {
|
||||
return Status(StatusCode::UnknownError, "Failed to drop collection: " + std::string(ex.what()));
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ Status
|
|||
ClientProxy::CreateIndex(const IndexParam& index_param) {
|
||||
try {
|
||||
::milvus::grpc::IndexParam grpc_index_param;
|
||||
grpc_index_param.set_table_name(index_param.collection_name);
|
||||
grpc_index_param.set_collection_name(index_param.collection_name);
|
||||
grpc_index_param.set_index_type(static_cast<int32_t>(index_param.index_type));
|
||||
milvus::grpc::KeyValuePair* kv = grpc_index_param.add_extra_params();
|
||||
kv->set_key(EXTRA_PARAM_KEY);
|
||||
|
@ -234,7 +234,7 @@ ClientProxy::Insert(const std::string& collection_name, const std::string& parti
|
|||
Status status = Status::OK();
|
||||
try {
|
||||
::milvus::grpc::InsertParam insert_param;
|
||||
insert_param.set_table_name(collection_name);
|
||||
insert_param.set_collection_name(collection_name);
|
||||
insert_param.set_partition_tag(partition_tag);
|
||||
|
||||
for (auto& entity : entity_array) {
|
||||
|
@ -266,7 +266,7 @@ Status
|
|||
ClientProxy::GetEntityByID(const std::string& collection_name, int64_t entity_id, Entity& entity_data) {
|
||||
try {
|
||||
::milvus::grpc::VectorIdentity vector_identity;
|
||||
vector_identity.set_table_name(collection_name);
|
||||
vector_identity.set_collection_name(collection_name);
|
||||
vector_identity.set_id(entity_id);
|
||||
|
||||
::milvus::grpc::VectorData grpc_data;
|
||||
|
@ -299,7 +299,7 @@ ClientProxy::GetIDsInSegment(const std::string& collection_name, const std::stri
|
|||
std::vector<int64_t>& id_array) {
|
||||
try {
|
||||
::milvus::grpc::GetVectorIDsParam param;
|
||||
param.set_table_name(collection_name);
|
||||
param.set_collection_name(collection_name);
|
||||
param.set_segment_name(segment_name);
|
||||
|
||||
::milvus::grpc::VectorIds vector_ids;
|
||||
|
@ -363,11 +363,11 @@ ClientProxy::Search(const std::string& collection_name, const std::vector<std::s
|
|||
Status
|
||||
ClientProxy::DescribeCollection(const std::string& collection_name, CollectionParam& collection_param) {
|
||||
try {
|
||||
::milvus::grpc::TableSchema grpc_schema;
|
||||
::milvus::grpc::CollectionSchema grpc_schema;
|
||||
|
||||
Status status = client_ptr_->DescribeTable(collection_name, grpc_schema);
|
||||
Status status = client_ptr_->DescribeCollection(collection_name, grpc_schema);
|
||||
|
||||
collection_param.collection_name = grpc_schema.table_name();
|
||||
collection_param.collection_name = grpc_schema.collection_name();
|
||||
collection_param.dimension = grpc_schema.dimension();
|
||||
collection_param.index_file_size = grpc_schema.index_file_size();
|
||||
collection_param.metric_type = static_cast<MetricType>(grpc_schema.metric_type());
|
||||
|
@ -382,9 +382,9 @@ Status
|
|||
ClientProxy::CountCollection(const std::string& collection_name, int64_t& row_count) {
|
||||
try {
|
||||
Status status;
|
||||
::milvus::grpc::TableName grpc_collection_name;
|
||||
grpc_collection_name.set_table_name(collection_name);
|
||||
row_count = client_ptr_->CountTable(grpc_collection_name, status);
|
||||
::milvus::grpc::CollectionName grpc_collection_name;
|
||||
grpc_collection_name.set_collection_name(collection_name);
|
||||
row_count = client_ptr_->CountCollection(grpc_collection_name, status);
|
||||
return status;
|
||||
} catch (std::exception& ex) {
|
||||
return Status(StatusCode::UnknownError, "Failed to count collection: " + std::string(ex.what()));
|
||||
|
@ -395,12 +395,12 @@ Status
|
|||
ClientProxy::ShowCollections(std::vector<std::string>& collection_array) {
|
||||
try {
|
||||
Status status;
|
||||
milvus::grpc::TableNameList collection_name_list;
|
||||
status = client_ptr_->ShowTables(collection_name_list);
|
||||
milvus::grpc::CollectionNameList collection_name_list;
|
||||
status = client_ptr_->ShowCollections(collection_name_list);
|
||||
|
||||
collection_array.resize(collection_name_list.table_names_size());
|
||||
for (uint64_t i = 0; i < collection_name_list.table_names_size(); ++i) {
|
||||
collection_array[i] = collection_name_list.table_names(i);
|
||||
collection_array.resize(collection_name_list.collection_names_size());
|
||||
for (uint64_t i = 0; i < collection_name_list.collection_names_size(); ++i) {
|
||||
collection_array[i] = collection_name_list.collection_names(i);
|
||||
}
|
||||
return status;
|
||||
} catch (std::exception& ex) {
|
||||
|
@ -412,10 +412,10 @@ Status
|
|||
ClientProxy::ShowCollectionInfo(const std::string& collection_name, CollectionInfo& collection_info) {
|
||||
try {
|
||||
Status status;
|
||||
::milvus::grpc::TableName grpc_collection_name;
|
||||
grpc_collection_name.set_table_name(collection_name);
|
||||
milvus::grpc::TableInfo grpc_collection_info;
|
||||
status = client_ptr_->ShowTableInfo(grpc_collection_name, grpc_collection_info);
|
||||
::milvus::grpc::CollectionName grpc_collection_name;
|
||||
grpc_collection_name.set_collection_name(collection_name);
|
||||
milvus::grpc::CollectionInfo grpc_collection_info;
|
||||
status = client_ptr_->ShowCollectionInfo(grpc_collection_name, grpc_collection_info);
|
||||
|
||||
// get native info
|
||||
collection_info.total_row_count = grpc_collection_info.total_row_count();
|
||||
|
@ -438,7 +438,7 @@ Status
|
|||
ClientProxy::DeleteByID(const std::string& collection_name, const std::vector<int64_t>& id_array) {
|
||||
try {
|
||||
::milvus::grpc::DeleteByIDParam delete_by_id_param;
|
||||
delete_by_id_param.set_table_name(collection_name);
|
||||
delete_by_id_param.set_collection_name(collection_name);
|
||||
for (auto id : id_array) {
|
||||
delete_by_id_param.add_id_array(id);
|
||||
}
|
||||
|
@ -452,9 +452,9 @@ ClientProxy::DeleteByID(const std::string& collection_name, const std::vector<i
|
|||
Status
|
||||
ClientProxy::PreloadCollection(const std::string& collection_name) const {
|
||||
try {
|
||||
::milvus::grpc::TableName grpc_collection_name;
|
||||
grpc_collection_name.set_table_name(collection_name);
|
||||
Status status = client_ptr_->PreloadTable(grpc_collection_name);
|
||||
::milvus::grpc::CollectionName grpc_collection_name;
|
||||
grpc_collection_name.set_collection_name(collection_name);
|
||||
Status status = client_ptr_->PreloadCollection(grpc_collection_name);
|
||||
return status;
|
||||
} catch (std::exception& ex) {
|
||||
return Status(StatusCode::UnknownError, "Failed to preload collection: " + std::string(ex.what()));
|
||||
|
@ -464,8 +464,8 @@ ClientProxy::PreloadCollection(const std::string& collection_name) const {
|
|||
Status
|
||||
ClientProxy::DescribeIndex(const std::string& collection_name, IndexParam& index_param) const {
|
||||
try {
|
||||
::milvus::grpc::TableName grpc_collection_name;
|
||||
grpc_collection_name.set_table_name(collection_name);
|
||||
::milvus::grpc::CollectionName grpc_collection_name;
|
||||
grpc_collection_name.set_collection_name(collection_name);
|
||||
|
||||
::milvus::grpc::IndexParam grpc_index_param;
|
||||
Status status = client_ptr_->DescribeIndex(grpc_collection_name, grpc_index_param);
|
||||
|
@ -487,8 +487,8 @@ ClientProxy::DescribeIndex(const std::string& collection_name, IndexParam& index
|
|||
Status
|
||||
ClientProxy::DropIndex(const std::string& collection_name) const {
|
||||
try {
|
||||
::milvus::grpc::TableName grpc_collection_name;
|
||||
grpc_collection_name.set_table_name(collection_name);
|
||||
::milvus::grpc::CollectionName grpc_collection_name;
|
||||
grpc_collection_name.set_collection_name(collection_name);
|
||||
Status status = client_ptr_->DropIndex(grpc_collection_name);
|
||||
return status;
|
||||
} catch (std::exception& ex) {
|
||||
|
@ -500,7 +500,7 @@ Status
|
|||
ClientProxy::CreatePartition(const PartitionParam& partition_param) {
|
||||
try {
|
||||
::milvus::grpc::PartitionParam grpc_partition_param;
|
||||
grpc_partition_param.set_table_name(partition_param.collection_name);
|
||||
grpc_partition_param.set_collection_name(partition_param.collection_name);
|
||||
grpc_partition_param.set_tag(partition_param.partition_tag);
|
||||
Status status = client_ptr_->CreatePartition(grpc_partition_param);
|
||||
return status;
|
||||
|
@ -512,8 +512,8 @@ ClientProxy::CreatePartition(const PartitionParam& partition_param) {
|
|||
Status
|
||||
ClientProxy::ShowPartitions(const std::string& collection_name, PartitionTagList& partition_tag_array) const {
|
||||
try {
|
||||
::milvus::grpc::TableName grpc_collection_name;
|
||||
grpc_collection_name.set_table_name(collection_name);
|
||||
::milvus::grpc::CollectionName grpc_collection_name;
|
||||
grpc_collection_name.set_collection_name(collection_name);
|
||||
::milvus::grpc::PartitionList grpc_partition_list;
|
||||
Status status = client_ptr_->ShowPartitions(grpc_collection_name, grpc_partition_list);
|
||||
partition_tag_array.resize(grpc_partition_list.partition_tag_array_size());
|
||||
|
@ -530,7 +530,7 @@ Status
|
|||
ClientProxy::DropPartition(const PartitionParam& partition_param) {
|
||||
try {
|
||||
::milvus::grpc::PartitionParam grpc_partition_param;
|
||||
grpc_partition_param.set_table_name(partition_param.collection_name);
|
||||
grpc_partition_param.set_collection_name(partition_param.collection_name);
|
||||
grpc_partition_param.set_tag(partition_param.partition_tag);
|
||||
Status status = client_ptr_->DropPartition(grpc_partition_param);
|
||||
return status;
|
||||
|
@ -562,8 +562,8 @@ ClientProxy::Flush() {
|
|||
Status
|
||||
ClientProxy::CompactCollection(const std::string& collection_name) {
|
||||
try {
|
||||
::milvus::grpc::TableName grpc_collection_name;
|
||||
grpc_collection_name.set_table_name(collection_name);
|
||||
::milvus::grpc::CollectionName grpc_collection_name;
|
||||
grpc_collection_name.set_collection_name(collection_name);
|
||||
Status status = client_ptr_->Compact(grpc_collection_name);
|
||||
return status;
|
||||
} catch (std::exception& ex) {
|
||||
|
|
|
@ -36,13 +36,13 @@ GrpcClient::GrpcClient(std::shared_ptr<::grpc::Channel>& channel)
|
|||
GrpcClient::~GrpcClient() = default;
|
||||
|
||||
Status
|
||||
GrpcClient::CreateTable(const ::milvus::grpc::TableSchema& table_schema) {
|
||||
GrpcClient::CreateCollection(const ::milvus::grpc::CollectionSchema& collection_schema) {
|
||||
ClientContext context;
|
||||
grpc::Status response;
|
||||
::grpc::Status grpc_status = stub_->CreateTable(&context, table_schema, &response);
|
||||
::grpc::Status grpc_status = stub_->CreateCollection(&context, collection_schema, &response);
|
||||
|
||||
if (!grpc_status.ok()) {
|
||||
std::cerr << "CreateTable gRPC failed!" << std::endl;
|
||||
std::cerr << "CreateCollection gRPC failed!" << std::endl;
|
||||
return Status(StatusCode::RPCFailed, grpc_status.error_message());
|
||||
}
|
||||
|
||||
|
@ -54,10 +54,10 @@ GrpcClient::CreateTable(const ::milvus::grpc::TableSchema& table_schema) {
|
|||
}
|
||||
|
||||
bool
|
||||
GrpcClient::HasCollection(const ::milvus::grpc::TableName& collection_name, Status& status) {
|
||||
GrpcClient::HasCollection(const ::milvus::grpc::CollectionName& collection_name, Status& status) {
|
||||
ClientContext context;
|
||||
::milvus::grpc::BoolReply response;
|
||||
::grpc::Status grpc_status = stub_->HasTable(&context, collection_name, &response);
|
||||
::grpc::Status grpc_status = stub_->HasCollection(&context, collection_name, &response);
|
||||
|
||||
if (!grpc_status.ok()) {
|
||||
std::cerr << "HasCollection gRPC failed!" << std::endl;
|
||||
|
@ -72,13 +72,13 @@ GrpcClient::HasCollection(const ::milvus::grpc::TableName& collection_name, Stat
|
|||
}
|
||||
|
||||
Status
|
||||
GrpcClient::DropTable(const ::milvus::grpc::TableName& collection_name) {
|
||||
GrpcClient::DropCollection(const ::milvus::grpc::CollectionName& collection_name) {
|
||||
ClientContext context;
|
||||
grpc::Status response;
|
||||
::grpc::Status grpc_status = stub_->DropTable(&context, collection_name, &response);
|
||||
::grpc::Status grpc_status = stub_->DropCollection(&context, collection_name, &response);
|
||||
|
||||
if (!grpc_status.ok()) {
|
||||
std::cerr << "DropTable gRPC failed!" << std::endl;
|
||||
std::cerr << "DropCollection gRPC failed!" << std::endl;
|
||||
return Status(StatusCode::RPCFailed, grpc_status.error_message());
|
||||
}
|
||||
if (response.error_code() != grpc::SUCCESS) {
|
||||
|
@ -179,14 +179,14 @@ GrpcClient::Search(
|
|||
}
|
||||
|
||||
Status
|
||||
GrpcClient::DescribeTable(const std::string& collection_name, ::milvus::grpc::TableSchema& grpc_schema) {
|
||||
GrpcClient::DescribeCollection(const std::string& collection_name, ::milvus::grpc::CollectionSchema& grpc_schema) {
|
||||
ClientContext context;
|
||||
::milvus::grpc::TableName grpc_tablename;
|
||||
grpc_tablename.set_table_name(collection_name);
|
||||
::grpc::Status grpc_status = stub_->DescribeTable(&context, grpc_tablename, &grpc_schema);
|
||||
::milvus::grpc::CollectionName grpc_collectionname;
|
||||
grpc_collectionname.set_collection_name(collection_name);
|
||||
::grpc::Status grpc_status = stub_->DescribeCollection(&context, grpc_collectionname, &grpc_schema);
|
||||
|
||||
if (!grpc_status.ok()) {
|
||||
std::cerr << "DescribeTable rpc failed!" << std::endl;
|
||||
std::cerr << "DescribeCollection rpc failed!" << std::endl;
|
||||
std::cerr << grpc_status.error_message() << std::endl;
|
||||
return Status(StatusCode::RPCFailed, grpc_status.error_message());
|
||||
}
|
||||
|
@ -200,13 +200,13 @@ GrpcClient::DescribeTable(const std::string& collection_name, ::milvus::grpc::Ta
|
|||
}
|
||||
|
||||
int64_t
|
||||
GrpcClient::CountTable(grpc::TableName& collection_name, Status& status) {
|
||||
GrpcClient::CountCollection(grpc::CollectionName& collection_name, Status& status) {
|
||||
ClientContext context;
|
||||
::milvus::grpc::TableRowCount response;
|
||||
::grpc::Status grpc_status = stub_->CountTable(&context, collection_name, &response);
|
||||
::milvus::grpc::CollectionRowCount response;
|
||||
::grpc::Status grpc_status = stub_->CountCollection(&context, collection_name, &response);
|
||||
|
||||
if (!grpc_status.ok()) {
|
||||
std::cerr << "CountTable rpc failed!" << std::endl;
|
||||
std::cerr << "CountCollection rpc failed!" << std::endl;
|
||||
status = Status(StatusCode::RPCFailed, grpc_status.error_message());
|
||||
return -1;
|
||||
}
|
||||
|
@ -218,37 +218,37 @@ GrpcClient::CountTable(grpc::TableName& collection_name, Status& status) {
|
|||
}
|
||||
|
||||
status = Status::OK();
|
||||
return response.table_row_count();
|
||||
return response.collection_row_count();
|
||||
}
|
||||
|
||||
Status
|
||||
GrpcClient::ShowTables(milvus::grpc::TableNameList& table_name_list) {
|
||||
GrpcClient::ShowCollections(milvus::grpc::CollectionNameList& collection_name_list) {
|
||||
ClientContext context;
|
||||
::milvus::grpc::Command command;
|
||||
::grpc::Status grpc_status = stub_->ShowTables(&context, command, &table_name_list);
|
||||
::grpc::Status grpc_status = stub_->ShowCollections(&context, command, &collection_name_list);
|
||||
|
||||
if (!grpc_status.ok()) {
|
||||
std::cerr << "ShowTables gRPC failed!" << std::endl;
|
||||
std::cerr << "ShowCollections gRPC failed!" << std::endl;
|
||||
std::cerr << grpc_status.error_message() << std::endl;
|
||||
return Status(StatusCode::RPCFailed, grpc_status.error_message());
|
||||
}
|
||||
|
||||
if (table_name_list.status().error_code() != grpc::SUCCESS) {
|
||||
std::cerr << table_name_list.status().reason() << std::endl;
|
||||
return Status(StatusCode::ServerFailed, table_name_list.status().reason());
|
||||
if (collection_name_list.status().error_code() != grpc::SUCCESS) {
|
||||
std::cerr << collection_name_list.status().reason() << std::endl;
|
||||
return Status(StatusCode::ServerFailed, collection_name_list.status().reason());
|
||||
}
|
||||
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
Status
|
||||
GrpcClient::ShowTableInfo(grpc::TableName& collection_name, grpc::TableInfo& collection_info) {
|
||||
GrpcClient::ShowCollectionInfo(grpc::CollectionName& collection_name, grpc::CollectionInfo& collection_info) {
|
||||
ClientContext context;
|
||||
::milvus::grpc::Command command;
|
||||
::grpc::Status grpc_status = stub_->ShowTableInfo(&context, collection_name, &collection_info);
|
||||
::grpc::Status grpc_status = stub_->ShowCollectionInfo(&context, collection_name, &collection_info);
|
||||
|
||||
if (!grpc_status.ok()) {
|
||||
std::cerr << "ShowTableInfo gRPC failed!" << std::endl;
|
||||
std::cerr << "ShowCollectionInfo gRPC failed!" << std::endl;
|
||||
std::cerr << grpc_status.error_message() << std::endl;
|
||||
return Status(StatusCode::RPCFailed, grpc_status.error_message());
|
||||
}
|
||||
|
@ -284,13 +284,13 @@ GrpcClient::Cmd(const std::string& cmd, std::string& result) {
|
|||
}
|
||||
|
||||
Status
|
||||
GrpcClient::PreloadTable(milvus::grpc::TableName& collection_name) {
|
||||
GrpcClient::PreloadCollection(milvus::grpc::CollectionName& collection_name) {
|
||||
ClientContext context;
|
||||
::milvus::grpc::Status response;
|
||||
::grpc::Status grpc_status = stub_->PreloadTable(&context, collection_name, &response);
|
||||
::grpc::Status grpc_status = stub_->PreloadCollection(&context, collection_name, &response);
|
||||
|
||||
if (!grpc_status.ok()) {
|
||||
std::cerr << "PreloadTable gRPC failed!" << std::endl;
|
||||
std::cerr << "PreloadCollection gRPC failed!" << std::endl;
|
||||
return Status(StatusCode::RPCFailed, grpc_status.error_message());
|
||||
}
|
||||
|
||||
|
@ -320,7 +320,7 @@ GrpcClient::DeleteByID(grpc::DeleteByIDParam& delete_by_id_param) {
|
|||
}
|
||||
|
||||
Status
|
||||
GrpcClient::DescribeIndex(grpc::TableName& collection_name, grpc::IndexParam& index_param) {
|
||||
GrpcClient::DescribeIndex(grpc::CollectionName& collection_name, grpc::IndexParam& index_param) {
|
||||
ClientContext context;
|
||||
::grpc::Status grpc_status = stub_->DescribeIndex(&context, collection_name, &index_param);
|
||||
|
||||
|
@ -337,7 +337,7 @@ GrpcClient::DescribeIndex(grpc::TableName& collection_name, grpc::IndexParam& in
|
|||
}
|
||||
|
||||
Status
|
||||
GrpcClient::DropIndex(grpc::TableName& collection_name) {
|
||||
GrpcClient::DropIndex(grpc::CollectionName& collection_name) {
|
||||
ClientContext context;
|
||||
::milvus::grpc::Status response;
|
||||
::grpc::Status grpc_status = stub_->DropIndex(&context, collection_name, &response);
|
||||
|
@ -373,7 +373,7 @@ GrpcClient::CreatePartition(const grpc::PartitionParam& partition_param) {
|
|||
}
|
||||
|
||||
Status
|
||||
GrpcClient::ShowPartitions(const grpc::TableName& collection_name, grpc::PartitionList& partition_array) const {
|
||||
GrpcClient::ShowPartitions(const grpc::CollectionName& collection_name, grpc::PartitionList& partition_array) const {
|
||||
ClientContext context;
|
||||
::grpc::Status grpc_status = stub_->ShowPartitions(&context, collection_name, &partition_array);
|
||||
|
||||
|
@ -413,7 +413,7 @@ GrpcClient::Flush(const std::string& collection_name) {
|
|||
|
||||
::milvus::grpc::FlushParam param;
|
||||
if (!collection_name.empty()) {
|
||||
param.add_table_name_array(collection_name);
|
||||
param.add_collection_name_array(collection_name);
|
||||
}
|
||||
|
||||
::milvus::grpc::Status response;
|
||||
|
@ -432,7 +432,7 @@ GrpcClient::Flush(const std::string& collection_name) {
|
|||
}
|
||||
|
||||
Status
|
||||
GrpcClient::Compact(milvus::grpc::TableName& collection_name) {
|
||||
GrpcClient::Compact(milvus::grpc::CollectionName& collection_name) {
|
||||
ClientContext context;
|
||||
::milvus::grpc::Status response;
|
||||
::grpc::Status grpc_status = stub_->Compact(&context, collection_name, &response);
|
||||
|
|
|
@ -36,13 +36,13 @@ class GrpcClient {
|
|||
virtual ~GrpcClient();
|
||||
|
||||
Status
|
||||
CreateTable(const grpc::TableSchema& table_schema);
|
||||
CreateCollection(const grpc::CollectionSchema& collection_schema);
|
||||
|
||||
bool
|
||||
HasCollection(const grpc::TableName& table_name, Status& status);
|
||||
HasCollection(const grpc::CollectionName& collection_name, Status& status);
|
||||
|
||||
Status
|
||||
DropTable(const grpc::TableName& table_name);
|
||||
DropCollection(const grpc::CollectionName& collection_name);
|
||||
|
||||
Status
|
||||
CreateIndex(const grpc::IndexParam& index_param);
|
||||
|
@ -60,16 +60,16 @@ class GrpcClient {
|
|||
Search(const grpc::SearchParam& search_param, ::milvus::grpc::TopKQueryResult& topk_query_result);
|
||||
|
||||
Status
|
||||
DescribeTable(const std::string& table_name, grpc::TableSchema& grpc_schema);
|
||||
DescribeCollection(const std::string& collection_name, grpc::CollectionSchema& grpc_schema);
|
||||
|
||||
int64_t
|
||||
CountTable(grpc::TableName& table_name, Status& status);
|
||||
CountCollection(grpc::CollectionName& collection_name, Status& status);
|
||||
|
||||
Status
|
||||
ShowTables(milvus::grpc::TableNameList& table_name_list);
|
||||
ShowCollections(milvus::grpc::CollectionNameList& collection_name_list);
|
||||
|
||||
Status
|
||||
ShowTableInfo(grpc::TableName& table_name, grpc::TableInfo& collection_info);
|
||||
ShowCollectionInfo(grpc::CollectionName& collection_name, grpc::CollectionInfo& collection_info);
|
||||
|
||||
Status
|
||||
Cmd(const std::string& cmd, std::string& result);
|
||||
|
@ -78,28 +78,28 @@ class GrpcClient {
|
|||
DeleteByID(grpc::DeleteByIDParam& delete_by_id_param);
|
||||
|
||||
Status
|
||||
PreloadTable(grpc::TableName& table_name);
|
||||
PreloadCollection(grpc::CollectionName& collection_name);
|
||||
|
||||
Status
|
||||
DescribeIndex(grpc::TableName& table_name, grpc::IndexParam& index_param);
|
||||
DescribeIndex(grpc::CollectionName& collection_name, grpc::IndexParam& index_param);
|
||||
|
||||
Status
|
||||
DropIndex(grpc::TableName& table_name);
|
||||
DropIndex(grpc::CollectionName& collection_name);
|
||||
|
||||
Status
|
||||
CreatePartition(const grpc::PartitionParam& partition_param);
|
||||
|
||||
Status
|
||||
ShowPartitions(const grpc::TableName& table_name, grpc::PartitionList& partition_array) const;
|
||||
ShowPartitions(const grpc::CollectionName& collection_name, grpc::PartitionList& partition_array) const;
|
||||
|
||||
Status
|
||||
DropPartition(const ::milvus::grpc::PartitionParam& partition_param);
|
||||
|
||||
Status
|
||||
Flush(const std::string& table_name);
|
||||
Flush(const std::string& collection_name);
|
||||
|
||||
Status
|
||||
Compact(milvus::grpc::TableName& table_name);
|
||||
Compact(milvus::grpc::CollectionName& collection_name);
|
||||
|
||||
Status
|
||||
Disconnect();
|
||||
|
|
Loading…
Reference in New Issue