org.apache.hadoop.hbase.util
Class JVMClusterUtil

java.lang.Object
  extended by org.apache.hadoop.hbase.util.JVMClusterUtil

@InterfaceAudience.Private
public class JVMClusterUtil
extends Object

Utility used running a cluster all in the one JVM.


Nested Class Summary
static class JVMClusterUtil.MasterThread
          Datastructure to hold Master Thread and Master instance
static class JVMClusterUtil.RegionServerThread
          Datastructure to hold RegionServer Thread and RegionServer instance
 
Constructor Summary
JVMClusterUtil()
           
 
Method Summary
static JVMClusterUtil.MasterThread createMasterThread(org.apache.hadoop.conf.Configuration c, Class<? extends HMaster> hmc, int index)
          Creates a JVMClusterUtil.MasterThread.
static JVMClusterUtil.RegionServerThread createRegionServerThread(org.apache.hadoop.conf.Configuration c, Class<? extends HRegionServer> hrsc, int index)
          Creates a JVMClusterUtil.RegionServerThread.
static void shutdown(List<JVMClusterUtil.MasterThread> masters, List<JVMClusterUtil.RegionServerThread> regionservers)
           
static String startup(List<JVMClusterUtil.MasterThread> masters, List<JVMClusterUtil.RegionServerThread> regionservers)
          Start the cluster.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JVMClusterUtil

public JVMClusterUtil()
Method Detail

createRegionServerThread

public static JVMClusterUtil.RegionServerThread createRegionServerThread(org.apache.hadoop.conf.Configuration c,
                                                                         Class<? extends HRegionServer> hrsc,
                                                                         int index)
                                                                  throws IOException
Creates a JVMClusterUtil.RegionServerThread. Call 'start' on the returned thread to make it run.

Parameters:
c - Configuration to use.
hrsc - Class to create.
index - Used distinguishing the object returned.
Returns:
Region server added.
Throws:
IOException

createMasterThread

public static JVMClusterUtil.MasterThread createMasterThread(org.apache.hadoop.conf.Configuration c,
                                                             Class<? extends HMaster> hmc,
                                                             int index)
                                                      throws IOException
Creates a JVMClusterUtil.MasterThread. Call 'start' on the returned thread to make it run.

Parameters:
c - Configuration to use.
hmc - Class to create.
index - Used distinguishing the object returned.
Returns:
Master added.
Throws:
IOException

startup

public static String startup(List<JVMClusterUtil.MasterThread> masters,
                             List<JVMClusterUtil.RegionServerThread> regionservers)
                      throws IOException
Start the cluster. Waits until there is a primary master initialized and returns its address.

Parameters:
masters -
regionservers -
Returns:
Address to use contacting primary master.
Throws:
IOException

shutdown

public static void shutdown(List<JVMClusterUtil.MasterThread> masters,
                            List<JVMClusterUtil.RegionServerThread> regionservers)
Parameters:
masters -
regionservers -


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.