@InterfaceAudience.Private public class CatalogTracker extends Object
hbase:meta
.
This class is "read-only" in that the locations of the catalog tables cannot
be explicitly set. Instead, ZooKeeper is used to learn of the availability
and location of hbase:meta
.
Call start()
to start up operation. Call stop()
} to
interrupt waits and close up shop.
Constructor and Description |
---|
CatalogTracker(org.apache.hadoop.conf.Configuration conf)
Constructs a catalog tracker.
|
CatalogTracker(ZooKeeperWatcher zk,
org.apache.hadoop.conf.Configuration conf,
Abortable abortable)
Constructs the catalog tracker.
|
CatalogTracker(ZooKeeperWatcher zk,
org.apache.hadoop.conf.Configuration conf,
HConnection connection,
Abortable abortable) |
Modifier and Type | Method and Description |
---|---|
HConnection |
getConnection() |
ServerName |
getMetaLocation()
Gets the current location for
hbase:meta or null if location is
not currently available. |
RegionState |
getMetaRegionState()
Get meta region state
|
boolean |
isMetaLocationAvailable()
Checks whether meta regionserver znode has some non null data.
|
boolean |
isStopped() |
void |
start()
Starts the catalog tracker.
|
void |
stop()
Stop working.
|
boolean |
verifyMetaRegionLocation(long timeout)
Verify
hbase:meta is deployed and accessible. |
void |
waitForMeta()
Waits indefinitely for availability of
hbase:meta . |
ServerName |
waitForMeta(long timeout)
Gets the current location for
hbase:meta if available and waits
for up to the specified timeout if not immediately available. |
AdminProtos.AdminService.BlockingInterface |
waitForMetaServerConnection(long timeout)
Deprecated.
Use #getMetaServerConnection(long)
|
public CatalogTracker(org.apache.hadoop.conf.Configuration conf) throws IOException
start()
post construction. Does
not timeout.conf
- the Configuration
from which a HConnection
will be
obtained; if problem, this connections
Abortable.abort(String, Throwable)
will be called.IOException
public CatalogTracker(ZooKeeperWatcher zk, org.apache.hadoop.conf.Configuration conf, Abortable abortable) throws IOException
start()
post construction.
Does not timeout.zk
- If zk is null, we'll create an instance (and shut it down
when stop()
is called) else we'll use what is passed.conf
- abortable
- If fatal exception we'll call abort on this. May be null.
If it is we'll use the Connection associated with the passed
Configuration
as our Abortable.IOException
public CatalogTracker(ZooKeeperWatcher zk, org.apache.hadoop.conf.Configuration conf, HConnection connection, Abortable abortable) throws IOException
IOException
public void start() throws IOException, InterruptedException
IOException
InterruptedException
public boolean isStopped()
public void stop()
public ServerName getMetaLocation() throws InterruptedException
hbase:meta
or null if location is
not currently available.ServerName
for server hosting hbase:meta
or null
if none availableInterruptedException
public boolean isMetaLocationAvailable()
public ServerName waitForMeta(long timeout) throws InterruptedException, NotAllMetaRegionsOnlineException
hbase:meta
if available and waits
for up to the specified timeout if not immediately available. Returns null
if the timeout elapses before root is available.timeout
- maximum time to wait for root availability, in millisecondsServerName
for server hosting hbase:meta
or null
if none availableInterruptedException
- if interrupted while waitingNotAllMetaRegionsOnlineException
- if meta not available before
timeoutpublic RegionState getMetaRegionState()
public AdminProtos.AdminService.BlockingInterface waitForMetaServerConnection(long timeout) throws InterruptedException, NotAllMetaRegionsOnlineException, IOException
timeout
- How long to wait on meta locationInterruptedException
NotAllMetaRegionsOnlineException
- if timed out waitingIOException
for additional information
public void waitForMeta() throws InterruptedException
hbase:meta
. Used during
cluster startup. Does not verify meta, just that something has been
set up in zk.InterruptedException
- if interrupted while waitingwaitForMeta(long)
public boolean verifyMetaRegionLocation(long timeout) throws InterruptedException, IOException
hbase:meta
is deployed and accessible.timeout
- How long to wait on zk for meta address (passed through to
the internal call to waitForMetaServerConnection(long)
.hbase:meta
location is healthy.IOException
InterruptedException
public HConnection getConnection()
Copyright © 2015 The Apache Software Foundation. All Rights Reserved.