mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
[RocksDB] Add OnCompactionStart to CompactionFilter class
Summary: This is to give application compaction filter a chance to access context information of a specific compaction run. For example, depending on whether a compaction goes through all data files, the application could do things differently. Test Plan: make check Reviewers: dhruba, kailiu, sdong Reviewed By: dhruba CC: leveldb Differential Revision: https://reviews.facebook.net/D13683
This commit is contained in:
@@ -2467,6 +2467,10 @@ Compaction* VersionSet::PickCompactionUniversal(int level, double score) {
|
||||
// remember this currently undergoing compaction
|
||||
compactions_in_progress_[level].insert(c);
|
||||
|
||||
// Record whether this compaction includes all sst files.
|
||||
// For now, it is only relevant in universal compaction mode.
|
||||
c->is_full_compaction_ = (c->inputs_[0].size() == current_->files_[0].size());
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -2921,6 +2925,7 @@ Compaction::Compaction(int level, int out_level, uint64_t target_file_size,
|
||||
parent_index_(-1),
|
||||
score_(0),
|
||||
bottommost_level_(false),
|
||||
is_full_compaction_(false),
|
||||
level_ptrs_(std::vector<size_t>(number_levels)) {
|
||||
edit_ = new VersionEdit(number_levels_);
|
||||
for (int i = 0; i < number_levels_; i++) {
|
||||
|
||||
Reference in New Issue
Block a user