mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-01 20:46:56 +00:00
compaction: introduce compaction_read_monitor_generator::remove_exhausted_sstables()
This new function makes it easier to remove monitor of exhausted sstables. Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
This commit is contained in:
@@ -381,11 +381,13 @@ struct compaction_read_monitor_generator final : public read_monitor_generator {
|
||||
}
|
||||
}
|
||||
|
||||
void remove_sstable(bool is_tracking, sstables::shared_sstable& sst) {
|
||||
auto it = _generated_monitors.find(sst);
|
||||
if (it != _generated_monitors.end()) {
|
||||
it->second.remove_sstable(is_tracking);
|
||||
_generated_monitors.erase(it);
|
||||
void remove_exhausted_sstables(bool is_tracking, const std::vector<sstables::shared_sstable>& exhausted_sstables) {
|
||||
for (auto &sst : exhausted_sstables) {
|
||||
auto it = _generated_monitors.find(sst);
|
||||
if (it != _generated_monitors.end()) {
|
||||
it->second.remove_sstable(is_tracking);
|
||||
_generated_monitors.erase(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
private:
|
||||
@@ -1040,9 +1042,7 @@ private:
|
||||
// an early sstable replacement.
|
||||
//
|
||||
|
||||
for (auto& sst : exhausted_sstables) {
|
||||
_monitor_generator.remove_sstable(_info->tracking, sst);
|
||||
}
|
||||
_monitor_generator.remove_exhausted_sstables(_info->tracking, exhausted_sstables);
|
||||
auto& tracker = _cf.get_compaction_strategy().get_backlog_tracker();
|
||||
for (auto& sst : _unused_sstables) {
|
||||
tracker.add_sstable(sst);
|
||||
|
||||
Reference in New Issue
Block a user