service: topology_state_machine: make topology::find const

This commit is contained in:
Kamil Braun
2023-04-20 16:15:40 +02:00
parent 22094f1509
commit 4e7628fa16
2 changed files with 2 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ namespace service {
logging::logger tsmlogger("topology_state_machine");
const std::pair<const raft::server_id, replica_state>* topology::find(raft::server_id id) {
const std::pair<const raft::server_id, replica_state>* topology::find(raft::server_id id) const {
auto it = normal_nodes.find(id);
if (it != normal_nodes.end()) {
return &*it;

View File

@@ -86,7 +86,7 @@ struct topology {
std::unordered_map<raft::server_id, request_param> req_param;
// Find only nodes in non 'left' state
const std::pair<const raft::server_id, replica_state>* find(raft::server_id id);
const std::pair<const raft::server_id, replica_state>* find(raft::server_id id) const;
// Return true if node exists in any state including 'left' one
bool contains(raft::server_id id);
};