|
||||||||||
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.
Nested Class Summary | |
---|---|
static class |
LocalHBaseCluster.RegionServerThread
runs region servers |
Field Summary | |
---|---|
static String |
LOCAL
local mode |
static String |
LOCAL_COLON
'local:' |
Constructor Summary | |
---|---|
LocalHBaseCluster(HBaseConfiguration conf)
Constructor. |
|
LocalHBaseCluster(HBaseConfiguration conf,
int noRegionServers)
Constructor. |
Method Summary | |
---|---|
LocalHBaseCluster.RegionServerThread |
addRegionServer()
Creates a region server. |
HMaster |
getMaster()
|
HRegionServer |
getRegionServer(int serverNumber)
|
List<LocalHBaseCluster.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 |
String |
startup()
Start the cluster. |
void |
threadDumpingJoin(Thread t)
|
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(HBaseConfiguration conf) throws IOException
conf
-
IOException
public LocalHBaseCluster(HBaseConfiguration conf, int noRegionServers) throws IOException
conf
- Configuration to use. Post construction has the master's
address.noRegionServers
- Count of regionservers to start.
IOException
Method Detail |
---|
public LocalHBaseCluster.RegionServerThread addRegionServer() throws IOException
IOException
public HRegionServer getRegionServer(int serverNumber)
serverNumber
-
public HMaster getMaster()
public List<LocalHBaseCluster.RegionServerThread> getRegionServers()
public String waitOnRegionServer(int serverNumber)
serverNumber
-
public void join()
shutdown()
.
public String startup()
public void shutdown()
public void threadDumpingJoin(Thread t) throws InterruptedException
InterruptedException
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 |