public static ZooKeeper getConnectedZooKeeper(String connectString, int sessionTimeoutMs)
    throws IOException {
    ZooKeeper zookeeper = new ZooKeeper(connectString, sessionTimeoutMs, e -> {
    });
    return ensureConnectedZooKeeper(zookeeper, sessionTimeoutMs);
  }
Get a ZooKeeper instance and wait until it connected before returning.
@param sessionTimeoutMs Used as session timeout passed to the created ZooKeeper AND as the
                        timeout to wait on connection establishment.
hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperHelper.java