ZooKeeperClientCacheItem cachedItem = cache.getIfPresent(ensemble);
if (cachedItem != null) {
return cachedItem.client;
}
CuratorFramework client = CuratorFrameworkFactory.newClient(ensemble,
DynamicPropertyFactory.getInstance().getIntProperty("zookeeper.session.timeout", Integer.MIN_VALUE).get(),
DynamicPropertyFactory.getInstance().getIntProperty("zookeeper.connection.timeout", Integer.MIN_VALUE).get(),
new ExponentialBackoffRetry(1000, 3));
client.start();
cache.put(ensemble, new ZooKeeperClientCacheItem(ensemble, client));
logger.info("Created, started, and cached zk client [{}] for ensemble [{}]", client, ensemble);