diff --git a/replica/compaction_group.hh b/replica/compaction_group.hh index 5d91e730f0..332eabaab8 100644 --- a/replica/compaction_group.hh +++ b/replica/compaction_group.hh @@ -175,6 +175,8 @@ public: const dht::token_range& token_range() const noexcept; + size_t memtable_count() const noexcept; + compaction_group_ptr& main_compaction_group() noexcept; utils::small_vector compaction_groups() noexcept; diff --git a/replica/table.cc b/replica/table.cc index a69cc90d8d..1ee063a236 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -2024,6 +2024,11 @@ size_t compaction_group::memtable_count() const noexcept { return _memtables->size(); } +size_t storage_group::memtable_count() const noexcept { + auto memtable_count = [] (const compaction_group_ptr& cg) { return cg ? cg->memtable_count() : 0; }; + return memtable_count(_main_cg); +} + future<> table::flush(std::optional pos) { if (pos && *pos < _flush_rp) { co_return;