topology: rename update_endpoint to add_or_update_endpoint

To reflect what it does,

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
This commit is contained in:
Benny Halevy
2023-03-21 18:15:29 +02:00
parent df1c92649e
commit 006e02410f
4 changed files with 7 additions and 7 deletions

View File

@@ -103,7 +103,7 @@ public:
}
void update_topology(inet_address ep, endpoint_dc_rack dr) {
_topology.update_endpoint(ep, std::move(dr));
_topology.add_or_update_endpoint(ep, std::move(dr));
}
/**

View File

@@ -36,7 +36,7 @@ future<> topology::clear_gently() noexcept {
topology::topology(config cfg)
: _sort_by_proximity(!cfg.disable_proximity_sorting)
{
update_endpoint(utils::fb_utilities::get_broadcast_address(), cfg.local_dc_rack);
add_or_update_endpoint(utils::fb_utilities::get_broadcast_address(), cfg.local_dc_rack);
}
future<topology> topology::clone_gently() const {
@@ -64,7 +64,7 @@ future<topology> topology::clone_gently() const {
co_return ret;
}
void topology::update_endpoint(const inet_address& ep, endpoint_dc_rack dr)
void topology::add_or_update_endpoint(const inet_address& ep, endpoint_dc_rack dr)
{
auto current = _current_locations.find(ep);
@@ -75,7 +75,7 @@ void topology::update_endpoint(const inet_address& ep, endpoint_dc_rack dr)
remove_endpoint(ep);
}
tlogger.debug("update_endpoint: {} {}/{}", ep, dr.dc, dr.rack);
tlogger.debug("add_or_update_endpoint: {} {}/{}", ep, dr.dc, dr.rack);
_dc_endpoints[dr.dc].insert(ep);
_dc_racks[dr.dc][dr.rack].insert(ep);
_datacenters.insert(dr.dc);

View File

@@ -43,7 +43,7 @@ public:
/**
* Stores current DC/rack assignment for ep
*/
void update_endpoint(const inet_address& ep, endpoint_dc_rack dr);
void add_or_update_endpoint(const inet_address& ep, endpoint_dc_rack dr);
/**
* Removes current DC/rack assignment for ep