feature: add PER_TABLE_CACHING feature

This feature will ensure that caching can be switched
off per table only after the whole cluster supports it.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
This commit is contained in:
Piotr Jastrzebski
2020-03-31 13:48:04 +02:00
parent 2d727114ed
commit 0475dab359
3 changed files with 11 additions and 1 deletions

View File

@@ -140,6 +140,7 @@ extern const std::string_view NONFROZEN_UDTS;
extern const std::string_view HINTED_HANDOFF_SEPARATE_CONNECTION;
extern const std::string_view LWT;
extern const std::string_view PER_TABLE_PARTITIONERS;
extern const std::string_view PER_TABLE_CACHING;
}

View File

@@ -55,6 +55,7 @@ constexpr std::string_view features::NONFROZEN_UDTS = "NONFROZEN_UDTS";
constexpr std::string_view features::HINTED_HANDOFF_SEPARATE_CONNECTION = "HINTED_HANDOFF_SEPARATE_CONNECTION";
constexpr std::string_view features::LWT = "LWT";
constexpr std::string_view features::PER_TABLE_PARTITIONERS = "PER_TABLE_PARTITIONERS";
constexpr std::string_view features::PER_TABLE_CACHING = "PER_TABLE_CACHING";
static logging::logger logger("features");
@@ -88,7 +89,8 @@ feature_service::feature_service(feature_config cfg) : _config(cfg)
, _nonfrozen_udts(*this, features::NONFROZEN_UDTS)
, _hinted_handoff_separate_connection(*this, features::HINTED_HANDOFF_SEPARATE_CONNECTION)
, _lwt_feature(*this, features::LWT)
, _per_table_partitioners_feature(*this, features::PER_TABLE_PARTITIONERS) {
, _per_table_partitioners_feature(*this, features::PER_TABLE_PARTITIONERS)
, _per_table_caching_feature(*this, features::PER_TABLE_CACHING) {
}
feature_config feature_config_from_db_config(db::config& cfg) {
@@ -163,6 +165,7 @@ std::set<std::string_view> feature_service::known_feature_set() {
gms::features::UNBOUNDED_RANGE_TOMBSTONES,
gms::features::HINTED_HANDOFF_SEPARATE_CONNECTION,
gms::features::PER_TABLE_PARTITIONERS,
gms::features::PER_TABLE_CACHING,
};
if (_config.enable_sstables_mc_format) {
@@ -254,6 +257,7 @@ void feature_service::enable(const std::set<std::string_view>& list) {
std::ref(_hinted_handoff_separate_connection),
std::ref(_lwt_feature),
std::ref(_per_table_partitioners_feature),
std::ref(_per_table_caching_feature),
})
{
if (list.count(f.name())) {

View File

@@ -96,6 +96,7 @@ private:
gms::feature _hinted_handoff_separate_connection;
gms::feature _lwt_feature;
gms::feature _per_table_partitioners_feature;
gms::feature _per_table_caching_feature;
public:
bool cluster_supports_range_tombstones() const {
@@ -166,6 +167,10 @@ public:
return _per_table_partitioners_feature;
}
const feature& cluster_supports_per_table_caching() const {
return _per_table_caching_feature;
}
bool cluster_supports_row_level_repair() const {
return bool(_row_level_repair_feature);
}