Files
scylla/locator/local_strategy.hh
Piotr Smaron 2953d3ebe0 cql: restore validating replication strategies options
`validate_options` needs to be extended with
`topology` parameter, because NetworkTopologyStrategy needs to validate if every
explicitly listed DC is really existing. I did cut corner a bit and
trimmed the message thrown when it's not the case, just to avoid passing
and extra parameter (ks name) to the `validate_options`
function, as I find the longer message to be a bit redundant (the driver will
receive info which KS modification failed).
The tests that have been commented out in the previous commit have been
restored.
2025-02-04 12:27:33 +01:00

41 lines
1.1 KiB
C++

/*
* Copyright (C) 2015-present ScyllaDB
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
*/
#pragma once
#include "abstract_replication_strategy.hh"
#include <optional>
// forward declaration since replica/database.hh includes this file
class keyspace;
namespace locator {
using inet_address = gms::inet_address;
using token = dht::token;
class local_strategy : public abstract_replication_strategy {
public:
local_strategy(replication_strategy_params params);
virtual ~local_strategy() {};
virtual size_t get_replication_factor(const token_metadata&) const override;
virtual future<host_id_set> calculate_natural_endpoints(const token& search_token, const token_metadata& tm) const override;
virtual void validate_options(const gms::feature_service&, const locator::topology&) const override;
virtual bool allow_remove_node_being_replaced_from_natural_endpoints() const override {
return false;
}
[[nodiscard]] sstring sanity_check_read_replicas(const effective_replication_map& erm, const host_id_vector_replica_set& read_replicas) const override;
};
}