|
||||||||||
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.MetaRegionTracker
@InterfaceAudience.Private public class MetaRegionTracker
Tracks the meta region server location node in zookeeper.
Meta region location is set by RegionServerServices
.
This class has a watcher on the meta 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 | |
---|---|
MetaRegionTracker(ZooKeeperWatcher watcher,
Abortable abortable)
Creates a meta region location tracker. |
Method Summary | |
---|---|
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. |
RegionState |
getMetaRegionState()
Get meta region state |
boolean |
isLocationAvailable()
Checks if the meta region location is available. |
static void |
setMetaLocation(ZooKeeperWatcher zookeeper,
ServerName location,
RegionState.State regionState)
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. |
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 |
---|
getWatcher, nodeChildrenChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetaRegionTracker(ZooKeeperWatcher watcher, Abortable abortable)
After construction, use ZooKeeperNodeTracker.start()
to kick off tracking.
watcher
- abortable
- Method Detail |
---|
public boolean isLocationAvailable()
public ServerName getMetaRegionLocation()
InterruptedException
public static ServerName getMetaRegionLocation(ZooKeeperWatcher zkw) throws org.apache.zookeeper.KeeperException
getMetaRegionLocation()
.
zkw
-
org.apache.zookeeper.KeeperException
public ServerName waitMetaRegionLocation(long timeout) throws InterruptedException
timeout
- maximum time to wait, in millis
ServerName
, or null if none available
InterruptedException
- if interrupted while waitingpublic static void setMetaLocation(ZooKeeperWatcher zookeeper, ServerName location, RegionState.State regionState) throws org.apache.zookeeper.KeeperException
hbase:meta
in ZooKeeper to the
specified server address.
zookeeper
- zookeeper referencelocation
- The server hosting hbase:meta
org.apache.zookeeper.KeeperException
- unexpected zookeeper exceptionpublic static void deleteMetaLocation(ZooKeeperWatcher zookeeper) throws org.apache.zookeeper.KeeperException
hbase:meta
in ZooKeeper.
zookeeper
- zookeeper reference
org.apache.zookeeper.KeeperException
- unexpected zookeeper exceptionpublic static ServerName blockUntilAvailable(ZooKeeperWatcher zkw, long timeout) throws InterruptedException
zkw
- timeout
-
InterruptedException
public RegionState getMetaRegionState()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |