MCPcopy Create free account
hub / github.com/ElementsProject/elements / InstallCompactionResults

Method InstallCompactionResults

src/leveldb/db/db_impl.cc:870–886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

868}
869
870Status DBImpl::InstallCompactionResults(CompactionState* compact) {
871 mutex_.AssertHeld();
872 Log(options_.info_log, "Compacted %d@%d + %d@%d files => %lld bytes",
873 compact->compaction->num_input_files(0), compact->compaction->level(),
874 compact->compaction->num_input_files(1), compact->compaction->level() + 1,
875 static_cast<long long>(compact->total_bytes));
876
877 // Add compaction outputs
878 compact->compaction->AddInputDeletions(compact->compaction->edit());
879 const int level = compact->compaction->level();
880 for (size_t i = 0; i < compact->outputs.size(); i++) {
881 const CompactionState::Output& out = compact->outputs[i];
882 compact->compaction->edit()->AddFile(level + 1, out.number, out.file_size,
883 out.smallest, out.largest);
884 }
885 return versions_->LogAndApply(compact->compaction->edit(), &mutex_);
886}
887
888Status DBImpl::DoCompactionWork(CompactionState* compact) {
889 const uint64_t start_micros = env_->NowMicros();

Callers

nothing calls this directly

Calls 8

LogFunction · 0.85
num_input_filesMethod · 0.80
levelMethod · 0.80
AddInputDeletionsMethod · 0.80
editMethod · 0.80
AddFileMethod · 0.80
LogAndApplyMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected