Class ZKClusterId

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

@Private public class ZKClusterId extends Object
Publishes and synchronizes a unique identifier specific to a given HBase cluster. The stored identifier is read from the file system by the active master on startup, and is subsequently available to all watchers (including clients).
  • Field Details

  • Constructor Details

  • Method Details

    • hasId

      public boolean hasId()
    • getId

      public String getId()
    • readClusterIdZNode

      public static String readClusterIdZNode(ZKWatcher watcher) throws org.apache.zookeeper.KeeperException
      Throws:
      org.apache.zookeeper.KeeperException
    • setClusterId

      public static void setClusterId(ZKWatcher watcher, ClusterId id) throws org.apache.zookeeper.KeeperException
      Throws:
      org.apache.zookeeper.KeeperException
    • getUUIDForCluster

      public static UUID getUUIDForCluster(ZKWatcher zkw) throws org.apache.zookeeper.KeeperException
      Get the UUID for the provided ZK watcher. Doesn't handle any ZK exceptions
      Parameters:
      zkw - watcher connected to an ensemble
      Returns:
      the UUID read from zookeeper
      Throws:
      org.apache.zookeeper.KeeperException - if a ZooKeeper operation fails