TEST_UTIL.shutdownMiniCluster();
}
@Test
public void testMasterOpsWhileSplitting() throws Exception {
MiniWaspCluster cluster = TEST_UTIL.getWaspCluster();
FMaster m = cluster.getMaster();
FTable ft = TEST_UTIL.createTable(TABLENAME);
assertTrue(m.assignmentManager.getZKTable().isEnabledTable(
Bytes.toString(TABLENAME)));
TEST_UTIL.loadTable(ft);
List<Pair<EntityGroupInfo, ServerName>> tableEntityGroups = FMetaReader
.getTableEntityGroupsAndLocations(TEST_UTIL.getConfiguration(),
TABLENAME);
LOG.info("EntityGroups after load: "
+ Joiner.on(',').join(tableEntityGroups));
assertEquals(1, tableEntityGroups.size());
assertArrayEquals(FConstants.EMPTY_START_ROW, tableEntityGroups.get(0)
.getFirst().getStartKey());
assertArrayEquals(FConstants.EMPTY_END_ROW, tableEntityGroups.get(0)
.getFirst().getEndKey());
// Now trigger a split and stop when the split is in progress
CountDownLatch split = new CountDownLatch(1);
CountDownLatch proceed = new CountDownLatch(1);
EntityGroupSplitListener list = new EntityGroupSplitListener(split, proceed);
cluster.getMaster().executorService.registerListener(
EventType.FSERVER_ZK_ENTITYGROUP_SPLIT, list);
LOG.info("Splitting table");
TEST_UTIL.getWaspAdmin().split(TABLENAME, Bytes.toBytes("1234"));
LOG.info("Waiting for split result to be about to open");