locator: token_metadata: remove the include_min parameter from ring_range()

`include_min` is always set to the default value. Remove it.
This commit is contained in:
Michał Chojnowski
2021-06-04 15:27:36 +02:00
parent 0acf5bfca6
commit 2a3bd2babe
3 changed files with 13 additions and 17 deletions

View File

@@ -125,10 +125,10 @@ public:
*
* @return The requested range (see the description above)
*/
boost::iterator_range<tokens_iterator> ring_range(const token& start, bool include_min = false) const;
boost::iterator_range<tokens_iterator> ring_range(const token& start) const;
boost::iterator_range<tokens_iterator> ring_range(
const std::optional<dht::partition_range::bound>& start, bool include_min = false) const;
const std::optional<dht::partition_range::bound>& start) const;
topology& get_topology() {
return _topology;
@@ -962,8 +962,8 @@ token_metadata_impl::tokens_end() const {
inline
boost::iterator_range<token_metadata_impl::tokens_iterator>
token_metadata_impl::ring_range(const token& start, bool include_min) const {
auto begin = tokens_iterator(start, this, include_min);
token_metadata_impl::ring_range(const token& start) const {
auto begin = tokens_iterator(start, this);
auto end = tokens_end();
return boost::make_iterator_range(begin, end);
}
@@ -1318,11 +1318,8 @@ void token_metadata_impl::add_bootstrap_token(token t, inet_address endpoint) {
}
boost::iterator_range<token_metadata_impl::tokens_iterator>
token_metadata_impl::ring_range(
const std::optional<dht::partition_range::bound>& start,
bool include_min) const
{
auto r = ring_range(start ? start->value().token() : dht::minimum_token(), include_min);
token_metadata_impl::ring_range(const std::optional<dht::partition_range::bound>& start) const {
auto r = ring_range(start ? start->value().token() : dht::minimum_token());
if (!r.empty()) {
// We should skip the first token if it's excluded by the range.
@@ -1854,17 +1851,16 @@ token_metadata::tokens_end() const {
}
boost::iterator_range<token_metadata::tokens_iterator>
token_metadata::ring_range(const token& start, bool include_min) const {
auto impl_range = _impl->ring_range(start, include_min);
token_metadata::ring_range(const token& start) const {
auto impl_range = _impl->ring_range(start);
return boost::make_iterator_range(
tokens_iterator(std::move(impl_range.begin())),
tokens_iterator(std::move(impl_range.end())));
}
boost::iterator_range<token_metadata::tokens_iterator>
token_metadata::ring_range(
const std::optional<dht::partition_range::bound>& start, bool include_min) const {
auto impl_range = _impl->ring_range(start, include_min);
token_metadata::ring_range(const std::optional<dht::partition_range::bound>& start) const {
auto impl_range = _impl->ring_range(start);
return boost::make_iterator_range(
tokens_iterator(std::move(impl_range.begin())),
tokens_iterator(std::move(impl_range.end())));

View File

@@ -203,9 +203,9 @@ public:
*
* @return The requested range (see the description above)
*/
boost::iterator_range<tokens_iterator> ring_range(const token& start, bool include_min = false) const;
boost::iterator_range<tokens_iterator> ring_range(const token& start) const;
boost::iterator_range<tokens_iterator> ring_range(
const std::optional<dht::partition_range::bound>& start, bool include_min = false) const;
const std::optional<dht::partition_range::bound>& start) const;
topology& get_topology();
const topology& get_topology() const;

View File

@@ -4681,7 +4681,7 @@ void query_ranges_to_vnodes_generator::process_one_range(size_t n, dht::partitio
}
// divide the queryRange into pieces delimited by the ring
auto ring_iter = _tmptr->ring_range(cr.start(), false);
auto ring_iter = _tmptr->ring_range(cr.start());
for (const dht::token& upper_bound_token : ring_iter) {
/*
* remainder can be a range/bounds of token _or_ keys and we want to split it with a token: