diff --git a/locator/abstract_replication_strategy.hh b/locator/abstract_replication_strategy.hh index d2eb45d6a5..fdabc8e69c 100644 --- a/locator/abstract_replication_strategy.hh +++ b/locator/abstract_replication_strategy.hh @@ -78,6 +78,10 @@ public: const replication_strategy_config_options& config_options, replication_strategy_type my_type); + // Evaluates to true iff calculate_natural_endpoints + // returns different results for different tokens. + virtual bool natural_endpoints_depend_on_token() const noexcept { return true; } + // The returned vector has size O(number of normal token owners), which is O(number of nodes in the cluster). // Note: it is not guaranteed that the function will actually yield. If the complexity of a particular implementation // is small, that implementation may not yield since by itself it won't cause a reactor stall (assuming practical diff --git a/locator/everywhere_replication_strategy.hh b/locator/everywhere_replication_strategy.hh index cd80502071..d385453793 100644 --- a/locator/everywhere_replication_strategy.hh +++ b/locator/everywhere_replication_strategy.hh @@ -18,6 +18,8 @@ class everywhere_replication_strategy : public abstract_replication_strategy { public: everywhere_replication_strategy(const replication_strategy_config_options& config_options); + virtual bool natural_endpoints_depend_on_token() const noexcept override { return false; } + virtual future calculate_natural_endpoints(const token& search_token, const token_metadata& tm) const override; virtual void validate_options() const override { /* noop */ } diff --git a/locator/local_strategy.hh b/locator/local_strategy.hh index 6f1bbb2654..5edfe4f024 100644 --- a/locator/local_strategy.hh +++ b/locator/local_strategy.hh @@ -27,6 +27,8 @@ public: virtual ~local_strategy() {}; virtual size_t get_replication_factor(const token_metadata&) const override; + virtual bool natural_endpoints_depend_on_token() const noexcept override { return false; } + virtual future calculate_natural_endpoints(const token& search_token, const token_metadata& tm) const override; virtual void validate_options() const override;