@InterfaceAudience.Public public interface TestingHBaseCluster
Modifier and Type | Method and Description |
---|---|
static TestingHBaseCluster |
create(TestingHBaseClusterOption option)
Create a
TestingHBaseCluster . |
Optional<ServerName> |
getActiveMasterAddress()
Get the address of active master if there is one.
|
List<ServerName> |
getBackupMasterAddresses()
Get all the backup master addresses.
|
org.apache.hadoop.conf.Configuration |
getConf()
Get configuration of this cluster.
|
List<ServerName> |
getRegionServerAddresses()
Get all the region server addresses.
|
boolean |
isClusterRunning()
Return whether the cluster is running.
|
boolean |
isHBaseClusterRunning()
Return whether the hbase cluster is running.
|
void |
start()
Start the whole mini cluster, including zookeeper cluster, dfs cluster and hbase cluster.
|
void |
startHBaseCluster()
Start the hbase cluster.
|
void |
startMaster()
Start a new master with localhost and random port.
|
void |
startMaster(String hostname,
int port)
Start a new master bind on the given host and port.
|
void |
startRegionServer()
Start a new region server with localhost and random port.
|
void |
startRegionServer(String hostname,
int port)
Start a new region server bind on the given host and port.
|
void |
stop()
Stop the whole mini cluster, including zookeeper cluster, dfs cluster and hbase cluster.
|
void |
stopHBaseCluster()
Stop the hbase cluster.
|
CompletableFuture<Void> |
stopMaster(ServerName serverName)
Stop the given master.
|
CompletableFuture<Void> |
stopRegionServer(ServerName serverName)
Stop the given region server.
|
org.apache.hadoop.conf.Configuration getConf()
Configuration
to create
Connection
for accessing the testing cluster.void startMaster() throws Exception
Exception
void startMaster(String hostname, int port) throws Exception
Exception
CompletableFuture<Void> stopMaster(ServerName serverName) throws Exception
CompletableFuture
to wait on the master quit. The differences
comparing to Admin.stopMaster()
is that first, we could
also stop backup masters here, second, this method does not always fail since we do not use rpc
to stop the master.Exception
void startRegionServer() throws Exception
Exception
void startRegionServer(String hostname, int port) throws Exception
Exception
CompletableFuture<Void> stopRegionServer(ServerName serverName) throws Exception
CompletableFuture
to wait on the master quit. The difference
comparing to Admin.stopMaster()
is that this method does
not always fail since we do not use rpc to stop the region server.Exception
void stopHBaseCluster() throws Exception
start()
first before calling this method, otherwise an
IllegalStateException
will be thrown. If the hbase is not running because you have
already stopped the cluster, an IllegalStateException
will be thrown too.Exception
void startHBaseCluster() throws Exception
stopHBaseCluster()
. If
the cluster is already running or you have not called start()
yet, an
IllegalStateException
will be thrown.Exception
boolean isHBaseClusterRunning()
void start() throws Exception
stop()
to
shutdown the cluster completely, and then you can call this method to start the whole cluster
again. An IllegalStateException
will be thrown if you call this method incorrectly.Exception
Optional<ServerName> getActiveMasterAddress()
List<ServerName> getBackupMasterAddresses()
List<ServerName> getRegionServerAddresses()
boolean isClusterRunning()
start()
and have not called
stop()
yet. If you want to make sure the hbase cluster is running, use
isHBaseClusterRunning()
.void stop() throws Exception
start()
, otherwise an
IllegalStateException
will be thrown.Exception
static TestingHBaseCluster create(TestingHBaseClusterOption option)
TestingHBaseCluster
. You need to call start()
of the returned
TestingHBaseCluster
to actually start the mini testing cluster.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.