ZooKeeper zooKeeper = new ZooKeeper(zkConnect, zkSessionTimeoutMs,
connectionWatcher);
// Use twice session timeout as the connection timeout
int zkConnectTimeoutMs = zkSessionTimeoutMs * 2;
if (!connectionWatcher.await(zkConnectTimeoutMs)) {
throw new IOException("Timed out waiting to connect to " + zkConnect
+ " after " + (zkSessionTimeoutMs * 2) + " ms.");
}
prepareBookKeeperEnv(ledgersAvailablePath, zooKeeper);