本文整理了Java中org.apache.hadoop.hbase.HBaseTestingUtility.shutdownMiniHBaseCluster()
方法的一些代码示例,展示了HBaseTestingUtility.shutdownMiniHBaseCluster()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HBaseTestingUtility.shutdownMiniHBaseCluster()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.HBaseTestingUtility
类名称:HBaseTestingUtility
方法名:shutdownMiniHBaseCluster
[英]Shutdown HBase mini cluster.Does not shutdown zk or dfs if running.
[中]关闭HBase小型群集。如果正在运行,则不会关闭zk或dfs。
代码示例来源:origin: apache/hbase
@AfterClass
public static void tearDownAfterClass() throws Exception {
TEST_UTIL_PEER.shutdownMiniHBaseCluster();
TEST_UTIL.shutdownMiniHBaseCluster();
TEST_UTIL.shutdownMiniDFSCluster();
}
代码示例来源:origin: apache/hbase
@After
public void tearDown() throws Exception {
TEST_UTIL.shutdownMiniHBaseCluster();
}
代码示例来源:origin: apache/hbase
private void restartHBaseCluster() throws Exception {
LOG.info("\n\nShutting down cluster");
TEST_UTIL.shutdownMiniHBaseCluster();
LOG.info("\n\nSleeping a bit");
Thread.sleep(2000);
TEST_UTIL.restartHBaseCluster(NUM_SLAVES_BASE - 1);
initialize();
}
}
代码示例来源:origin: apache/hbase
/**
* Stops mini hbase, zk, and hdfs clusters.
* @throws IOException
* @see #startMiniCluster(int)
*/
public void shutdownMiniCluster() throws Exception {
LOG.info("Shutting down minicluster");
shutdownMiniHBaseCluster();
shutdownMiniDFSCluster();
shutdownMiniZKCluster();
cleanupTestDir();
miniClusterRunning = false;
LOG.info("Minicluster is down");
}
代码示例来源:origin: apache/hbase
util.shutdownMiniHBaseCluster();
代码示例来源:origin: apache/hbase
@After
public void after() throws Exception {
TEST_UTIL.shutdownMiniHBaseCluster();
TEST_UTIL.getTestFileSystem().delete(FSUtils.getRootDir(TEST_UTIL.getConfiguration()), true);
ZKUtil.deleteNodeRecursively(TEST_UTIL.getZooKeeperWatcher(), "/hbase");
}
代码示例来源:origin: apache/hbase
@Test
public void testConnectionRideOverClusterRestart() throws IOException, InterruptedException {
Configuration config = new Configuration(TEST_UTIL.getConfiguration());
final TableName tableName = TableName.valueOf(name.getMethodName());
TEST_UTIL.createTable(tableName, new byte[][] {FAM_NAM}).close();
Connection connection = ConnectionFactory.createConnection(config);
Table table = connection.getTable(tableName);
// this will cache the meta location and table's region location
table.get(new Get(Bytes.toBytes("foo")));
// restart HBase
TEST_UTIL.shutdownMiniHBaseCluster();
TEST_UTIL.restartHBaseCluster(2);
// this should be able to discover new locations for meta and table's region
table.get(new Get(Bytes.toBytes("foo")));
TEST_UTIL.deleteTable(tableName);
table.close();
connection.close();
}
代码示例来源:origin: apache/hbase
private void mimicSyncUpAfterDelete() throws Exception {
LOG.debug("mimicSyncUpAfterDelete");
utility2.shutdownMiniHBaseCluster();
101, rowCount_ht2Source);
utility1.shutdownMiniHBaseCluster();
utility2.restartHBaseCluster(1);
代码示例来源:origin: apache/hbase
private void mimicSyncUpAfterPut() throws Exception {
LOG.debug("mimicSyncUpAfterPut");
utility1.restartHBaseCluster(1);
utility2.shutdownMiniHBaseCluster();
assertEquals("t2_syncup has 202 rows on source", 202, rowCount_ht2Source);
utility1.shutdownMiniHBaseCluster();
utility2.restartHBaseCluster(1);
代码示例来源:origin: apache/hbase
TEST_UTIL.shutdownMiniHBaseCluster();
代码示例来源:origin: apache/hbase
UTIL.shutdownMiniHBaseCluster();
代码示例来源:origin: apache/hbase
UTIL.shutdownMiniHBaseCluster();
代码示例来源:origin: apache/hbase
utility2.shutdownMiniHBaseCluster();
代码示例来源:origin: apache/hbase
private void mimicSyncUpAfterBulkLoad(Iterator<String> randomHFileRangeListIterator)
throws Exception {
LOG.debug("mimicSyncUpAfterBulkLoad");
utility2.shutdownMiniHBaseCluster();
rowCount_ht2Source);
utility1.shutdownMiniHBaseCluster();
utility2.restartHBaseCluster(1);
代码示例来源:origin: apache/hbase
@After
public void after() throws Exception {
try {
TEST_UTIL.getHBaseCluster().waitForActiveAndReadyMaster(10000);
// Some regionserver could fail to delete its znode.
// So shutdown could hang. Let's kill them all instead.
TEST_UTIL.getHBaseCluster().killAll();
// Still need to clean things up
TEST_UTIL.shutdownMiniHBaseCluster();
} finally {
TEST_UTIL.getTestFileSystem().delete(FSUtils.getRootDir(TEST_UTIL.getConfiguration()), true);
ZKUtil.deleteNodeRecursively(TEST_UTIL.getZooKeeperWatcher(), "/hbase");
}
}
代码示例来源:origin: apache/hbase
t.put(p);
TEST_UTIL.shutdownMiniHBaseCluster();
代码示例来源:origin: apache/hbase
private void testScanner(HBaseTestingUtility util, String snapshotName, int numRegions,
boolean shutdownCluster) throws Exception {
setupCluster();
TableName tableName = TableName.valueOf("testScanner");
try {
createTableAndSnapshot(util, tableName, snapshotName, numRegions);
if (shutdownCluster) {
util.shutdownMiniHBaseCluster();
}
Path restoreDir = util.getDataTestDirOnTestFS(snapshotName);
Scan scan = new Scan(bbb, yyy); // limit the scan
TableSnapshotScanner scanner = new TableSnapshotScanner(UTIL.getConfiguration(), restoreDir,
snapshotName, scan);
verifyScanner(scanner, bbb, yyy);
scanner.close();
} finally {
if (!shutdownCluster) {
util.getAdmin().deleteSnapshot(snapshotName);
util.deleteTable(tableName);
tearDownCluster();
}
}
}
代码示例来源:origin: apache/hbase
utility1.shutdownMiniHBaseCluster();
utility1.startMiniHBaseCluster();
代码示例来源:origin: apache/hbase
util.shutdownMiniHBaseCluster();
代码示例来源:origin: apache/drill
@Test
public void testHBaseConnectionManager() throws Exception{
setColumnWidth(8);
runHBaseSQLVerifyCount("SELECT\n"
+ "row_key\n"
+ "FROM\n"
+ " hbase.`[TABLE_NAME]` tableName",
8);
/*
* Simulate HBase connection close and ensure that the connection
* will be reestablished automatically.
*/
storagePlugin.getConnection().close();
runHBaseSQLVerifyCount("SELECT\n"
+ "row_key\n"
+ "FROM\n"
+ " hbase.`[TABLE_NAME]` tableName",
8);
/*
* Simulate HBase cluster restart and ensure that running query against
* HBase does not require Drill cluster restart.
*/
HBaseTestsSuite.getHBaseTestingUtility().shutdownMiniHBaseCluster();
HBaseTestsSuite.getHBaseTestingUtility().restartHBaseCluster(1);
runHBaseSQLVerifyCount("SELECT\n"
+ "row_key\n"
+ "FROM\n"
+ " hbase.`[TABLE_NAME]` tableName",
8);
}
内容来源于网络,如有侵权,请联系作者删除!