Java Code Examples for org.apache.hadoop.hbase.HBaseTestingUtility#getRSForFirstRegionInTable()
The following examples show how to use
org.apache.hadoop.hbase.HBaseTestingUtility#getRSForFirstRegionInTable() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SnapshotTestingUtils.java From hbase with Apache License 2.0 | 5 votes |
public static void waitForTableToBeOnline(final HBaseTestingUtility util, final TableName tableName) throws IOException, InterruptedException { HRegionServer rs = util.getRSForFirstRegionInTable(tableName); List<HRegion> onlineRegions = rs.getRegions(tableName); for (HRegion region : onlineRegions) { region.waitForFlushesAndCompactions(); } // Wait up to 60 seconds for a table to be available. util.waitFor(60000, util.predicateTableAvailable(tableName)); }
Example 2
Source File: TestMultiLogThreshold.java From hbase with Apache License 2.0 | 5 votes |
@Before public void setupTest() throws Exception { final TableName tableName = TableName.valueOf("tableName"); TEST_UTIL = new HBaseTestingUtility(); CONF = TEST_UTIL.getConfiguration(); THRESHOLD = CONF.getInt(RSRpcServices.BATCH_ROWS_THRESHOLD_NAME, RSRpcServices.BATCH_ROWS_THRESHOLD_DEFAULT); CONF.setBoolean("hbase.rpc.rows.size.threshold.reject", rejectLargeBatchOp); TEST_UTIL.startMiniCluster(); TEST_UTIL.createTable(tableName, TEST_FAM); RS = TEST_UTIL.getRSForFirstRegionInTable(tableName); }