From 4ae6eae00a90ecf7cccf1ec7a2bd45cd06a2344b Mon Sep 17 00:00:00 2001 From: Asias He Date: Sun, 8 Aug 2021 19:37:00 +0800 Subject: [PATCH] table: Get rid of table::run_compaction helper The table::run_compaction is a trivial wrapper for table::compact_sstables. We have lots of similar {start, trigger, run}_compaction functions. Dropping the run_compaction wrapper to reduce confusion. Closes #9161 --- compaction/compaction_manager.cc | 4 ++-- database.hh | 1 - table.cc | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/compaction/compaction_manager.cc b/compaction/compaction_manager.cc index c3b80f2efc..7167e66bc1 100644 --- a/compaction/compaction_manager.cc +++ b/compaction/compaction_manager.cc @@ -595,7 +595,7 @@ void compaction_manager::submit(column_family* cf) { _stats.pending_tasks--; _stats.active_tasks++; task->compaction_running = true; - return cf.run_compaction(std::move(descriptor)).then_wrapped([this, task, compacting = std::move(compacting), weight_r = std::move(weight_r)] (future<> f) mutable { + return cf.compact_sstables(std::move(descriptor)).then_wrapped([this, task, compacting = std::move(compacting), weight_r = std::move(weight_r)] (future<> f) mutable { _stats.active_tasks--; task->compaction_running = false; @@ -724,7 +724,7 @@ future<> compaction_manager::rewrite_sstables(column_family* cf, sstables::compa compaction_backlog_tracker user_initiated(std::make_unique(_compaction_controller.backlog_of_shares(200), _available_memory)); return do_with(std::move(user_initiated), [this, &cf, descriptor = std::move(descriptor)] (compaction_backlog_tracker& bt) mutable { return with_scheduling_group(_maintenance_sg.cpu, [this, &cf, descriptor = std::move(descriptor)]() mutable { - return cf.run_compaction(std::move(descriptor)); + return cf.compact_sstables(std::move(descriptor)); }); }); }).then_wrapped([this, task, compacting] (future<> f) mutable { diff --git a/database.hh b/database.hh index 8ce52795d9..16f52b3c8c 100644 --- a/database.hh +++ b/database.hh @@ -881,7 +881,6 @@ public: void start_compaction(); void trigger_compaction(); void try_trigger_compaction() noexcept; - future<> run_compaction(sstables::compaction_descriptor descriptor); void trigger_offstrategy_compaction(); future<> run_offstrategy_compaction(); void set_compaction_strategy(sstables::compaction_strategy_type strategy); diff --git a/table.cc b/table.cc index 1c58becc1f..e9c1c828ec 100644 --- a/table.cc +++ b/table.cc @@ -951,10 +951,6 @@ void table::do_trigger_compaction() { } } -future<> table::run_compaction(sstables::compaction_descriptor descriptor) { - return compact_sstables(std::move(descriptor)); -} - void table::trigger_offstrategy_compaction() { // If the user calls trigger_offstrategy_compaction() to trigger // off-strategy explicitly, cancel the timeout based automatic trigger.