token_metadata: add count_normal_token_owners method
This commit is contained in:
@@ -556,6 +556,14 @@ future<> token_metadata::calculate_pending_ranges(abstract_replication_strategy&
|
||||
|
||||
}
|
||||
|
||||
size_t token_metadata::count_normal_token_owners() const {
|
||||
std::set<inet_address> eps;
|
||||
for (auto [t, ep]: _token_to_endpoint_map) {
|
||||
eps.insert(ep);
|
||||
}
|
||||
return eps.size();
|
||||
}
|
||||
|
||||
sstring token_metadata::print_pending_ranges() {
|
||||
std::stringstream ss;
|
||||
|
||||
|
||||
@@ -679,6 +679,10 @@ public:
|
||||
return _endpoint_to_host_id_map.size();
|
||||
}
|
||||
|
||||
/* Returns the number of different endpoints that own tokens in the ring.
|
||||
* Bootstrapping tokens are not taken into account. */
|
||||
size_t count_normal_token_owners() const;
|
||||
|
||||
#if 0
|
||||
public Set<InetAddress> getAllEndpoints()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user