提交 dfdc5148 编写于 作者: X Xu Peng

feat(db): merge file changes


Former-commit-id: 806100220b3af5d11d0a6d99ecc16fe55536b9fd
上级 18994f2a
......@@ -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);
for (auto group_id : group_ids) {
std::cout << __func__ << " group_id=" << group_id << std::endl;
}
if (group_ids.size() > 0) {
Status status;
for (auto group_id : group_ids) {
/* std::cout << __func__ << " group_id=" << group_id << std::endl; */
status = background_merge_files(group_id);
if (!status.ok()) {
_bg_error = status;
return;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册