@SuppressWarnings("unchecked") public JVMClusterUtil.RegionServerThread addRegionServer( Configuration config, final int index) throws IOException { // Create each regionserver with its own Configuration instance so each has // its Connection instance rather than share (see HBASE_INSTANCES down in // the guts of ConnectionManager). JVMClusterUtil.RegionServerThread rst = JVMClusterUtil.createRegionServerThread(config, (Class<? extends HRegionServer>) conf .getClass(HConstants.REGION_SERVER_IMPL, this.regionServerClass), index); this.regionThreads.add(rst); return rst; }
public JVMClusterUtil.MasterThread addMaster(Configuration c, final int index) throws IOException { // Create each master with its own Configuration instance so each has // its Connection instance rather than share (see HBASE_INSTANCES down in // the guts of ConnectionManager. JVMClusterUtil.MasterThread mt = JVMClusterUtil.createMasterThread(c, (Class<? extends HMaster>) conf.getClass(HConstants.MASTER_IMPL, this.masterClass), index); this.masterThreads.add(mt); return mt; }
waitForEvent(startTimeout, "active", () -> findActiveMaster(masters) != null); waitForEvent(initTimeout, "initialized", () -> { JVMClusterUtil.MasterThread t = findActiveMaster(masters); return findActiveMaster(masters).master.getServerName().toString();
/** * Shut down the mini HBase cluster */ public void shutdown() { JVMClusterUtil.shutdown(this.masterThreads, this.regionThreads); }
/** * Start the cluster. */ public void startup() throws IOException { JVMClusterUtil.startup(this.masterThreads, this.regionThreads); }
while (findActiveMaster(masters) == null) { try { Thread.sleep(100); final int maxwait = 200000; while (true) { JVMClusterUtil.MasterThread t = findActiveMaster(masters); if (t != null && t.master.isInitialized()) { return t.master.getServerName().toString();
/** * Shut down the mini HBase cluster */ public void shutdown() { JVMClusterUtil.shutdown(this.masterThreads, this.regionThreads); }
/** * Start the cluster. */ public void startup() throws IOException { JVMClusterUtil.startup(this.masterThreads, this.regionThreads); }
while (findActiveMaster(masters) == null) { try { Thread.sleep(100); JVMClusterUtil.MasterThread t = findActiveMaster(masters); if (t != null && t.master.isInitialized()) { return t.master.getServerName().toString();
@Test public void testClusterId() throws Exception { TEST_UTIL.startMiniZKCluster(); TEST_UTIL.startMiniDFSCluster(1); Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); //start region server, needs to be separate //so we get an unset clusterId rst = JVMClusterUtil.createRegionServerThread(conf, HRegionServer.class, 0); rst.start(); //Make sure RS is in blocking state Thread.sleep(10000); StartMiniClusterOption option = StartMiniClusterOption.builder() .numMasters(1).numRegionServers(0).build(); TEST_UTIL.startMiniHBaseCluster(option); rst.waitForServerOnline(); String clusterId = ZKClusterId.readClusterIdZNode(TEST_UTIL.getZooKeeperWatcher()); assertNotNull(clusterId); assertEquals(clusterId, rst.getRegionServer().getClusterId()); }
public JVMClusterUtil.MasterThread addMaster(Configuration c, final int index) throws IOException { // Create each master with its own Configuration instance so each has // its HConnection instance rather than share (see HBASE_INSTANCES down in // the guts of HConnectionManager. JVMClusterUtil.MasterThread mt = JVMClusterUtil.createMasterThread(c, (Class<? extends HMaster>) conf.getClass(HConstants.MASTER_IMPL, this.masterClass), index); this.masterThreads.add(mt); return mt; }
/** * Shut down the mini HBase cluster */ public void shutdown() { JVMClusterUtil.shutdown(this.masterThreads, this.regionThreads); }
/** * Start the cluster. */ public void startup() throws IOException { JVMClusterUtil.startup(this.masterThreads, this.regionThreads); }
public JVMClusterUtil.RegionServerThread addRegionServer( Configuration config, final int index) throws IOException { // Create each regionserver with its own Configuration instance so each has // its HConnection instance rather than share (see HBASE_INSTANCES down in // the guts of HConnectionManager. JVMClusterUtil.RegionServerThread rst = JVMClusterUtil.createRegionServerThread(config, this.regionServerClass, index); this.regionThreads.add(rst); return rst; }
public JVMClusterUtil.MasterThread addMaster(Configuration c, final int index) throws IOException { // Create each master with its own Configuration instance so each has // its HConnection instance rather than share (see HBASE_INSTANCES down in // the guts of HConnectionManager. // Also, create separate CoordinatedStateManager instance per Server. // This is special case when we have to have more than 1 CoordinatedStateManager // within 1 process. CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(conf); JVMClusterUtil.MasterThread mt = JVMClusterUtil.createMasterThread(c, cp, (Class<? extends HMaster>) conf.getClass(HConstants.MASTER_IMPL, this.masterClass), index); this.masterThreads.add(mt); return mt; }
@SuppressWarnings("unchecked") public JVMClusterUtil.RegionServerThread addRegionServer( Configuration config, final int index) throws IOException { // Create each regionserver with its own Configuration instance so each has // its HConnection instance rather than share (see HBASE_INSTANCES down in // the guts of HConnectionManager. // Also, create separate CoordinatedStateManager instance per Server. // This is special case when we have to have more than 1 CoordinatedStateManager // within 1 process. CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(conf); JVMClusterUtil.RegionServerThread rst = JVMClusterUtil.createRegionServerThread(config, cp, (Class<? extends HRegionServer>) conf .getClass(HConstants.REGION_SERVER_IMPL, this.regionServerClass), index); this.regionThreads.add(rst); return rst; }
@Test public void testClusterId() throws Exception { TEST_UTIL.startMiniZKCluster(); TEST_UTIL.startMiniDFSCluster(1); Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); //start region server, needs to be separate //so we get an unset clusterId rst = JVMClusterUtil.createRegionServerThread(conf, HRegionServer.class, 0); rst.start(); //Make sure RS is in blocking state Thread.sleep(10000); TEST_UTIL.startMiniHBaseCluster(1, 0); rst.waitForServerOnline(); String clusterId = ZKClusterId.readClusterIdZNode(TEST_UTIL.getZooKeeperWatcher()); assertNotNull(clusterId); assertEquals(clusterId, rst.getRegionServer().getClusterId()); }