|
||||||||||
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.
To make 'local' mode more responsive, make values such as
hbase.regionserver.msginterval
,
hbase.master.meta.thread.rescanfrequency
, and
hbase.server.thread.wakefrequency
a second or less.
Field Summary | |
---|---|
static String |
LOCAL
local mode |
static 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 noRegionServers,
Class<? extends HMaster> masterClass,
Class<? extends HRegionServer> regionServerClass)
Constructor. |
Method Summary | |
---|---|
JVMClusterUtil.RegionServerThread |
addRegionServer()
|
JVMClusterUtil.RegionServerThread |
addRegionServer(int index)
|
List<JVMClusterUtil.RegionServerThread> |
getLiveRegionServers()
|
HMaster |
getMaster()
|
HRegionServer |
getRegionServer(int serverNumber)
|
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(String[] args)
Test things basically work. |
void |
shutdown()
Shut down the mini HBase cluster |
void |
startup()
Start the cluster. |
String |
waitOnRegionServer(int serverNumber)
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 String LOCAL
public static final String LOCAL_COLON
Constructor Detail |
---|
public LocalHBaseCluster(org.apache.hadoop.conf.Configuration conf) throws IOException
conf
-
IOException
public LocalHBaseCluster(org.apache.hadoop.conf.Configuration conf, int noRegionServers) throws IOException
conf
- Configuration to use. Post construction has the master's
address.noRegionServers
- Count of regionservers to start.
IOException
public LocalHBaseCluster(org.apache.hadoop.conf.Configuration conf, int noRegionServers, Class<? extends HMaster> masterClass, Class<? extends HRegionServer> regionServerClass) throws IOException
conf
- Configuration to use. Post construction has the master's
address.noRegionServers
- Count of regionservers to start.masterClass
-
IOException
Method Detail |
---|
public JVMClusterUtil.RegionServerThread addRegionServer() throws IOException
IOException
public JVMClusterUtil.RegionServerThread addRegionServer(int index) throws IOException
IOException
public HRegionServer getRegionServer(int serverNumber)
serverNumber
-
public HMaster getMaster()
public List<JVMClusterUtil.RegionServerThread> getRegionServers()
public List<JVMClusterUtil.RegionServerThread> getLiveRegionServers()
public String waitOnRegionServer(int serverNumber)
serverNumber
-
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(String[] args) throws IOException
args
-
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |