/* * Copyright (C) 2023-present ScyllaDB */ /* * SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0 */ #pragma once #include "time_window_compaction_strategy.hh" #include "leveled_compaction_strategy.hh" #include #include namespace compaction { class compaction_strategy_state { public: struct default_empty_state {}; using states_variant = std::variant; private: states_variant _state; public: explicit compaction_strategy_state(states_variant state) : _state(std::move(state)) { } template requires requires (StateType st) { { states_variant{} = st }; } StateType& get() noexcept { return std::get(_state); } static compaction_strategy_state make(const compaction_strategy& cs); }; }