瀏覽代碼

simplify SetOtherInputs

light_ver
ArcueidType 3 週之前
父節點
當前提交
47e4063400
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. +4
    -4
      db/version_set.cc
  2. +1
    -1
      db/version_set.h

+ 4
- 4
db/version_set.cc 查看文件

@ -1298,7 +1298,7 @@ Compaction* VersionSet::PickCompaction() {
assert(!c->inputs_[0].empty());
}
SetupOtherInputs(c, false);
SetupOtherInputs(c);
return c;
}
@ -1382,7 +1382,7 @@ void AddBoundaryInputs(const InternalKeyComparator& icmp,
}
}
void VersionSet::SetupOtherInputs(Compaction* c, bool is_last_level) {
void VersionSet::SetupOtherInputs(Compaction* c) {
const int level = c->level();
InternalKey smallest, largest;
@ -1390,7 +1390,7 @@ void VersionSet::SetupOtherInputs(Compaction* c, bool is_last_level) {
GetRange(c->inputs_[0], &smallest, &largest);
// TTL: manual compaction for last level shouldn't have inputs[1]
if (!is_last_level) {
if (!c->is_last_level()) {
current_->GetOverlappingInputs(level + 1, &smallest, &largest,
&c->inputs_[1]);
AddBoundaryInputs(icmp_, current_->files_[level + 1], &c->inputs_[1]);
@ -1477,7 +1477,7 @@ Compaction* VersionSet::CompactRange(int level, const InternalKey* begin,
c->input_version_ = current_;
c->input_version_->Ref();
c->inputs_[0] = inputs;
SetupOtherInputs(c, is_last_level);
SetupOtherInputs(c);
return c;
}

+ 1
- 1
db/version_set.h 查看文件

@ -286,7 +286,7 @@ class VersionSet {
const std::vector<FileMetaData*>& inputs2,
InternalKey* smallest, InternalKey* largest);
void SetupOtherInputs(Compaction* c, bool is_last_level);
void SetupOtherInputs(Compaction* c);
// Save current contents to *log
Status WriteSnapshot(log::Writer* log);

Loading…
取消
儲存