From 9d91c8dd42ee8ef694cde428deb5a6fff36eb0a2 Mon Sep 17 00:00:00 2001 From: Yang Zhang Date: Sat, 21 Sep 2024 23:48:06 -0700 Subject: [PATCH] Add is_bottommost_level info in CompactionFilter context Signed-off-by: Yang Zhang --- db/compaction/compaction.cc | 1 + include/rocksdb/compaction_filter.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/db/compaction/compaction.cc b/db/compaction/compaction.cc index bbab8f79fb56..ab7e7eaedfc7 100644 --- a/db/compaction/compaction.cc +++ b/db/compaction/compaction.cc @@ -827,6 +827,7 @@ std::unique_ptr Compaction::CreateCompactionFilter() const { context.is_full_compaction = is_full_compaction_; context.is_manual_compaction = is_manual_compaction_; context.input_start_level = start_level_; + context.is_bottommost_level = bottommost_level_; context.column_family_id = cfd_->GetID(); context.reason = TableFileCreationReason::kCompaction; context.input_table_properties = GetInputTableProperties(); diff --git a/include/rocksdb/compaction_filter.h b/include/rocksdb/compaction_filter.h index 1784f2329ac6..410ee4d3ab0e 100644 --- a/include/rocksdb/compaction_filter.h +++ b/include/rocksdb/compaction_filter.h @@ -164,6 +164,8 @@ class CompactionFilter : public Customizable { // The lowest level among all the input files (if any) used in table // creation int input_start_level = kUnknownStartLevel; + // Whether output files are in bottommost level or not. + bool is_bottommost_level; // The column family that will contain the created table file. uint32_t column_family_id; // Reason this table file is being created.