create index notify (#2003)

* create index notify

Signed-off-by: yhmo <yihua.mo@zilliz.com>

* typo

Signed-off-by: yhmo <yihua.mo@zilliz.com>

* typo

Signed-off-by: groot <yihua.mo@zilliz.com>
This commit is contained in:
groot 2020-04-21 01:22:18 -05:00 committed by GitHub
parent 9e30c468ff
commit a5eec9d7b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -1979,6 +1979,7 @@ DBImpl::BackgroundBuildIndex() {
}
LOG_ENGINE_DEBUG_ << "Background build index thread finished";
index_req_swn_.Notify(); // notify CreateIndex check circle
}
}
@ -2162,7 +2163,7 @@ DBImpl::WaitCollectionIndexRecursively(const std::string& collection_id, const C
status = meta_ptr_->UpdateCollectionFilesToIndex(collection_id);
}
std::this_thread::sleep_for(std::chrono::seconds(WAIT_BUILD_INDEX_INTERVAL));
index_req_swn_.Wait_For(std::chrono::seconds(WAIT_BUILD_INDEX_INTERVAL));
GetFilesToBuildIndex(collection_id, file_types, collection_files);
++times;

View File

@ -344,6 +344,7 @@ class DBImpl : public DB, public server::CacheConfigHandler, public server::Engi
SimpleWaitNotify swn_index_;
SimpleWaitNotify flush_req_swn_;
SimpleWaitNotify index_req_swn_;
ThreadPool merge_thread_pool_;
std::mutex merge_result_mutex_;