use of com.palantir.atlasdb.keyvalue.cassandra.CassandraClient in project atlasdb by palantir.
the class HostnamesByIpSupplier method get.
@Override
public Map<String, String> get() {
List<PoolingContainer<CassandraClient>> containers = hosts.get();
Stopwatch timer = Stopwatch.createStarted();
for (PoolingContainer<CassandraClient> container : containers) {
try {
return container.runWithPooledResource(getHostnamesByIp());
} catch (Exception | Error e) {
log.warn("Could not get hostnames by IP from Cassandra", SafeArg.of("poolSize", containers.size()), SafeArg.of("elapsed", timer.elapsed()), e);
}
if (timer.elapsed().compareTo(timeout) >= 0) {
log.warn("Could not find hostnames by IP mapping for pool within timeout", SafeArg.of("poolSize", containers.size()), SafeArg.of("elapsed", timer.elapsed()));
return ImmutableMap.of();
}
}
log.warn("Could not find hostnames by IP mapping for pool", SafeArg.of("poolSize", containers.size()), SafeArg.of("elapsed", timer.elapsed()));
return ImmutableMap.of();
}
Aggregations