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

Method OpenCompactionOutputFile

src/leveldb/db/db_impl.cc:796–819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

794}
795
796Status DBImpl::OpenCompactionOutputFile(CompactionState* compact) {
797 assert(compact != nullptr);
798 assert(compact->builder == nullptr);
799 uint64_t file_number;
800 {
801 mutex_.Lock();
802 file_number = versions_->NewFileNumber();
803 pending_outputs_.insert(file_number);
804 CompactionState::Output out;
805 out.number = file_number;
806 out.smallest.Clear();
807 out.largest.Clear();
808 compact->outputs.push_back(out);
809 mutex_.Unlock();
810 }
811
812 // Make the output file
813 std::string fname = TableFileName(dbname_, file_number);
814 Status s = env_->NewWritableFile(fname, &compact->outfile);
815 if (s.ok()) {
816 compact->builder = new TableBuilder(options_, compact->outfile);
817 }
818 return s;
819}
820
821Status DBImpl::FinishCompactionOutputFile(CompactionState* compact,
822 Iterator* input) {

Callers

nothing calls this directly

Calls 8

TableFileNameFunction · 0.85
LockMethod · 0.80
NewFileNumberMethod · 0.80
UnlockMethod · 0.80
insertMethod · 0.45
ClearMethod · 0.45
push_backMethod · 0.45
NewWritableFileMethod · 0.45

Tested by

no test coverage detected