}
private Cluster findCluster(String serviceName, int tenantId) {
try {
TopologyManager.acquireReadLock();
Service service = TopologyManager.getTopology().getService(serviceName);
if (service == null) {
throw new RuntimeException(String.format("Service not found: %s", serviceName));
}
for (Cluster cluster : service.getClusters()) {
if (cluster.tenantIdInRange(tenantId)) {
return cluster;
}
}
return null;