本文整理汇总了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;
}