mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-05 22:43:15 +00:00
storage_service: add my_host_id
Shorthand for getting this node's host_id from token_metadata.topology, similar to the `get_broadcast_address` helper. Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
This commit is contained in:
@@ -6701,7 +6701,7 @@ future<> storage_service::start_maintenance_mode() {
|
||||
set_mode(mode::MAINTENANCE);
|
||||
|
||||
return mutate_token_metadata([this] (mutable_token_metadata_ptr token_metadata) -> future<> {
|
||||
return token_metadata->update_normal_tokens({ dht::token{} }, get_token_metadata_ptr()->get_topology().my_host_id());
|
||||
return token_metadata->update_normal_tokens({ dht::token{} }, my_host_id());
|
||||
}, acquire_merge_lock::yes);
|
||||
}
|
||||
|
||||
|
||||
@@ -284,6 +284,9 @@ private:
|
||||
inet_address get_broadcast_address() const noexcept {
|
||||
return get_token_metadata_ptr()->get_topology().my_address();
|
||||
}
|
||||
locator::host_id my_host_id() const noexcept {
|
||||
return get_token_metadata_ptr()->get_topology().my_host_id();
|
||||
}
|
||||
bool is_me(inet_address addr) const noexcept {
|
||||
return get_token_metadata_ptr()->get_topology().is_me(addr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user