locator: add function to check if host is local

This commit is contained in:
sylwiaszunejko
2023-09-22 13:01:16 +02:00
parent 93420353f4
commit a0c8531875

View File

@@ -114,6 +114,16 @@ tablet_replica_set replace_replica(const tablet_replica_set& rs, tablet_replica
return result;
}
inline
bool contains(const tablet_replica_set& rs, host_id host) {
for (auto replica : rs) {
if (replica.host == host) {
return true;
}
}
return false;
}
/// Stores information about a single tablet.
struct tablet_info {
tablet_replica_set replicas;