本文整理匯總了Java中org.apache.hadoop.hbase.HBaseTestingUtility.createPreSplitLoadTestTable方法的典型用法代碼示例。如果您正苦於以下問題:Java HBaseTestingUtility.createPreSplitLoadTestTable方法的具體用法?Java HBaseTestingUtility.createPreSplitLoadTestTable怎麽用?Java HBaseTestingUtility.createPreSplitLoadTestTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.hbase.HBaseTestingUtility
的用法示例。
在下文中一共展示了HBaseTestingUtility.createPreSplitLoadTestTable方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initTestTable
import org.apache.hadoop.hbase.HBaseTestingUtility; //導入方法依賴的package包/類
public void initTestTable() throws IOException {
Durability durability = Durability.USE_DEFAULT;
if (deferredLogFlush) {
durability = Durability.ASYNC_WAL;
}
HBaseTestingUtility.createPreSplitLoadTestTable(conf, tableName,
getColumnFamilies(), compressAlgo, dataBlockEncodingAlgo, numRegionsPerServer,
regionReplication, durability);
applyColumnFamilyOptions(tableName, getColumnFamilies());
}
示例2: createPreSplitLoadTestTable
import org.apache.hadoop.hbase.HBaseTestingUtility; //導入方法依賴的package包/類
protected void createPreSplitLoadTestTable(HTableDescriptor htd, HColumnDescriptor hcd)
throws IOException {
HBaseTestingUtility.createPreSplitLoadTestTable(conf, htd, hcd);
TEST_UTIL.waitUntilAllRegionsAssigned(htd.getTableName());
}
示例3: doWork
import org.apache.hadoop.hbase.HBaseTestingUtility; //導入方法依賴的package包/類
@Override
protected int doWork() throws Exception {
ProcessBasedLocalHBaseCluster hbaseCluster =
new ProcessBasedLocalHBaseCluster(conf, NUM_DATANODES, numRegionServers);
hbaseCluster.startMiniDFS();
// start the process based HBase cluster
hbaseCluster.startHBase();
// create tables if needed
HBaseTestingUtility.createPreSplitLoadTestTable(conf, TABLE_NAME,
LoadTestTool.DEFAULT_COLUMN_FAMILY, Compression.Algorithm.NONE,
DataBlockEncoding.NONE);
LOG.debug("Loading data....\n\n");
loadData();
LOG.debug("Sleeping for " + SLEEP_SEC_AFTER_DATA_LOAD +
" seconds....\n\n");
Threads.sleep(5 * SLEEP_SEC_AFTER_DATA_LOAD);
int metaRSPort = HBaseTestingUtility.getMetaRSPort(conf);
LOG.debug("Killing hbase:meta region server running on port " + metaRSPort);
hbaseCluster.killRegionServer(metaRSPort);
Threads.sleep(2000);
LOG.debug("Restarting region server running on port metaRSPort");
hbaseCluster.startRegionServer(metaRSPort);
Threads.sleep(2000);
LOG.debug("Trying to scan meta");
Table metaTable = new HTable(conf, TableName.META_TABLE_NAME);
ResultScanner scanner = metaTable.getScanner(new Scan());
Result result;
while ((result = scanner.next()) != null) {
LOG.info("Region assignment from META: "
+ Bytes.toStringBinary(result.getRow())
+ " => "
+ Bytes.toStringBinary(result.getFamilyMap(HConstants.CATALOG_FAMILY)
.get(HConstants.SERVER_QUALIFIER)));
}
return 0;
}