mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-29 12:47:02 +00:00
Currently, effective_replication_map::do_get_ranges accepts a functor that traverses the natural endpoints of each token to decide whether a token range should be returned or not. This is done by copying the natural endpoints vector for each token. However, other than special strategies like everywhere and local, the functor can be called on the precalculated inet_address_vector_replica_set in the replication_map and there's no need to copy it for each call. for_each_natural_endpoint_until passes a reference to the function down to the abstract replication strategy to let it work either on the precalculated inet_address_vector_replica_set or on a ad-hoc vector prepared by the replication strategy. The function returns stop_iteration::yes when a match or mismatch are found, or stop_iteration::no while it has no definite result. Signed-off-by: Benny Halevy <bhalevy@scylladb.com> Closes #12737