// Create table then get the single entityGroup for our new table.
FTable t = TESTING_UTIL.createTable(tableName);
List<EntityGroup> entityGroups = cluster.getEntityGroups(tableName);
EntityGroupInfo egi = getAndCheckSingleTableEntityGroup(entityGroups);
int tableEntityGroupIndex = getTableEntityGroupIndex(admin, egi);
// Turn off balancer so it doesn't cut in and mess up our placements.
admin.setBalancerRunning(false, true);
try {
// Add a bit of load up into the table so splittable.
TESTING_UTIL.loadTable(t);
// Get entityGroup pre-split.
FServer server = cluster.getFServer(tableEntityGroupIndex);
printOutEntityGroups(server, "Initial entityGroups: ");
int entityGroupCount = ProtobufUtil.getOnlineEntityGroups(server).size();
// Now, before we split, set special flag in master, a flag that has
// it FAIL the processing of split.
SplitEntityGroupHandler.TEST_SKIP = true;
// Now try splitting and it should work.
split(egi, "1", server, entityGroupCount);
// Get daughters
List<EntityGroup> daughters = checkAndGetDaughters(tableName);
// Assert the ephemeral node is up in zk.
String path = ZKAssign.getNodeName(zkw, egi.getEncodedName());
Stat stats = zkw.getRecoverableZooKeeper().exists(path, false);
LOG.info("EPHEMERAL NODE BEFORE SERVER ABORT, path=" + path + ", stats="
+ stats);
EntityGroupTransaction rtd = EntityGroupTransaction.parseFrom(ZKAssign
.getData(zkw, egi.getEncodedName()));
// State could be SPLIT or SPLITTING.
assertTrue(rtd.getEventType().equals(
EventHandler.EventType.FSERVER_ZK_ENTITYGROUP_SPLIT)
|| rtd.getEventType().equals(
EventHandler.EventType.FSERVER_ZK_ENTITYGROUP_SPLITTING));