compaction: table_state: add virtual get_tombstone_gc_state method

and override it in table::table_state to get the tombstone_gc_state
from the table's compaction_manager.

It is going to be used in the next patched to pass the gc state
from the compaction_strategy down to sstables and compaction.

table_state_for_test was modified to just keep a null
tombstone_gc_state.

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
This commit is contained in:
Benny Halevy
2022-09-06 21:06:29 +03:00
parent 6fb4b5555d
commit 2cd3fc2f36
3 changed files with 9 additions and 0 deletions

View File

@@ -124,10 +124,12 @@ class table_state_for_test : public table_state {
column_family_for_tests& _t;
test_env& _env;
std::vector<sstables::shared_sstable> _compacted_undeleted;
tombstone_gc_state _tombstone_gc_state;
public:
explicit table_state_for_test(column_family_for_tests& t, test_env& env)
: _t(t)
, _env(env)
, _tombstone_gc_state(nullptr)
{
}
const schema_ptr& schema() const noexcept override {
@@ -179,6 +181,9 @@ public:
bool is_auto_compaction_disabled_by_user() const noexcept override {
return false;
}
const tombstone_gc_state& get_tombstone_gc_state() const noexcept override {
return _tombstone_gc_state;
}
};
static std::unique_ptr<table_state> make_table_state_for_test(column_family_for_tests& t, test_env& env) {