@InterfaceAudience.Private public final class MetaTableLocator extends Object
RegionServerServices. This class doesn't use ZK
watchers, rather accesses ZK directly.
TODO: rewrite using RPC calls to master to find out about hbase:meta.| Modifier and Type | Method and Description |
|---|---|
static org.apache.hadoop.hbase.ServerName |
blockUntilAvailable(ZKWatcher zkw,
int replicaId,
long timeout)
Wait until the meta region is available and is not in transition.
|
static org.apache.hadoop.hbase.ServerName |
blockUntilAvailable(ZKWatcher zkw,
long timeout)
Wait until the meta region is available and is not in transition.
|
static List<org.apache.hadoop.hbase.ServerName> |
blockUntilAvailable(ZKWatcher zkw,
long timeout,
org.apache.hadoop.conf.Configuration conf)
Wait until the primary meta region is available.
|
static void |
deleteMetaLocation(ZKWatcher zookeeper)
Deletes the location of
hbase:meta in ZooKeeper. |
static void |
deleteMetaLocation(ZKWatcher zookeeper,
int replicaId) |
static org.apache.hadoop.hbase.ServerName |
getMetaRegionLocation(ZKWatcher zkw)
Gets the meta region location, if available.
|
static org.apache.hadoop.hbase.ServerName |
getMetaRegionLocation(ZKWatcher zkw,
int replicaId)
Gets the meta region location, if available.
|
static List<org.apache.hadoop.hbase.client.RegionInfo> |
getMetaRegions(ZKWatcher zkw)
Gets the meta regions for the given path with the default replica ID.
|
static List<org.apache.hadoop.hbase.client.RegionInfo> |
getMetaRegions(ZKWatcher zkw,
int replicaId)
Gets the meta regions for the given path and replica ID.
|
static List<org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.hbase.client.RegionInfo,org.apache.hadoop.hbase.ServerName>> |
getMetaRegionsAndLocations(ZKWatcher zkw) |
static List<org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.hbase.client.RegionInfo,org.apache.hadoop.hbase.ServerName>> |
getMetaRegionsAndLocations(ZKWatcher zkw,
int replicaId)
Gets the meta regions and their locations for the given path and replica ID.
|
static org.apache.hadoop.hbase.master.RegionState |
getMetaRegionState(ZKWatcher zkw)
Load the meta region state from the meta server ZNode.
|
static org.apache.hadoop.hbase.master.RegionState |
getMetaRegionState(ZKWatcher zkw,
int replicaId)
Load the meta region state from the meta server ZNode.
|
static boolean |
isLocationAvailable(ZKWatcher zkw)
Checks if the meta region location is available.
|
static void |
setMetaLocation(ZKWatcher zookeeper,
org.apache.hadoop.hbase.ServerName serverName,
int replicaId,
org.apache.hadoop.hbase.master.RegionState.State state)
Sets the location of
hbase:meta in ZooKeeper to the specified server address. |
static void |
setMetaLocation(ZKWatcher zookeeper,
org.apache.hadoop.hbase.ServerName serverName,
org.apache.hadoop.hbase.master.RegionState.State state)
Sets the location of
hbase:meta in ZooKeeper to the
specified server address. |
static org.apache.hadoop.hbase.ServerName |
waitMetaRegionLocation(ZKWatcher zkw,
int replicaId,
long timeout)
Gets the meta region location, if available, and waits for up to the specified timeout if not
immediately available.
|
static org.apache.hadoop.hbase.ServerName |
waitMetaRegionLocation(ZKWatcher zkw,
long timeout)
Gets the meta region location, if available, and waits for up to the specified timeout if not
immediately available.
|
public static boolean isLocationAvailable(ZKWatcher zkw)
public static List<org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.hbase.client.RegionInfo,org.apache.hadoop.hbase.ServerName>> getMetaRegionsAndLocations(ZKWatcher zkw)
zkw - ZooKeeper watcher to be usedpublic static List<org.apache.hadoop.hbase.util.Pair<org.apache.hadoop.hbase.client.RegionInfo,org.apache.hadoop.hbase.ServerName>> getMetaRegionsAndLocations(ZKWatcher zkw, int replicaId)
zkw - reference to the ZKWatcher which also contains configuration and operationreplicaId - the ID of the replicapublic static List<org.apache.hadoop.hbase.client.RegionInfo> getMetaRegions(ZKWatcher zkw)
zkw - ZooKeeper watcher to be usedpublic static List<org.apache.hadoop.hbase.client.RegionInfo> getMetaRegions(ZKWatcher zkw, int replicaId)
zkw - reference to the ZKWatcher which also contains configuration and operationreplicaId - the ID of the replicapublic static org.apache.hadoop.hbase.ServerName getMetaRegionLocation(ZKWatcher zkw)
zkw - zookeeper connection to usepublic static org.apache.hadoop.hbase.ServerName getMetaRegionLocation(ZKWatcher zkw, int replicaId)
zkw - reference to the ZKWatcher which also contains configuration and operationreplicaId - the ID of the replicapublic static org.apache.hadoop.hbase.ServerName waitMetaRegionLocation(ZKWatcher zkw, long timeout) throws InterruptedException, org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException
zkw - reference to the ZKWatcher which also contains configuration and operationtimeout - maximum time to wait, in millisServerName, or null
if none availableInterruptedException - if interrupted while waitingorg.apache.hadoop.hbase.NotAllMetaRegionsOnlineException - if a meta or root region is not onlinepublic static org.apache.hadoop.hbase.ServerName waitMetaRegionLocation(ZKWatcher zkw, int replicaId, long timeout) throws InterruptedException, org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException
zkw - reference to the ZKWatcher which also contains configuration and operationreplicaId - the ID of the replicatimeout - maximum time to wait, in millisServerName, or null
if none availableInterruptedException - if waiting for the socket operation failsorg.apache.hadoop.hbase.NotAllMetaRegionsOnlineException - if a meta or root region is not onlinepublic static void setMetaLocation(ZKWatcher zookeeper, org.apache.hadoop.hbase.ServerName serverName, org.apache.hadoop.hbase.master.RegionState.State state) throws org.apache.zookeeper.KeeperException
hbase:meta in ZooKeeper to the
specified server address.zookeeper - zookeeper referenceserverName - The server hosting hbase:metastate - The region transition stateorg.apache.zookeeper.KeeperException - unexpected zookeeper exceptionpublic static void setMetaLocation(ZKWatcher zookeeper, org.apache.hadoop.hbase.ServerName serverName, int replicaId, org.apache.hadoop.hbase.master.RegionState.State state) throws org.apache.zookeeper.KeeperException
hbase:meta in ZooKeeper to the specified server address.zookeeper - reference to the ZKWatcher which also contains configuration and
operationserverName - the name of the serverreplicaId - the ID of the replicastate - the state of the regionorg.apache.zookeeper.KeeperException - if a ZooKeeper operation failspublic static org.apache.hadoop.hbase.master.RegionState getMetaRegionState(ZKWatcher zkw) throws org.apache.zookeeper.KeeperException
org.apache.zookeeper.KeeperExceptionpublic static org.apache.hadoop.hbase.master.RegionState getMetaRegionState(ZKWatcher zkw, int replicaId) throws org.apache.zookeeper.KeeperException
zkw - reference to the ZKWatcher which also contains configuration and operationreplicaId - the ID of the replicaorg.apache.zookeeper.KeeperException - if a ZooKeeper operation failspublic static void deleteMetaLocation(ZKWatcher zookeeper) throws org.apache.zookeeper.KeeperException
hbase:meta in ZooKeeper.zookeeper - zookeeper referenceorg.apache.zookeeper.KeeperException - unexpected zookeeper exceptionpublic static void deleteMetaLocation(ZKWatcher zookeeper, int replicaId) throws org.apache.zookeeper.KeeperException
org.apache.zookeeper.KeeperExceptionpublic static List<org.apache.hadoop.hbase.ServerName> blockUntilAvailable(ZKWatcher zkw, long timeout, org.apache.hadoop.conf.Configuration conf) throws InterruptedException
zkw - reference to the ZKWatcher which also contains configuration and operationtimeout - maximum time to wait in millisconf - the Configuration to useInterruptedException - if waiting for the socket operation failspublic static org.apache.hadoop.hbase.ServerName blockUntilAvailable(ZKWatcher zkw, long timeout) throws InterruptedException
zkw - zookeeper connection to usetimeout - maximum time to wait, in millisInterruptedException - if waiting for the socket operation failspublic static org.apache.hadoop.hbase.ServerName blockUntilAvailable(ZKWatcher zkw, int replicaId, long timeout) throws InterruptedException
zkw - reference to the ZKWatcher which also contains configuration and constantsreplicaId - the ID of the replicatimeout - maximum time to wait in millisInterruptedException - if waiting for the socket operation failsCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.