Skip to content

Commit

Permalink
sstables: Move compaction_strategy_impl::compaction_strategy_impl out…
Browse files Browse the repository at this point in the history
… of line

Signed-off-by: Rafael Ávila de Espíndola <espindola@scylladb.com>
Message-Id: <20200812232915.442564-4-espindola@scylladb.com>
  • Loading branch information
espindola authored and avikivity committed Aug 19, 2020
1 parent 9ba765f commit 7b3946f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 13 additions & 0 deletions sstables/compaction_strategy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,19 @@ std::optional<sstring> compaction_strategy_impl::get_value(const std::map<sstrin
return it->second;
}

compaction_strategy_impl::compaction_strategy_impl(const std::map<sstring, sstring>& options) {
using namespace cql3::statements;

auto tmp_value = get_value(options, TOMBSTONE_THRESHOLD_OPTION);
_tombstone_threshold = property_definitions::to_double(TOMBSTONE_THRESHOLD_OPTION, tmp_value, DEFAULT_TOMBSTONE_THRESHOLD);

tmp_value = get_value(options, TOMBSTONE_COMPACTION_INTERVAL_OPTION);
auto interval = property_definitions::to_long(TOMBSTONE_COMPACTION_INTERVAL_OPTION, tmp_value, DEFAULT_TOMBSTONE_COMPACTION_INTERVAL().count());
_tombstone_compaction_interval = db_clock::duration(std::chrono::seconds(interval));

// FIXME: validate options.
}

} // namespace sstables

size_tiered_backlog_tracker::inflight_component
Expand Down
13 changes: 1 addition & 12 deletions sstables/compaction_strategy_impl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,7 @@ public:
static std::optional<sstring> get_value(const std::map<sstring, sstring>& options, const sstring& name);
protected:
compaction_strategy_impl() = default;
explicit compaction_strategy_impl(const std::map<sstring, sstring>& options) {
using namespace cql3::statements;

auto tmp_value = get_value(options, TOMBSTONE_THRESHOLD_OPTION);
_tombstone_threshold = property_definitions::to_double(TOMBSTONE_THRESHOLD_OPTION, tmp_value, DEFAULT_TOMBSTONE_THRESHOLD);

tmp_value = get_value(options, TOMBSTONE_COMPACTION_INTERVAL_OPTION);
auto interval = property_definitions::to_long(TOMBSTONE_COMPACTION_INTERVAL_OPTION, tmp_value, DEFAULT_TOMBSTONE_COMPACTION_INTERVAL().count());
_tombstone_compaction_interval = db_clock::duration(std::chrono::seconds(interval));

// FIXME: validate options.
}
explicit compaction_strategy_impl(const std::map<sstring, sstring>& options);
public:
virtual ~compaction_strategy_impl() {}
virtual compaction_descriptor get_sstables_for_compaction(column_family& cfs, std::vector<sstables::shared_sstable> candidates) = 0;
Expand Down

0 comments on commit 7b3946f

Please sign in to comment.