locator: add function to check if host is local
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user