mirror of https://github.com/milvus-io/milvus.git
feat(db): merge file changes
Former-commit-id: 806100220b3af5d11d0a6d99ecc16fe55536b9fdpull/191/head
parent
18994f2aa9
commit
dfdc514886
|
@ -138,7 +138,6 @@ Status DBImpl::background_merge_files(const std::string& group_id) {
|
|||
meta::DatePartionedGroupFilesSchema raw_files;
|
||||
auto status = _pMeta->files_to_merge(group_id, raw_files);
|
||||
if (!status.ok()) {
|
||||
_bg_error = status;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -147,19 +146,27 @@ Status DBImpl::background_merge_files(const std::string& group_id) {
|
|||
}
|
||||
|
||||
for (auto& kv : raw_files) {
|
||||
auto files = kv.second;
|
||||
if (files.size() <= _options.raw_file_merge_trigger_number) {
|
||||
continue;
|
||||
}
|
||||
merge_files(group_id, kv.first, kv.second);
|
||||
}
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
void DBImpl::background_compaction() {
|
||||
std::vector<std::string> group_ids;
|
||||
_pMemMgr->serialize(group_ids);
|
||||
|
||||
Status status;
|
||||
for (auto group_id : group_ids) {
|
||||
std::cout << __func__ << " group_id=" << group_id << std::endl;
|
||||
}
|
||||
|
||||
if (group_ids.size() > 0) {
|
||||
|
||||
/* std::cout << __func__ << " group_id=" << group_id << std::endl; */
|
||||
status = background_merge_files(group_id);
|
||||
if (!status.ok()) {
|
||||
_bg_error = status;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue