diff --git a/service/storage_proxy.cc b/service/storage_proxy.cc index 9408d3f52b..eefe83d33c 100644 --- a/service/storage_proxy.cc +++ b/service/storage_proxy.cc @@ -2275,6 +2275,12 @@ float storage_proxy::estimate_result_rows_per_range(lw_shared_ptr storage_proxy::get_restricted_ranges(keyspace& ks, const schema& s, query::partition_range range) { + locator::token_metadata& tm = get_local_storage_service().get_token_metadata(); + return service::get_restricted_ranges(tm, s, std::move(range)); +} + +std::vector +get_restricted_ranges(locator::token_metadata& tm, const schema& s, query::partition_range range) { dht::ring_position_comparator cmp(s); // special case for bounds containing exactly 1 token @@ -2285,8 +2291,6 @@ storage_proxy::get_restricted_ranges(keyspace& ks, const schema& s, query::parti return std::vector({std::move(range)}); } - locator::token_metadata& tm = get_local_storage_service().get_token_metadata(); - std::vector ranges; auto add_range = [&ranges, &cmp] (query::partition_range&& r) { diff --git a/service/storage_proxy.hh b/service/storage_proxy.hh index f099d7d7f6..994afc56d9 100644 --- a/service/storage_proxy.hh +++ b/service/storage_proxy.hh @@ -241,4 +241,7 @@ inline shared_ptr get_local_shared_storage_proxy() { return _the_storage_proxy.local_shared(); } +std::vector get_restricted_ranges(locator::token_metadata&, + const schema&, query::partition_range); + }