mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-13 03:12:13 +00:00
locator::token_metadata: added topology::update_endpoint(ep) and update_topology(ep)
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
This commit is contained in:
@@ -502,6 +502,14 @@ void topology::add_endpoint(const inet_address& ep)
|
||||
_current_locations[ep] = {dc, rack};
|
||||
}
|
||||
|
||||
void topology::update_endpoint(inet_address ep) {
|
||||
if (!_current_locations.count(ep) || !locator::i_endpoint_snitch::snitch_instance().local_is_initialized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
add_endpoint(ep);
|
||||
}
|
||||
|
||||
void topology::remove_endpoint(inet_address ep)
|
||||
{
|
||||
auto cur_dc_rack = _current_locations.find(ep);
|
||||
|
||||
@@ -82,6 +82,12 @@ public:
|
||||
*/
|
||||
void remove_endpoint(inet_address ep);
|
||||
|
||||
/**
|
||||
* Re-reads the DC/rack info for the given endpoint
|
||||
* @param ep endpoint in question
|
||||
*/
|
||||
void update_endpoint(inet_address ep);
|
||||
|
||||
std::unordered_map<sstring,
|
||||
std::unordered_set<inet_address>>&
|
||||
get_datacenter_endpoints() {
|
||||
@@ -239,6 +245,10 @@ public:
|
||||
return _bootstrap_tokens;
|
||||
}
|
||||
|
||||
void update_topology(inet_address ep) {
|
||||
_topology.update_endpoint(ep);
|
||||
}
|
||||
|
||||
tokens_iterator tokens_end() const {
|
||||
return tokens_iterator(sorted_tokens().end(), sorted_tokens().size());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user