Class ZooKeeperHelper

java.lang.Object
org.apache.hadoop.hbase.zookeeper.ZooKeeperHelper

@Private public final class ZooKeeperHelper extends Object
Methods that help working with ZooKeeper
  • Constructor Details

  • Method Details

    • getConnectedZooKeeper

      public static org.apache.zookeeper.ZooKeeper getConnectedZooKeeper(String connectString, int sessionTimeoutMs) throws IOException
      Get a ZooKeeper instance and wait until it connected before returning.
      Parameters:
      sessionTimeoutMs - Used as session timeout passed to the created ZooKeeper AND as the timeout to wait on connection establishment.
      Throws:
      IOException
    • ensureConnectedZooKeeper

      public static org.apache.zookeeper.ZooKeeper ensureConnectedZooKeeper(org.apache.zookeeper.ZooKeeper zookeeper, int timeout) throws ZooKeeperConnectionException
      Ensure passed zookeeper is connected.
      Parameters:
      timeout - Time to wait on established Connection
      Throws:
      ZooKeeperConnectionException