mirror of https://github.com/milvus-io/milvus.git
parent
03c1b03dd0
commit
04f00bbe91
core
src/db/engine
unittest/db
|
@ -738,15 +738,22 @@ ExecutionEngineImpl::BuildIndex(const std::string& location, EngineType engine_t
|
||||||
|
|
||||||
auto status = Status::OK();
|
auto status = Status::OK();
|
||||||
std::vector<segment::doc_id_t> uids;
|
std::vector<segment::doc_id_t> uids;
|
||||||
|
faiss::ConcurrentBitsetPtr blacklist;
|
||||||
if (from_index) {
|
if (from_index) {
|
||||||
status = to_index->BuildAll(Count(), from_index->GetRawVectors(), from_index->GetRawIds(), conf);
|
status = to_index->BuildAll(Count(), from_index->GetRawVectors(), from_index->GetRawIds(), conf);
|
||||||
uids = from_index->GetUids();
|
uids = from_index->GetUids();
|
||||||
|
from_index->GetBlacklist(blacklist);
|
||||||
} else if (bin_from_index) {
|
} else if (bin_from_index) {
|
||||||
status = to_index->BuildAll(Count(), bin_from_index->GetRawVectors(), bin_from_index->GetRawIds(), conf);
|
status = to_index->BuildAll(Count(), bin_from_index->GetRawVectors(), bin_from_index->GetRawIds(), conf);
|
||||||
uids = bin_from_index->GetUids();
|
uids = bin_from_index->GetUids();
|
||||||
|
bin_from_index->GetBlacklist(blacklist);
|
||||||
}
|
}
|
||||||
to_index->SetUids(uids);
|
to_index->SetUids(uids);
|
||||||
ENGINE_LOG_DEBUG << "set uids " << to_index->GetUids().size() << " for " << location;
|
ENGINE_LOG_DEBUG << "Set " << to_index->GetUids().size() << "uids for " << location;
|
||||||
|
if (blacklist != nullptr) {
|
||||||
|
to_index->SetBlacklist(blacklist);
|
||||||
|
ENGINE_LOG_DEBUG << "Set blacklist for index " << location;
|
||||||
|
}
|
||||||
|
|
||||||
if (!status.ok()) {
|
if (!status.ok()) {
|
||||||
throw Exception(DB_ERROR, status.message());
|
throw Exception(DB_ERROR, status.message());
|
||||||
|
|
|
@ -65,7 +65,7 @@ static const char *CONFIG_STR =
|
||||||
" cpu_cache_capacity: 4 # GB, CPU memory used for cache\n"
|
" cpu_cache_capacity: 4 # GB, CPU memory used for cache\n"
|
||||||
" cpu_cache_threshold: 0.85 # percentage of data kept when cache cleanup triggered\n"
|
" cpu_cache_threshold: 0.85 # percentage of data kept when cache cleanup triggered\n"
|
||||||
" insert_buffer_size: 4 # GB, maximum insert buffer size allowed\n"
|
" insert_buffer_size: 4 # GB, maximum insert buffer size allowed\n"
|
||||||
" cache_insert_data: false # whether load inserted data into cache\n"
|
" cache_insert_data: true # whether load inserted data into cache\n"
|
||||||
"\n"
|
"\n"
|
||||||
"engine_config:\n"
|
"engine_config:\n"
|
||||||
" use_blas_threshold: 20\n"
|
" use_blas_threshold: 20\n"
|
||||||
|
@ -179,6 +179,7 @@ DBTest::SetUp() {
|
||||||
milvus::scheduler::JobMgrInst::GetInstance()->Start();
|
milvus::scheduler::JobMgrInst::GetInstance()->Start();
|
||||||
|
|
||||||
auto options = GetOptions();
|
auto options = GetOptions();
|
||||||
|
options.insert_cache_immediately_ = true;
|
||||||
db_ = milvus::engine::DBFactory::Build(options);
|
db_ = milvus::engine::DBFactory::Build(options);
|
||||||
|
|
||||||
std::string config_path(options.meta_.path_ + CONFIG_FILE);
|
std::string config_path(options.meta_.path_ + CONFIG_FILE);
|
||||||
|
|
Loading…
Reference in New Issue