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