Class ZKClusterId
java.lang.Object
org.apache.hadoop.hbase.zookeeper.ZKClusterId
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()static UUIDGet the UUID for the provided ZK watcher.booleanhasId()static StringreadClusterIdZNode(ZKWatcher watcher) static voidsetClusterId(ZKWatcher watcher, ClusterId id)
-
Field Details
-
watcher
-
abortable
-
id
-
-
Constructor Details
-
ZKClusterId
-
-
Method Details
-
hasId
-
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
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
-