Class SingleProcessHBaseCluster

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

@LimitedPrivate("Phoenix") @Evolving public class SingleProcessHBaseCluster extends HBaseClusterInterface
This class creates a single process HBase cluster. each server. The master uses the 'default' FileSystem. The RegionServers, if we are running on DistributedFilesystem, create a FileSystem instance each and will close down their instance on the way out.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Subclass so can get at protected methods (none at moment).
    (package private) static class 
    Alternate shutdown hook.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    org.apache.hadoop.hbase.LocalHBaseCluster
     
    private static int
     
    private static final org.slf4j.Logger
     

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

    conf, initialClusterStatus
  • Constructor Summary

    Constructors
    Constructor
    Description
    SingleProcessHBaseCluster(org.apache.hadoop.conf.Configuration conf, int numRegionServers)
    Start a MiniHBaseCluster.
    SingleProcessHBaseCluster(org.apache.hadoop.conf.Configuration conf, int numMasters, int numRegionServers)
    Start a MiniHBaseCluster.
    SingleProcessHBaseCluster(org.apache.hadoop.conf.Configuration conf, int numMasters, int numAlwaysStandByMasters, int numRegionServers, List<Integer> rsPorts, Class<? extends org.apache.hadoop.hbase.master.HMaster> masterClass, Class<? extends SingleProcessHBaseCluster.MiniHBaseClusterRegionServer> regionserverClass)
     
    SingleProcessHBaseCluster(org.apache.hadoop.conf.Configuration conf, int numMasters, int numRegionServers, Class<? extends org.apache.hadoop.hbase.master.HMaster> masterClass, Class<? extends SingleProcessHBaseCluster.MiniHBaseClusterRegionServer> regionserverClass)
    Start a MiniHBaseCluster.
  • Method Summary

    Modifier and Type
    Method
    Description
    abortMaster(int serverNumber)
    Cause a master to exit without shutting down entire cluster.
    abortRegionServer(int serverNumber)
    Cause a region server to exit doing basic clean up only on its way out.
    void
    Closes all the resources held open for this cluster.
    void
    compact(boolean major)
    Call flushCache on all regions on all participating regionservers.
    void
    compact(org.apache.hadoop.hbase.TableName tableName, boolean major)
    Call flushCache on all regions of the specified table.
    long
    Counts the total numbers of regions being served by the currently online region servers by asking each how many regions they have.
    private void
    executeFlush(org.apache.hadoop.hbase.regionserver.HRegion region)
     
    List<org.apache.hadoop.hbase.regionserver.HRegion>
    findRegionsForTable(org.apache.hadoop.hbase.TableName tableName)
     
    void
    Call flushCache on all regions on all participating regionservers.
    void
    flushcache(org.apache.hadoop.hbase.TableName tableName)
    Call flushCache on all regions of the specified table.
    org.apache.hadoop.hbase.ClusterMetrics
    Returns a ClusterMetrics for this HBase cluster.
    org.apache.hadoop.conf.Configuration
     
    List<org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread>
    Returns list of live master threads (skips the aborted and the killed)
    List<org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread>
    Returns List of live region server threads (skips the aborted and the killed)
    org.apache.hadoop.hbase.master.HMaster
    Returns the current active master, if available.
    org.apache.hadoop.hbase.master.HMaster
    getMaster(int serverNumber)
    Returns the master at the specified index, if available.
    protected int
    getMasterIndex(org.apache.hadoop.hbase.ServerName serverName)
     
    org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread
    Returns the current active master thread, if available.
    List<org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread>
    Returns list of master threads.
    int
    Returns number of live region servers in the cluster currently.
    List<org.apache.hadoop.hbase.regionserver.HRegion>
    getRegions(byte[] tableName)
     
    List<org.apache.hadoop.hbase.regionserver.HRegion>
    getRegions(org.apache.hadoop.hbase.TableName tableName)
     
    org.apache.hadoop.hbase.regionserver.HRegionServer
    getRegionServer(int serverNumber)
    Grab a numbered region server of your choice.
    org.apache.hadoop.hbase.regionserver.HRegionServer
    getRegionServer(org.apache.hadoop.hbase.ServerName serverName)
     
    protected int
    getRegionServerIndex(org.apache.hadoop.hbase.ServerName serverName)
     
    List<org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread>
    Returns list of region server threads.
    org.apache.hadoop.hbase.ServerName
    getServerHoldingRegion(org.apache.hadoop.hbase.TableName tn, byte[] regionName)
    Get the ServerName of region server serving the specified region
    int
    getServerWith(byte[] regionName)
    Get the location of the specified region
    int
    Returns index into List of getRegionServerThreads() of HRS carrying regionName.
    private void
    init(int nMasterNodes, int numAlwaysStandByMasters, int nRegionNodes, List<Integer> rsPorts, Class<? extends org.apache.hadoop.hbase.master.HMaster> masterClass, Class<? extends SingleProcessHBaseCluster.MiniHBaseClusterRegionServer> regionserverClass)
     
    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
    Wait for Mini HBase Cluster to shut down.
    void
    Do a simulated kill all masters and regionservers.
    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.
    org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread
    resumeRegionServer(int serverNumber)
    Resume the specified region server
    void
    resumeRegionServer(org.apache.hadoop.hbase.ServerName serverName)
    Resume the region server
    void
    Shut down the mini 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.
    org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread
    Starts a master thread running
    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.
    org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread
    Starts a region server thread running
    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.
    private org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread
    startRegionServer(org.apache.hadoop.conf.Configuration configuration)
     
    org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread
    Starts a region server thread and waits until its processed by master.
    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.
    org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread
    stopMaster(int serverNumber)
    Shut down the specified master cleanly
    org.apache.hadoop.hbase.util.JVMClusterUtil.MasterThread
    stopMaster(int serverNumber, boolean shutdownFS)
    Shut down the specified master cleanly
    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.
    org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread
    stopRegionServer(int serverNumber)
    Shut down the specified region server cleanly
    org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread
    stopRegionServer(int serverNumber, boolean shutdownFS)
    Shut down the specified region server cleanly
    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.
    org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread
    suspendRegionServer(int serverNumber)
    Suspend the specified region server
    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.
    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.
    waitOnMaster(int serverNumber)
    Wait for the specified master to stop.
    waitOnRegionServer(int serverNumber)
    Wait for the specified region server to stop.
    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