|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.zookeeper.ZooKeeperListener
org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker
org.apache.hadoop.hbase.zookeeper.RootRegionTracker
@InterfaceAudience.Private public class RootRegionTracker
Tracks the root region server location node in zookeeper.
Root region location is set by RegionServerServices.
This class has a watcher on the root location and notices changes.
| Field Summary |
|---|
| Fields inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker |
|---|
abortable, node |
| Fields inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperListener |
|---|
watcher |
| Constructor Summary | |
|---|---|
RootRegionTracker(ZooKeeperWatcher watcher,
Abortable abortable)
Creates a root region location tracker. |
|
| Method Summary | |
|---|---|
static ServerName |
blockUntilAvailable(ZooKeeperWatcher zkw,
long timeout)
Wait until the root region is available. |
static void |
deleteRootLocation(ZooKeeperWatcher zookeeper)
Deletes the location of -ROOT- in ZooKeeper. |
ServerName |
getRootRegionLocation()
Gets the root region location, if available. |
static ServerName |
getRootRegionLocation(ZooKeeperWatcher zkw)
Gets the root region location, if available. |
boolean |
isLocationAvailable()
Checks if the root region location is available. |
static void |
setRootLocation(ZooKeeperWatcher zookeeper,
ServerName location)
Sets the location of -ROOT- in ZooKeeper to the
specified server address. |
ServerName |
waitRootRegionLocation(long timeout)
Gets the root region location, if available, and waits for up to the specified timeout if not immediately available. |
| Methods inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker |
|---|
blockUntilAvailable, blockUntilAvailable, checkIfBaseNodeAvailable, getData, getNode, nodeCreated, nodeDataChanged, nodeDeleted, start, stop |
| Methods inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperListener |
|---|
nodeChildrenChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RootRegionTracker(ZooKeeperWatcher watcher,
Abortable abortable)
After construction, use ZooKeeperNodeTracker.start() to kick off tracking.
watcher - abortable - | Method Detail |
|---|
public boolean isLocationAvailable()
public ServerName getRootRegionLocation()
throws InterruptedException
InterruptedException
public static ServerName getRootRegionLocation(ZooKeeperWatcher zkw)
throws org.apache.zookeeper.KeeperException
getRootRegionLocation().
zkw -
org.apache.zookeeper.KeeperException
public ServerName waitRootRegionLocation(long timeout)
throws InterruptedException
timeout - maximum time to wait, in millis
ServerName, or null if none available
InterruptedException - if interrupted while waiting
public static void setRootLocation(ZooKeeperWatcher zookeeper,
ServerName location)
throws org.apache.zookeeper.KeeperException
-ROOT- in ZooKeeper to the
specified server address.
zookeeper - zookeeper referencelocation - The server hosting -ROOT-
org.apache.zookeeper.KeeperException - unexpected zookeeper exception
public static void deleteRootLocation(ZooKeeperWatcher zookeeper)
throws org.apache.zookeeper.KeeperException
-ROOT- in ZooKeeper.
zookeeper - zookeeper reference
org.apache.zookeeper.KeeperException - unexpected zookeeper exception
public static ServerName blockUntilAvailable(ZooKeeperWatcher zkw,
long timeout)
throws InterruptedException
zkw - timeout -
InterruptedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||