/** * Run test on an HBase instance for 5 minutes. This assumes that the table under test only has a * single region. */ public static void main(String args[]) throws Exception { try { Configuration c = HBaseConfiguration.create(); TestHRegionServerBulkLoad test = new TestHRegionServerBulkLoad(0); test.setConf(c); test.runAtomicBulkloadTest(TableName.valueOf("atomicTableTest"), 5 * 60 * 1000, 50); } finally { System.exit(0); // something hangs (believe it is lru threadpool) } }
/** Atomic bulk load. */ @Test public void testAtomicBulkLoad() throws Exception { TableName TABLE_NAME = TableName.valueOf("atomicBulkLoad"); int millisToRun = 30000; int numScanners = 50; UTIL.startMiniCluster(1); try { WAL log = UTIL.getHBaseCluster().getRegionServer(0).getWAL(null); FindBulkHBaseListener listener = new FindBulkHBaseListener(); log.registerWALActionsListener(listener); runAtomicBulkloadTest(TABLE_NAME, millisToRun, numScanners); assertThat(listener.isFound(), is(true)); } finally { UTIL.shutdownMiniCluster(); } }