mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-03 05:26:58 +00:00
replica: Introduce table::parallel_foreach_table_state()
This will replace table::as_table_state(). The latter will be killed once its usage drops to zero. Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
This commit is contained in:
@@ -1110,7 +1110,10 @@ public:
|
||||
void update_off_strategy_trigger();
|
||||
void enable_off_strategy_trigger();
|
||||
|
||||
// FIXME: get rid of it once no users.
|
||||
compaction::table_state& as_table_state() const noexcept;
|
||||
// Safely iterate through table states, while performing async operations on them.
|
||||
future<> parallel_foreach_table_state(std::function<future<>(compaction::table_state&)> action);
|
||||
|
||||
friend class compaction_group;
|
||||
};
|
||||
|
||||
@@ -2674,6 +2674,12 @@ compaction::table_state& table::as_table_state() const noexcept {
|
||||
return _compaction_group->as_table_state();
|
||||
}
|
||||
|
||||
future<> table::parallel_foreach_table_state(std::function<future<>(table_state&)> action) {
|
||||
return parallel_foreach_compaction_group([action = std::move(action)] (compaction_group& cg) -> future<> {
|
||||
return action(cg.as_table_state());
|
||||
});
|
||||
}
|
||||
|
||||
data_dictionary::table
|
||||
table::as_data_dictionary() const {
|
||||
static constinit data_dictionary_impl _impl;
|
||||
|
||||
Reference in New Issue
Block a user