public class RootRegionTracker extends ZooKeeperNodeTracker
RootLocationEditor
usually called
out of RegionServerServices
.
This class has a watcher on the root location and notices changes.abortable, node
watcher
Constructor and Description |
---|
RootRegionTracker(ZooKeeperWatcher watcher,
Abortable abortable)
Creates a root region location tracker.
|
Modifier and Type | Method and Description |
---|---|
ServerName |
getRootRegionLocation()
Gets the root region location, if available.
|
boolean |
isLocationAvailable()
Checks if the root region location is available.
|
ServerName |
waitRootRegionLocation(long timeout)
Gets the root 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, stop
nodeChildrenChanged
public RootRegionTracker(ZooKeeperWatcher watcher, Abortable abortable)
After construction, use ZooKeeperNodeTracker.start()
to kick off tracking.
watcher
- abortable
- public boolean isLocationAvailable()
public ServerName getRootRegionLocation() throws InterruptedException
InterruptedException
public ServerName waitRootRegionLocation(long timeout) throws InterruptedException
timeout
- maximum time to wait, in millisServerName
, or null if none availableInterruptedException
- if interrupted while waitingCopyright © 2014 The Apache Software Foundation. All Rights Reserved.