mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
enhance: Add log to debug index task (#45198)
Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
This commit is contained in:
parent
ed8ba4a28c
commit
01cf5c9341
@ -305,18 +305,26 @@ VectorMemIndex<T>::BuildWithDataset(const DatasetPtr& dataset,
|
||||
SetDim(dataset->GetDim());
|
||||
|
||||
knowhere::TimeRecorder rc("BuildWithoutIds", 1);
|
||||
LOG_INFO("start build memory index with KNOWHERE, build_id: {}",
|
||||
config.value("build_id", "unknown"));
|
||||
auto stat = index_.Build(dataset, index_config, use_knowhere_build_pool_);
|
||||
if (stat != knowhere::Status::success)
|
||||
ThrowInfo(ErrorCode::IndexBuildError,
|
||||
"failed to build index, " + KnowhereStatusString(stat));
|
||||
rc.ElapseFromBegin("Done");
|
||||
LOG_INFO("build memory index with KNOWHERE done, build_id: {}",
|
||||
config.value("build_id", "unknown"));
|
||||
SetDim(index_.Dim());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
VectorMemIndex<T>::Build(const Config& config) {
|
||||
LOG_INFO("start build memory index, build_id: {}",
|
||||
config.value("build_id", "unknown"));
|
||||
auto field_datas = file_manager_->CacheRawDataToMemory(config);
|
||||
LOG_INFO("CacheRawDataToMemory success, build_id: {}",
|
||||
config.value("build_id", "unknown"));
|
||||
auto opt_fields = GetValueFromConfig<OptFieldT>(config, VEC_OPT_FIELDS);
|
||||
std::unordered_map<int64_t, std::vector<std::vector<uint32_t>>> scalar_info;
|
||||
auto is_partition_key_isolation =
|
||||
|
||||
@ -41,6 +41,9 @@ VecIndexCreator::VecIndexCreator(
|
||||
config_[DIM_KEY] = file_manager_context.indexMeta.dim;
|
||||
}
|
||||
|
||||
config_["build_id"] =
|
||||
std::to_string(file_manager_context.indexMeta.build_id);
|
||||
|
||||
index::CreateIndexInfo index_info;
|
||||
index_info.field_type = data_type_;
|
||||
index_info.index_type = index::GetIndexTypeFromConfig(config_);
|
||||
|
||||
@ -243,7 +243,11 @@ CreateIndex(CIndex* res_index,
|
||||
index_non_encoding};
|
||||
auto chunk_manager =
|
||||
milvus::storage::CreateChunkManager(storage_config);
|
||||
LOG_INFO("create chunk manager success, build_id: {}",
|
||||
build_index_info->buildid());
|
||||
auto fs = milvus::storage::InitArrowFileSystem(storage_config);
|
||||
LOG_INFO("init arrow file system success, build_id: {}",
|
||||
build_index_info->buildid());
|
||||
|
||||
milvus::storage::FileManagerContext fileManagerContext(
|
||||
field_meta, index_meta, chunk_manager, fs);
|
||||
@ -268,7 +272,10 @@ CreateIndex(CIndex* res_index,
|
||||
auto index =
|
||||
milvus::indexbuilder::IndexFactory::GetInstance().CreateIndex(
|
||||
field_type, config, fileManagerContext);
|
||||
LOG_INFO("create index instance success, build_id: {}",
|
||||
build_index_info->buildid());
|
||||
index->Build();
|
||||
LOG_INFO("build index done, build_id: {}", build_index_info->buildid());
|
||||
*res_index = index.release();
|
||||
auto status = CStatus();
|
||||
status.error_code = Success;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user