@AfterClass public static void tearDown() throws IOException { if (cluster != null) { cluster.shutdown(); } }
@AfterClass public static void tearDown() throws IOException { if (cluster != null) { cluster.shutdown(); } } }
@After public void teardown() throws Exception { if (cluster != null) { cluster.shutdown(); cluster = null; } if (zkCluster != null) { zkCluster.shutdown(); zkCluster = null; } }
@Test public void testStopped() throws Exception { //shutdown hbase only. then check flag file. MiniHBaseCluster cluster = UTIL.getHBaseCluster(); LOG.info("shutdown hbase cluster..."); cluster.shutdown(); LOG.info("wait for the hbase cluster shutdown..."); cluster.waitUntilShutDown(); Configuration conf = UTIL.getConfiguration(); FileSystem fs = FileSystem.get(conf); Path resultFile = new Path(UTIL.getDataTestDirOnTestFS(), MASTER_FILE); assertTrue("Master flag file should have been created",fs.exists(resultFile)); resultFile = new Path(UTIL.getDataTestDirOnTestFS(), REGIONSERVER_FILE); assertTrue("RegionServer flag file should have been created",fs.exists(resultFile)); } }
@Test public void testStop() throws Exception { MiniHBaseCluster cluster = UTIL.getHBaseCluster(); LOG.info("shutdown hbase cluster..."); cluster.shutdown(); LOG.info("wait for the hbase cluster shutdown..."); cluster.waitUntilShutDown(); JMXConnector connector = JMXConnectorFactory.newJMXConnector( JMXListener.buildJMXServiceURL(connectorPort,connectorPort), null); expectedEx.expect(IOException.class); connector.connect(); }
@Test public void testFlushedSequenceIdPersistLoad() throws Exception { Configuration conf = TEST_UTIL.getConfiguration(); int msgInterval = conf.getInt("hbase.regionserver.msginterval", 100); // insert some data into META TableName tableName = TableName.valueOf("testFlushSeqId"); HTableDescriptor desc = new HTableDescriptor(tableName); desc.addFamily(new HColumnDescriptor(Bytes.toBytes("cf"))); Table table = TEST_UTIL.createTable(desc, null); // flush META region TEST_UTIL.flush(TableName.META_TABLE_NAME); // wait for regionserver report Threads.sleep(msgInterval * 2); // record flush seqid before cluster shutdown Map<byte[], Long> regionMapBefore = TEST_UTIL.getHBaseCluster().getMaster().getServerManager() .getFlushedSequenceIdByRegion(); // restart hbase cluster which will cause flushed sequence id persist and reload TEST_UTIL.getMiniHBaseCluster().shutdown(); TEST_UTIL.restartHBaseCluster(2); TEST_UTIL.waitUntilNoRegionsInTransition(); // check equality after reloading flushed sequence id map Map<byte[], Long> regionMapAfter = TEST_UTIL.getHBaseCluster().getMaster().getServerManager() .getFlushedSequenceIdByRegion(); assertTrue(regionMapBefore.equals(regionMapAfter)); }
cluster.shutdown(); cluster.waitUntilShutDown();
@Override public void stop() throws IOException { if (hbaseCluster != null) { hbaseCluster.shutdown(); this.hbaseCluster.killAll(); this.hbaseCluster.waitUntilShutDown(); logger.info("HBase Minicluster Service Shut Down."); this.hbaseCluster = null; } }
/** * Shutdown HBase mini cluster. Does not shutdown zk or dfs if running. */ public void shutdownMiniHBaseCluster() throws IOException { if (hbaseAdmin != null) { hbaseAdmin.close(); hbaseAdmin = null; } // unset the configuration for MIN and MAX RS to start conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MINTOSTART, -1); conf.setInt(ServerManager.WAIT_ON_REGIONSERVERS_MAXTOSTART, -1); if (this.hbaseCluster != null) { this.hbaseCluster.shutdown(); // Wait till hbase is down before going on to shutdown zk. this.hbaseCluster.waitUntilShutDown(); this.hbaseCluster = null; } }
public void stopHBaseCluster() throws IOException { if (hbaseCluster != null) { LOG.info("MiniHBaseCluster stopped"); hbaseCluster.shutdown(); hbaseCluster.waitUntilShutDown(); hbaseCluster = null; } }
@After public void teardown() throws Exception { if (cluster != null) { cluster.shutdown(); cluster = null; } if (zkCluster != null) { zkCluster.shutdown(); zkCluster = null; } }
@After public void tearDown() throws IOException { client.close(); conn.close(); cluster.shutdown(); }
@Override public void stop(boolean cleanUp) throws Exception { LOG.info("HBASE: Stopping MiniHBaseCluster"); if (isRestActivated()) { getHbaseRestLocalCluster().cleanUp(); getHbaseRestLocalCluster().stop(); } miniHBaseCluster.flushcache(); miniHBaseCluster.close(); miniHBaseCluster.shutdown(); miniHBaseCluster.waitUntilShutDown(); if (cleanUp) { cleanUp(); } }
@Test public void testStopped() throws Exception { //shutdown hbase only. then check flag file. MiniHBaseCluster cluster = UTIL.getHBaseCluster(); LOG.info("shutdown hbase cluster..."); cluster.shutdown(); LOG.info("wait for the hbase cluster shutdown..."); cluster.waitUntilShutDown(); Configuration conf = UTIL.getConfiguration(); FileSystem fs = FileSystem.get(conf); Path resultFile = new Path(UTIL.getDataTestDirOnTestFS(), MASTER_FILE); assertTrue("Master flag file should have been created",fs.exists(resultFile)); resultFile = new Path(UTIL.getDataTestDirOnTestFS(), REGIONSERVER_FILE); assertTrue("RegionServer flag file should have been created",fs.exists(resultFile)); } }
@Test public void testStop() throws Exception { MiniHBaseCluster cluster = UTIL.getHBaseCluster(); LOG.info("shutdown hbase cluster..."); cluster.shutdown(); LOG.info("wait for the hbase cluster shutdown..."); cluster.waitUntilShutDown(); JMXConnector connector = JMXConnectorFactory.newJMXConnector( JMXListener.buildJMXServiceURL(connectorPort,connectorPort), null); expectedEx.expect(IOException.class); connector.connect(); }
cluster.shutdown(); cluster.waitUntilShutDown();