@InterfaceAudience.Private public class MetaRegionTracker extends ZooKeeperNodeTracker
RegionServerServices.
This class has a watcher on the meta location and notices changes.abortable, nodewatcher| Constructor and Description |
|---|
MetaRegionTracker(ZooKeeperWatcher watcher,
Abortable abortable)
Creates a meta region location tracker.
|
| Modifier and Type | Method and Description |
|---|---|
static ServerName |
blockUntilAvailable(ZooKeeperWatcher zkw,
long timeout)
Wait until the meta region is available.
|
static void |
deleteMetaLocation(ZooKeeperWatcher zookeeper)
Deletes the location of
hbase:meta in ZooKeeper. |
ServerName |
getMetaRegionLocation()
Gets the meta region location, if available.
|
static ServerName |
getMetaRegionLocation(ZooKeeperWatcher zkw)
Gets the meta region location, if available.
|
boolean |
isLocationAvailable()
Checks if the meta region location is available.
|
static void |
setMetaLocation(ZooKeeperWatcher zookeeper,
ServerName location)
Sets the location of
hbase:meta in ZooKeeper to the
specified server address. |
ServerName |
waitMetaRegionLocation(long timeout)
Gets the meta region location, if available, and waits for up to the
specified timeout if not immediately available.
|
blockUntilAvailable, blockUntilAvailable, checkIfBaseNodeAvailable, getData, getNode, nodeCreated, nodeDataChanged, nodeDeleted, start, stopgetWatcher, nodeChildrenChangedpublic MetaRegionTracker(ZooKeeperWatcher watcher, Abortable abortable)
After construction, use ZooKeeperNodeTracker.start() to kick off tracking.
watcher - abortable - public boolean isLocationAvailable()
public ServerName getMetaRegionLocation() throws InterruptedException
InterruptedExceptionpublic static ServerName getMetaRegionLocation(ZooKeeperWatcher zkw) throws org.apache.zookeeper.KeeperException
getMetaRegionLocation().zkw - org.apache.zookeeper.KeeperExceptionpublic ServerName waitMetaRegionLocation(long timeout) throws InterruptedException
timeout - maximum time to wait, in millisServerName, or null if none availableInterruptedException - if interrupted while waitingpublic static void setMetaLocation(ZooKeeperWatcher zookeeper, ServerName location) throws org.apache.zookeeper.KeeperException
hbase:meta in ZooKeeper to the
specified server address.zookeeper - zookeeper referencelocation - The server hosting hbase:metaorg.apache.zookeeper.KeeperException - unexpected zookeeper exceptionpublic static void deleteMetaLocation(ZooKeeperWatcher zookeeper) throws org.apache.zookeeper.KeeperException
hbase:meta in ZooKeeper.zookeeper - zookeeper referenceorg.apache.zookeeper.KeeperException - unexpected zookeeper exceptionpublic static ServerName blockUntilAvailable(ZooKeeperWatcher zkw, long timeout) throws InterruptedException
zkw - timeout - InterruptedExceptionCopyright © 2014 The Apache Software Foundation. All rights reserved.