提交 d6862b3f 编写于 作者: S Siying Dong 提交者: Facebook Github Bot

Make ReadRangeDelAggregator::ShouldDelete() more inline friendly (#5202)

Summary:
Reorganize the code so that no function call into ReadRangeDelAggregator is needed if there is no tomb range stone.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5202

Differential Revision: D14968155

Pulled By: siying

fbshipit-source-id: 0bd61911293c7a27b4e1b8d57c66d0c4ad6a6a5f
上级 01cfea66
......@@ -322,8 +322,8 @@ void ReadRangeDelAggregator::AddTombstones(
std::move(input_iter), icmp_, smallest, largest)));
}
bool ReadRangeDelAggregator::ShouldDelete(const ParsedInternalKey& parsed,
RangeDelPositioningMode mode) {
bool ReadRangeDelAggregator::ShouldDeleteImpl(const ParsedInternalKey& parsed,
RangeDelPositioningMode mode) {
return rep_.ShouldDelete(parsed, mode);
}
......
......@@ -349,7 +349,7 @@ class RangeDelAggregator {
std::set<uint64_t> files_seen_;
};
class ReadRangeDelAggregator : public RangeDelAggregator {
class ReadRangeDelAggregator final : public RangeDelAggregator {
public:
ReadRangeDelAggregator(const InternalKeyComparator* icmp,
SequenceNumber upper_bound)
......@@ -364,7 +364,12 @@ class ReadRangeDelAggregator : public RangeDelAggregator {
const InternalKey* largest = nullptr) override;
bool ShouldDelete(const ParsedInternalKey& parsed,
RangeDelPositioningMode mode) override;
RangeDelPositioningMode mode) final override {
if (rep_.IsEmpty()) {
return false;
}
return ShouldDeleteImpl(parsed, mode);
}
bool IsRangeOverlapped(const Slice& start, const Slice& end);
......@@ -374,6 +379,9 @@ class ReadRangeDelAggregator : public RangeDelAggregator {
private:
StripeRep rep_;
bool ShouldDeleteImpl(const ParsedInternalKey& parsed,
RangeDelPositioningMode mode);
};
class CompactionRangeDelAggregator : public RangeDelAggregator {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册