Skip to content

Commit

Permalink
abstract_replication_strategy: get rid of cached_endpoints
Browse files Browse the repository at this point in the history
Now that do_get_natural_endpoints is gone, the cached
endpoints are no longer in use.

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
  • Loading branch information
bhalevy committed Oct 13, 2021
1 parent 25227ab commit 0e5bb94
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
11 changes: 0 additions & 11 deletions locator/abstract_replication_strategy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,6 @@ void abstract_replication_strategy::validate_replication_factor(sstring rf)
}
}

inline std::unordered_map<token, inet_address_vector_replica_set>&
abstract_replication_strategy::get_cached_endpoints(const token_metadata& tm) {
auto ring_version = tm.get_ring_version();
if (_last_invalidated_ring_version != ring_version) {
_cached_endpoints.clear();
_last_invalidated_ring_version = ring_version;
}

return _cached_endpoints;
}

static
void
insert_token_range_to_sorted_container_while_unwrapping(
Expand Down
9 changes: 0 additions & 9 deletions locator/abstract_replication_strategy.hh
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ using replication_map = std::unordered_map<token, inet_address_vector_replica_se
class effective_replication_map;

class abstract_replication_strategy {
private:
long _last_invalidated_ring_version = 0;
replication_map _cached_endpoints;
uint64_t _cache_hits_count = 0;

replication_map&
get_cached_endpoints(const token_metadata& tm);

friend class effective_replication_map;
protected:
replication_strategy_config_options _config_options;
Expand Down Expand Up @@ -121,7 +113,6 @@ public:
// returns the node itself as the natural_endpoints and the node will not
// appear in the pending_endpoints.
virtual bool allow_remove_node_being_replaced_from_natural_endpoints() const = 0;
uint64_t get_cache_hits_count() const { return _cache_hits_count; }
replication_strategy_type get_type() const { return _my_type; }

// get_ranges() returns the list of ranges held by the given endpoint.
Expand Down

0 comments on commit 0e5bb94

Please sign in to comment.