refactor(db): add more debug log

Former-commit-id: 7c196e05c60567216938115e081438beeecb0f47
This commit is contained in:
Xu Peng 2019-05-05 18:02:11 +08:00
parent d3cbc1ccad
commit 496989bbe4
2 changed files with 10 additions and 4 deletions

View File

@ -243,8 +243,7 @@ Status DBImpl<EngineT>::merge_files(const std::string& group_id, const meta::Dat
auto file_schema = file;
file_schema.file_type = meta::GroupFileSchema::TO_DELETE;
updated.push_back(file_schema);
/* LOG(DEBUG) << "About to merge file " << file_schema.file_id << */
/* " of size=" << file_schema.rows; */
LOG(DEBUG) << "Merging file " << file_schema.file_id;
index_size = index.Size();
if (index_size >= _options.index_trigger_size) break;
@ -260,8 +259,8 @@ Status DBImpl<EngineT>::merge_files(const std::string& group_id, const meta::Dat
group_file.rows = index_size;
updated.push_back(group_file);
status = _pMeta->update_files(updated);
/* LOG(DEBUG) << "New merged file " << group_file.file_id << */
/* " of size=" << group_file.rows; */
LOG(DEBUG) << "New merged file " << group_file.file_id <<
" of size=" << index.PhysicalSize()/(1024*1024) << " M";
index.Cache();
@ -322,6 +321,10 @@ Status DBImpl<EngineT>::build_index(const meta::GroupFileSchema& file) {
meta::GroupFilesSchema update_files = {to_remove, group_file};
_pMeta->update_files(update_files);
LOG(DEBUG) << "New index file " << group_file.file_id << " of size "
<< index->PhysicalSize()/(1024*1024) << " M"
<< " from file " << to_remove.file_id;
index->Cache();
return Status::OK();

View File

@ -59,6 +59,9 @@ Status MemVectors<EngineT>::serialize(std::string& group_id) {
auto status = pMeta_->update_group_file(schema_);
LOG(DEBUG) << "New " << ((schema_.file_type == meta::GroupFileSchema::RAW) ? "raw" : "to_index")
<< " file " << schema_.file_id << " of size " << pEE_->PhysicalSize() / (1024*1024) << " M";
pEE_->Cache();
return status;