This will allow upcoming work to gently produce a sstable set for each compaction group view. Example: repaired and unrepaired. Locking strategy for compaction's sstable selection: Since sstable retrieval path became futurized, tasks in compaction manager will now hold the write lock (compaction_state::lock) when retrieving the sstable list, feeding them into compaction strategy, and finally registering selected sstables as compacting. The last step prevents another concurrent task from picking the same sstable. Previously, all those steps were atomic, but we have seen stall in that area in large installations, so futurization of that area would come sooner or later. Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
28 lines
701 B
C++
28 lines
701 B
C++
/*
|
|
* Copyright (C) 2021-present ScyllaDB
|
|
*
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "compaction/compaction_fwd.hh"
|
|
#include "sstables/sstable_set.hh"
|
|
|
|
namespace compaction {
|
|
|
|
// Used by manager to set goals and constraints on compaction strategies
|
|
class strategy_control {
|
|
public:
|
|
virtual ~strategy_control() {}
|
|
virtual bool has_ongoing_compaction(compaction_group_view& table_s) const noexcept = 0;
|
|
virtual future<std::vector<sstables::shared_sstable>> candidates(compaction_group_view&) const = 0;
|
|
virtual future<std::vector<sstables::frozen_sstable_run>> candidates_as_runs(compaction_group_view&) const = 0;
|
|
};
|
|
|
|
}
|
|
|