未验证 提交 01f9d31d 编写于 作者: J Jin Hai 提交者: GitHub

Merge pull request #443 from fishpenguin/0.6.0-yk-refactor-scheduler

Query API in customization still uses old version
...@@ -17,6 +17,7 @@ Please mark all change in change log and use the ticket from JIRA. ...@@ -17,6 +17,7 @@ Please mark all change in change log and use the ticket from JIRA.
- \#399 - Create partition should be failed if partition tag existed - \#399 - Create partition should be failed if partition tag existed
- \#412 - Message returned is confused when partition created with null partition name - \#412 - Message returned is confused when partition created with null partition name
- \#416 - Drop the same partition success repeatally - \#416 - Drop the same partition success repeatally
- \#440 - Query API in customization still uses old version
## Feature ## Feature
- \#12 - Pure CPU version for Milvus - \#12 - Pure CPU version for Milvus
......
...@@ -106,41 +106,6 @@ Action::SpecifiedResourceLabelTaskScheduler(const ResourceMgrPtr& res_mgr, Resou ...@@ -106,41 +106,6 @@ Action::SpecifiedResourceLabelTaskScheduler(const ResourceMgrPtr& res_mgr, Resou
std::shared_ptr<LoadCompletedEvent> event) { std::shared_ptr<LoadCompletedEvent> event) {
auto task_item = event->task_table_item_; auto task_item = event->task_table_item_;
auto task = event->task_table_item_->task; auto task = event->task_table_item_->task;
// if (resource->type() == ResourceType::DISK) {
// // step 1: calculate shortest path per resource, from disk to compute resource
// auto compute_resources = res_mgr->GetComputeResources();
// std::vector<std::vector<std::string>> paths;
// std::vector<uint64_t> transport_costs;
// for (auto& res : compute_resources) {
// std::vector<std::string> path;
// uint64_t transport_cost = ShortestPath(resource, res, res_mgr, path);
// transport_costs.push_back(transport_cost);
// paths.emplace_back(path);
// }
// if (task->job_.lock()->type() == JobType::BUILD) {
// // step2: Read device id in config
// // get build index gpu resource
// server::Config& config = server::Config::GetInstance();
// int32_t build_index_gpu;
// Status stat = config.GetResourceConfigIndexBuildDevice(build_index_gpu);
//
// bool find_gpu_res = false;
// if (res_mgr->GetResource(ResourceType::GPU, build_index_gpu) != nullptr) {
// for (uint64_t i = 0; i < compute_resources.size(); ++i) {
// if (compute_resources[i]->name() ==
// res_mgr->GetResource(ResourceType::GPU, build_index_gpu)->name()) {
// find_gpu_res = true;
// Path task_path(paths[i], paths[i].size() - 1);
// task->path() = task_path;
// break;
// }
// }
// }
// if (not find_gpu_res) {
// task->path() = Path(paths[0], paths[0].size() - 1);
// }
// }
// }
if (resource->name() == task->path().Last()) { if (resource->name() == task->path().Last()) {
resource->WakeupExecutor(); resource->WakeupExecutor();
......
...@@ -305,24 +305,30 @@ TEST_F(DBTest, SEARCH_TEST) { ...@@ -305,24 +305,30 @@ TEST_F(DBTest, SEARCH_TEST) {
// test FAISS_IVFSQ8H optimizer // test FAISS_IVFSQ8H optimizer
index.engine_type_ = (int)milvus::engine::EngineType::FAISS_IVFSQ8H; index.engine_type_ = (int)milvus::engine::EngineType::FAISS_IVFSQ8H;
db_->CreateIndex(TABLE_NAME, index); // wait until build index finish db_->CreateIndex(TABLE_NAME, index); // wait until build index finish
std::vector<std::string> partition_tag;
milvus::engine::ResultIds result_ids;
milvus::engine::ResultDistances result_dists;
{ {
milvus::engine::QueryResults results; result_ids.clear();
stat = db_->Query(TABLE_NAME, k, nq, 10, xq.data(), results); result_dists.clear();
stat = db_->Query(TABLE_NAME, partition_tag, k, nq, 10, xq.data(), result_ids, result_dists);
ASSERT_TRUE(stat.ok()); ASSERT_TRUE(stat.ok());
} }
{ {
milvus::engine::QueryResults large_nq_results; result_ids.clear();
stat = db_->Query(TABLE_NAME, k, 200, 10, xq.data(), large_nq_results); result_dists.clear();
stat = db_->Query(TABLE_NAME, partition_tag, k, 200, 10, xq.data(), result_ids, result_dists);
ASSERT_TRUE(stat.ok()); ASSERT_TRUE(stat.ok());
} }
{ // search by specify index file { // search by specify index file
milvus::engine::meta::DatesT dates; milvus::engine::meta::DatesT dates;
std::vector<std::string> file_ids = {"1", "2", "3", "4", "5", "6"}; std::vector<std::string> file_ids = {"1", "2", "3", "4", "5", "6"};
milvus::engine::QueryResults results; result_ids.clear();
stat = db_->Query(TABLE_NAME, file_ids, k, nq, 10, xq.data(), dates, results); result_dists.clear();
stat = db_->QueryByFileID(TABLE_NAME, file_ids, k, nq, 10, xq.data(), dates, result_ids, result_dists);
ASSERT_TRUE(stat.ok()); ASSERT_TRUE(stat.ok());
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册