Class DistributedHBaseCluster

java.lang.Object
org.apache.hadoop.hbase.HBaseCluster
org.apache.hadoop.hbase.DistributedHBaseCluster
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.conf.Configurable

@Private public class DistributedHBaseCluster extends HBaseCluster
Manages the interactions with an already deployed distributed cluster (as opposed to a pseudo-distributed, or mini/local cluster). This is used by integration and system tests.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private org.apache.hadoop.hbase.client.Admin
     
     
    private final org.apache.hadoop.hbase.client.Connection
     
    private final Set<org.apache.hadoop.hbase.ServerName>
    List of RegionServers killed so far.

    Fields inherited from class org.apache.hadoop.hbase.HBaseCluster

    conf, initialClusterStatus, LOG
  • Constructor Summary

    Constructors
    Constructor
    Description
    DistributedHBaseCluster(org.apache.hadoop.conf.Configuration conf, ClusterManager clusterManager)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes all the resources held open for this cluster.
    org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface
    getAdminProtocol(org.apache.hadoop.hbase.ServerName serverName)
    Returns an AdminProtocol interface to the regionserver
    org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface
    getClientProtocol(org.apache.hadoop.hbase.ServerName serverName)
    Returns a ClientProtocol interface to the regionserver
     
    org.apache.hadoop.hbase.ClusterMetrics
    Returns a ClusterStatus for this HBase cluster
    org.apache.hadoop.hbase.ClusterMetrics
    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
    Returns an MasterProtos.MasterService.BlockingInterface to the active master
    org.apache.hadoop.hbase.ServerName
    getServerHoldingRegion(org.apache.hadoop.hbase.TableName tn, byte[] regionName)
    Get the ServerName of region server serving the specified region
    boolean
     
    boolean
    isKilledRS(org.apache.hadoop.hbase.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(org.apache.hadoop.hbase.ServerName serverName)
    Kills the datanode process if this is a distributed cluster, otherwise, this causes master to exit doing basic clean up only.
    void
    killJournalNode(org.apache.hadoop.hbase.ServerName serverName)
    Kills the journalnode process if this is a distributed cluster, otherwise, this causes master to exit doing basic clean up only.
    void
    killMaster(org.apache.hadoop.hbase.ServerName serverName)
    Kills the master process if this is a distributed cluster, otherwise, this causes master to exit doing basic clean up only.
    void
    killNameNode(org.apache.hadoop.hbase.ServerName serverName)
    Kills the namenode process if this is a distributed cluster, otherwise, this causes master to exit doing basic clean up only.
    void
    killRegionServer(org.apache.hadoop.hbase.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(org.apache.hadoop.hbase.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
     
    boolean
    restoreClusterMetrics(org.apache.hadoop.hbase.ClusterMetrics initial)
    Restores the cluster to given state if this is a real cluster, otherwise does nothing.
    protected boolean
    restoreMasters(org.apache.hadoop.hbase.ClusterMetrics initial, org.apache.hadoop.hbase.ClusterMetrics current)
     
    protected boolean
    restoreRegionServers(org.apache.hadoop.hbase.ClusterMetrics initial, org.apache.hadoop.hbase.ClusterMetrics current)
     
    void
    resumeRegionServer(org.apache.hadoop.hbase.ServerName serverName)
    Resume the region server
    void
     
    void
    Shut down the HBase cluster
    void
    startDataNode(org.apache.hadoop.hbase.ServerName serverName)
    Starts a new datanode on the given hostname or if this is a mini/local cluster, silently logs warning message.
    void
    startJournalNode(org.apache.hadoop.hbase.ServerName serverName)
    Starts a new journalnode 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
    startNameNode(org.apache.hadoop.hbase.ServerName serverName)
    Starts a new namenode on the given hostname or if this is a mini/local cluster, silently logs warning message.
    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(org.apache.hadoop.hbase.ServerName serverName)
    Stops the datanode if this is a distributed cluster, otherwise silently logs warning message.
    void
    stopJournalNode(org.apache.hadoop.hbase.ServerName serverName)
    Stops the journalnode if this is a distributed cluster, otherwise silently logs warning message.
    void
    stopMaster(org.apache.hadoop.hbase.ServerName serverName)
    Stops the given master, by attempting a gradual stop.
    void
    stopNameNode(org.apache.hadoop.hbase.ServerName serverName)
    Stops the namenode if this is a distributed cluster, otherwise silently logs warning message.
    void
    stopRegionServer(org.apache.hadoop.hbase.ServerName serverName)
    Stops the given region server, by attempting a gradual stop.
    void
    stopZkNode(org.apache.hadoop.hbase.ServerName serverName)
    Stops the region zookeeper if this is a distributed cluster, otherwise silently logs warning message.
    void
    suspendRegionServer(org.apache.hadoop.hbase.ServerName serverName)
    Suspend the region server
    boolean
    Blocks until there is an active master and that master has completed initialization.
    void
    waitForDataNodeToStart(org.apache.hadoop.hbase.ServerName serverName, long timeout)
    Wait for the specified datanode to join the cluster
    void
    waitForDataNodeToStop(org.apache.hadoop.hbase.ServerName serverName, long timeout)
    Wait for the specified datanode to stop the thread / process.
    void
    waitForJournalNodeToStart(org.apache.hadoop.hbase.ServerName serverName, long timeout)
    Wait for the specified journalnode to join the cluster
    void
    waitForJournalNodeToStop(org.apache.hadoop.hbase.ServerName serverName, long timeout)
    Wait for the specified journalnode to stop
    void
    waitForMasterToStop(org.apache.hadoop.hbase.ServerName serverName, long timeout)
    Wait for the specified master to stop the thread / process.
    void
    waitForNameNodeToStart(org.apache.hadoop.hbase.ServerName serverName, long timeout)
    Wait for the specified namenode to join the cluster
    void
    waitForNameNodeToStop(org.apache.hadoop.hbase.ServerName serverName, long timeout)
    Wait for the specified namenode to stop
    void
    waitForRegionServerToStop(org.apache.hadoop.hbase.ServerName serverName, long timeout)
    Wait for the specified region server to stop the thread / process.
    private void
    waitForServiceToStart(ClusterManager.ServiceType service, org.apache.hadoop.hbase.ServerName serverName, long timeout)
     
    private void
    waitForServiceToStop(ClusterManager.ServiceType service, org.apache.hadoop.hbase.ServerName serverName, long timeout)
     
    void
    waitForZkNodeToStart(org.apache.hadoop.hbase.ServerName serverName, long timeout)
    Wait for the specified zookeeper node to join the cluster
    void
    waitForZkNodeToStop(org.apache.hadoop.hbase.ServerName serverName, long timeout)
    Wait for the specified zookeeper node to stop the thread / process.
    void
    Wait for HBase Cluster to shut down.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait