set size after load (#1539)

Signed-off-by: xiaojun.lin <xiaojun.lin@zilliz.com>
This commit is contained in:
Tinkerrr 2020-03-06 21:10:42 +08:00 committed by GitHub
parent 5bb1d001e2
commit 626c9bc593
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -38,6 +38,7 @@ Please mark all change in change log and use the issue from GitHub
- \#1518 Table count did not match after deleting vectors and compact
- \#1530 Set table file with correct engine type in meta
- \#1525 Add setter API for config preload_table
- \#1535 Degradation searching performance with metric_type: binary_idmap
## Feature
- \#216 Add CLI to get server info

View File

@ -452,6 +452,10 @@ ExecutionEngineImpl::Load(bool to_cache) {
status = std::static_pointer_cast<BFIndex>(index_)->AddWithoutIds(vectors->GetCount(),
float_vectors.data(), Config());
status = std::static_pointer_cast<BFIndex>(index_)->SetBlacklist(concurrent_bitset_ptr);
int64_t index_size = vectors->GetCount() * conf->d * sizeof(float);
int64_t bitset_size = vectors->GetCount() / 8;
index_->set_size(index_size + bitset_size);
} else if (index_type_ == EngineType::FAISS_BIN_IDMAP) {
ec = std::static_pointer_cast<BinBFIndex>(index_)->Build(conf);
if (ec != KNOWHERE_SUCCESS) {
@ -460,6 +464,10 @@ ExecutionEngineImpl::Load(bool to_cache) {
status = std::static_pointer_cast<BinBFIndex>(index_)->AddWithoutIds(vectors->GetCount(),
vectors_data.data(), Config());
status = std::static_pointer_cast<BinBFIndex>(index_)->SetBlacklist(concurrent_bitset_ptr);
int64_t index_size = vectors->GetCount() * conf->d * sizeof(uint8_t);
int64_t bitset_size = vectors->GetCount() / 8;
index_->set_size(index_size + bitset_size);
}
if (!status.ok()) {
return status;