org.apache.hadoop.hbase.zookeeper
Class ZKClusterId
java.lang.Object
org.apache.hadoop.hbase.zookeeper.ZKClusterId
@InterfaceAudience.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).
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZKClusterId
public ZKClusterId(ZooKeeperWatcher watcher,
Abortable abortable)
hasId
public boolean hasId()
getId
public String getId()
readClusterIdZNode
public static String readClusterIdZNode(ZooKeeperWatcher watcher)
throws org.apache.zookeeper.KeeperException
- Throws:
org.apache.zookeeper.KeeperException
setClusterId
public static void setClusterId(ZooKeeperWatcher watcher,
ClusterId id)
throws org.apache.zookeeper.KeeperException
- Throws:
org.apache.zookeeper.KeeperException
getUUIDForCluster
public static UUID getUUIDForCluster(ZooKeeperWatcher 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
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.