mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-02 22:25:48 +00:00
Instead of lengthy blurbs, switch to single-line, machine-readable standardized (https://spdx.dev) license identifiers. The Linux kernel switched long ago, so there is strong precedent. Three cases are handled: AGPL-only, Apache-only, and dual licensed. For the latter case, I chose (AGPL-3.0-or-later and Apache-2.0), reasoning that our changes are extensive enough to apply our license. The changes we applied mechanically with a script, except to licenses/README.md. Closes #9937
35 lines
976 B
C++
35 lines
976 B
C++
/*
|
|
* Copyright (C) 2015-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "abstract_replication_strategy.hh"
|
|
|
|
#include <optional>
|
|
#include <set>
|
|
|
|
namespace locator {
|
|
|
|
class simple_strategy : public abstract_replication_strategy {
|
|
public:
|
|
simple_strategy(snitch_ptr& snitch, const replication_strategy_config_options& config_options);
|
|
virtual ~simple_strategy() {};
|
|
virtual size_t get_replication_factor(const token_metadata& tm) const override;
|
|
virtual void validate_options() const override;
|
|
virtual std::optional<std::set<sstring>> recognized_options(const topology&) const override;
|
|
virtual bool allow_remove_node_being_replaced_from_natural_endpoints() const override {
|
|
return true;
|
|
}
|
|
|
|
virtual future<inet_address_vector_replica_set> calculate_natural_endpoints(const token& search_token, const token_metadata& tm) const override;
|
|
private:
|
|
size_t _replication_factor = 1;
|
|
};
|
|
|
|
}
|