@InterfaceAudience.Private public class DistributedHBaseCluster extends HBaseCluster
conf, initialClusterStatus| Constructor and Description |
|---|
DistributedHBaseCluster(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.ClusterManager clusterManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes all the resources held open for this cluster.
|
org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface |
getAdminProtocol(ServerName serverName)
Returns an AdminProtocol interface to the regionserver
|
org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface |
getClientProtocol(ServerName serverName)
Returns a ClientProtocol interface to the regionserver
|
org.apache.hadoop.hbase.ClusterManager |
getClusterManager() |
ClusterMetrics |
getClusterMetrics()
Returns a ClusterStatus for this HBase cluster
|
ClusterMetrics |
getInitialClusterMetrics()
Returns a ClusterStatus for this HBase cluster as observed at the
starting of the HBaseCluster
|
org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterService.BlockingInterface |
getMasterAdminService()
Returns an
MasterService.BlockingInterface to the active master |
ServerName |
getServerHoldingRegion(TableName tn,
byte[] regionName)
Get the ServerName of region server serving the specified region
|
boolean |
isDistributedCluster() |
boolean |
isKilledRS(ServerName serverName)
Keeping track of killed servers and being able to check if a particular server was killed makes
it possible to do fault tolerance testing for dead servers in a deterministic way.
|
void |
killDataNode(ServerName serverName)
Kills the datanode process if this is a distributed cluster, otherwise,
this causes master to exit doing basic clean up only.
|
void |
killMaster(ServerName serverName)
Kills the master process if this is a distributed cluster, otherwise,
this causes master to exit doing basic clean up only.
|
void |
killRegionServer(ServerName serverName)
Kills the region server process if this is a distributed cluster, otherwise
this causes the region server to exit doing basic clean up only.
|
void |
killZkNode(ServerName serverName)
Kills the zookeeper node process if this is a distributed cluster, otherwise,
this causes master to exit doing basic clean up only.
|
protected boolean |
restoreAdmin() |
boolean |
restoreClusterMetrics(ClusterMetrics initial)
Restores the cluster to given state if this is a real cluster,
otherwise does nothing.
|
protected boolean |
restoreMasters(ClusterMetrics initial,
ClusterMetrics current) |
protected boolean |
restoreRegionServers(ClusterMetrics initial,
ClusterMetrics current) |
void |
setClusterManager(org.apache.hadoop.hbase.ClusterManager clusterManager) |
void |
shutdown()
Shut down the HBase cluster
|
void |
startDataNode(ServerName serverName)
Starts a new datanode on the given hostname or if this is a mini/local cluster,
silently logs warning message.
|
void |
startMaster(String hostname,
int port)
Starts a new master on the given hostname or if this is a mini/local cluster,
starts a master locally.
|
void |
startRegionServer(String hostname,
int port)
Starts a new region server on the given hostname or if this is a mini/local cluster,
starts a region server locally.
|
void |
startZkNode(String hostname,
int port)
Starts a new zookeeper node on the given hostname or if this is a mini/local cluster,
silently logs warning message.
|
void |
stopDataNode(ServerName serverName)
Stops the datanode if this is a distributed cluster, otherwise
silently logs warning message.
|
void |
stopMaster(ServerName serverName)
Stops the given master, by attempting a gradual stop.
|
void |
stopRegionServer(ServerName serverName)
Stops the given region server, by attempting a gradual stop.
|
void |
stopZkNode(ServerName serverName)
Stops the region zookeeper if this is a distributed cluster, otherwise
silently logs warning message.
|
boolean |
waitForActiveAndReadyMaster(long timeout)
Blocks until there is an active master and that master has completed
initialization.
|
void |
waitForDataNodeToStart(ServerName serverName,
long timeout)
Wait for the specified datanode to join the cluster
|
void |
waitForDataNodeToStop(ServerName serverName,
long timeout)
Wait for the specified datanode to stop the thread / process.
|
void |
waitForMasterToStop(ServerName serverName,
long timeout)
Wait for the specified master to stop the thread / process.
|
void |
waitForRegionServerToStop(ServerName serverName,
long timeout)
Wait for the specified region server to stop the thread / process.
|
void |
waitForZkNodeToStart(ServerName serverName,
long timeout)
Wait for the specified zookeeper node to join the cluster
|
void |
waitForZkNodeToStop(ServerName serverName,
long timeout)
Wait for the specified zookeeper node to stop the thread / process.
|
void |
waitUntilShutDown()
Wait for HBase Cluster to shut down.
|
getConf, getServerHoldingMeta, restoreInitialStatus, setConf, waitForActiveAndReadyMaster, waitForDatanodesRegistered, waitForNamenodeAvailable, waitForRegionServerToStartpublic DistributedHBaseCluster(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.ClusterManager clusterManager) throws IOException
IOExceptionpublic void setClusterManager(org.apache.hadoop.hbase.ClusterManager clusterManager)
public org.apache.hadoop.hbase.ClusterManager getClusterManager()
public ClusterMetrics getClusterMetrics() throws IOException
getClusterMetrics in class HBaseClusterIOExceptionHBaseCluster.getInitialClusterMetrics()public ClusterMetrics getInitialClusterMetrics() throws IOException
HBaseClustergetInitialClusterMetrics in class HBaseClusterIOExceptionpublic void close() throws IOException
HBaseClusterclose in interface Closeableclose in interface AutoCloseableclose in class HBaseClusterIOExceptionHBaseCluster.shutdown()public org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface getAdminProtocol(ServerName serverName) throws IOException
HBaseClustergetAdminProtocol in class HBaseClusterIOExceptionpublic org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface getClientProtocol(ServerName serverName) throws IOException
HBaseClustergetClientProtocol in class HBaseClusterIOExceptionpublic void startRegionServer(String hostname, int port) throws IOException
HBaseClusterstartRegionServer in class HBaseClusterhostname - the hostname to start the regionserver onIOException - if something goes wrongpublic void killRegionServer(ServerName serverName) throws IOException
HBaseClusterkillRegionServer in class HBaseClusterIOException - if something goes wrongpublic boolean isKilledRS(ServerName serverName)
HBaseClusterisKilledRS in class HBaseClusterpublic void stopRegionServer(ServerName serverName) throws IOException
HBaseClusterstopRegionServer in class HBaseClusterIOException - if something goes wrongpublic void waitForRegionServerToStop(ServerName serverName, long timeout) throws IOException
HBaseClusterwaitForRegionServerToStop in class HBaseClusterIOException - if something goes wrong or timeout occurspublic void startZkNode(String hostname, int port) throws IOException
HBaseClusterstartZkNode in class HBaseClusterhostname - the hostname to start the regionserver onIOException - if something goes wrongpublic void killZkNode(ServerName serverName) throws IOException
HBaseClusterkillZkNode in class HBaseClusterIOException - if something goes wrongpublic void stopZkNode(ServerName serverName) throws IOException
HBaseClusterstopZkNode in class HBaseClusterIOException - if something goes wrongpublic void waitForZkNodeToStart(ServerName serverName, long timeout) throws IOException
HBaseClusterwaitForZkNodeToStart in class HBaseClusterIOException - if something goes wrong or timeout occurspublic void waitForZkNodeToStop(ServerName serverName, long timeout) throws IOException
HBaseClusterwaitForZkNodeToStop in class HBaseClusterIOException - if something goes wrong or timeout occurspublic void startDataNode(ServerName serverName) throws IOException
HBaseClusterstartDataNode in class HBaseClusterIOException - if something goes wrongpublic void killDataNode(ServerName serverName) throws IOException
HBaseClusterkillDataNode in class HBaseClusterIOException - if something goes wrongpublic void stopDataNode(ServerName serverName) throws IOException
HBaseClusterstopDataNode in class HBaseClusterIOException - if something goes wrongpublic void waitForDataNodeToStart(ServerName serverName, long timeout) throws IOException
HBaseClusterwaitForDataNodeToStart in class HBaseClusterIOException - if something goes wrong or timeout occurspublic void waitForDataNodeToStop(ServerName serverName, long timeout) throws IOException
HBaseClusterwaitForDataNodeToStop in class HBaseClusterIOException - if something goes wrong or timeout occurspublic org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterService.BlockingInterface getMasterAdminService() throws IOException
HBaseClusterMasterService.BlockingInterface to the active mastergetMasterAdminService in class HBaseClusterIOExceptionpublic void startMaster(String hostname, int port) throws IOException
HBaseClusterstartMaster in class HBaseClusterhostname - the hostname to start the master onIOException - if something goes wrongpublic void killMaster(ServerName serverName) throws IOException
HBaseClusterkillMaster in class HBaseClusterIOException - if something goes wrongpublic void stopMaster(ServerName serverName) throws IOException
HBaseClusterstopMaster in class HBaseClusterIOException - if something goes wrongpublic void waitForMasterToStop(ServerName serverName, long timeout) throws IOException
HBaseClusterwaitForMasterToStop in class HBaseClusterIOException - if something goes wrong or timeout occurspublic boolean waitForActiveAndReadyMaster(long timeout) throws IOException
HBaseClusterwaitForActiveAndReadyMaster in class HBaseClustertimeout - the timeout limit in msIOExceptionpublic ServerName getServerHoldingRegion(TableName tn, byte[] regionName) throws IOException
HBaseClustergetServerHoldingRegion in class HBaseClustertn - Table name that has the region.regionName - Name of the region in bytesIOExceptionpublic void waitUntilShutDown()
HBaseClusterwaitUntilShutDown in class HBaseClusterpublic void shutdown() throws IOException
HBaseClustershutdown in class HBaseClusterIOExceptionpublic boolean isDistributedCluster()
isDistributedCluster in class HBaseClusterpublic boolean restoreClusterMetrics(ClusterMetrics initial) throws IOException
HBaseClusterrestoreClusterMetrics in class HBaseClusterIOExceptionprotected boolean restoreMasters(ClusterMetrics initial, ClusterMetrics current)
protected boolean restoreRegionServers(ClusterMetrics initial, ClusterMetrics current)
protected boolean restoreAdmin() throws IOException
IOExceptionCopyright © 2007–2019 Cloudera. All rights reserved.