|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.LocalHBaseCluster
public class LocalHBaseCluster
This class creates a single process HBase cluster. One thread is created for
a master and one per region server.
Call startup() to start the cluster running and shutdown()
to close it all down. join() the cluster is you want to wait on
shutdown completion.
Runs master on port 60000 by default. Because we can't just kill the process -- not till HADOOP-1700 gets fixed and even then.... -- we need to be able to find the master with a remote client to run shutdown. To use a port other than 60000, set the hbase.master to a value of 'local:PORT': that is 'local', not 'localhost', and the port number the master should use instead of 60000.
| Field Summary | |
|---|---|
static java.lang.String |
LOCAL
local mode |
static java.lang.String |
LOCAL_COLON
'local:' |
| Constructor Summary | |
|---|---|
LocalHBaseCluster(org.apache.hadoop.conf.Configuration conf)
Constructor. |
|
LocalHBaseCluster(org.apache.hadoop.conf.Configuration conf,
int noRegionServers)
Constructor. |
|
LocalHBaseCluster(org.apache.hadoop.conf.Configuration conf,
int noMasters,
int noRegionServers)
Constructor. |
|
LocalHBaseCluster(org.apache.hadoop.conf.Configuration conf,
int noMasters,
int noRegionServers,
java.lang.Class<? extends HMaster> masterClass,
java.lang.Class<? extends HRegionServer> regionServerClass)
Constructor. |
|
| Method Summary | |
|---|---|
JVMClusterUtil.MasterThread |
addMaster()
|
JVMClusterUtil.MasterThread |
addMaster(org.apache.hadoop.conf.Configuration c,
int index)
|
JVMClusterUtil.MasterThread |
addMaster(org.apache.hadoop.conf.Configuration c,
int index,
User user)
|
JVMClusterUtil.RegionServerThread |
addRegionServer()
|
JVMClusterUtil.RegionServerThread |
addRegionServer(org.apache.hadoop.conf.Configuration config,
int index)
|
JVMClusterUtil.RegionServerThread |
addRegionServer(org.apache.hadoop.conf.Configuration config,
int index,
User user)
|
HMaster |
getActiveMaster()
Gets the current active master, if available. |
java.util.List<JVMClusterUtil.MasterThread> |
getLiveMasters()
|
java.util.List<JVMClusterUtil.RegionServerThread> |
getLiveRegionServers()
|
HMaster |
getMaster(int serverNumber)
|
java.util.List<JVMClusterUtil.MasterThread> |
getMasters()
|
HRegionServer |
getRegionServer(int serverNumber)
|
java.util.List<JVMClusterUtil.RegionServerThread> |
getRegionServers()
|
static boolean |
isLocal(org.apache.hadoop.conf.Configuration c)
|
void |
join()
Wait for Mini HBase Cluster to shut down. |
static void |
main(java.lang.String[] args)
Test things basically work. |
void |
shutdown()
Shut down the mini HBase cluster |
void |
startup()
Start the cluster. |
java.lang.String |
waitOnMaster(int serverNumber)
Wait for the specified master to stop Removes this thread from list of running threads. |
java.lang.String |
waitOnMaster(JVMClusterUtil.MasterThread masterThread)
Wait for the specified master to stop Removes this thread from list of running threads. |
java.lang.String |
waitOnRegionServer(int serverNumber)
Wait for the specified region server to stop Removes this thread from list of running threads. |
java.lang.String |
waitOnRegionServer(JVMClusterUtil.RegionServerThread rst)
Wait for the specified region server to stop Removes this thread from list of running threads. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String LOCAL
public static final java.lang.String LOCAL_COLON
| Constructor Detail |
|---|
public LocalHBaseCluster(org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException
conf -
java.io.IOException
public LocalHBaseCluster(org.apache.hadoop.conf.Configuration conf,
int noRegionServers)
throws java.io.IOException
conf - Configuration to use. Post construction has the master's
address.noRegionServers - Count of regionservers to start.
java.io.IOException
public LocalHBaseCluster(org.apache.hadoop.conf.Configuration conf,
int noMasters,
int noRegionServers)
throws java.io.IOException
conf - Configuration to use. Post construction has the active master
address.noMasters - Count of masters to start.noRegionServers - Count of regionservers to start.
java.io.IOException
public LocalHBaseCluster(org.apache.hadoop.conf.Configuration conf,
int noMasters,
int noRegionServers,
java.lang.Class<? extends HMaster> masterClass,
java.lang.Class<? extends HRegionServer> regionServerClass)
throws java.io.IOException
conf - Configuration to use. Post construction has the master's
address.noMasters - Count of masters to start.noRegionServers - Count of regionservers to start.masterClass - regionServerClass -
java.io.IOException| Method Detail |
|---|
public JVMClusterUtil.RegionServerThread addRegionServer()
throws java.io.IOException
java.io.IOException
public JVMClusterUtil.RegionServerThread addRegionServer(org.apache.hadoop.conf.Configuration config,
int index)
throws java.io.IOException
java.io.IOException
public JVMClusterUtil.RegionServerThread addRegionServer(org.apache.hadoop.conf.Configuration config,
int index,
User user)
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public JVMClusterUtil.MasterThread addMaster()
throws java.io.IOException
java.io.IOException
public JVMClusterUtil.MasterThread addMaster(org.apache.hadoop.conf.Configuration c,
int index)
throws java.io.IOException
java.io.IOException
public JVMClusterUtil.MasterThread addMaster(org.apache.hadoop.conf.Configuration c,
int index,
User user)
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedExceptionpublic HRegionServer getRegionServer(int serverNumber)
serverNumber -
public java.util.List<JVMClusterUtil.RegionServerThread> getRegionServers()
public java.util.List<JVMClusterUtil.RegionServerThread> getLiveRegionServers()
public java.lang.String waitOnRegionServer(int serverNumber)
serverNumber -
public java.lang.String waitOnRegionServer(JVMClusterUtil.RegionServerThread rst)
rst -
public HMaster getMaster(int serverNumber)
serverNumber -
public HMaster getActiveMaster()
public java.util.List<JVMClusterUtil.MasterThread> getMasters()
public java.util.List<JVMClusterUtil.MasterThread> getLiveMasters()
public java.lang.String waitOnMaster(int serverNumber)
serverNumber -
public java.lang.String waitOnMaster(JVMClusterUtil.MasterThread masterThread)
masterThread -
public void join()
shutdown().
public void startup()
public void shutdown()
public static boolean isLocal(org.apache.hadoop.conf.Configuration c)
c - Configuration to check.
public static void main(java.lang.String[] args)
throws java.io.IOException
args -
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||