callback._message.getResultMap()
.get(DefaultSchedulerMessageHandlerFactory.SCHEDULER_MSG_ID);
for (int j = 0; j < 10; j++) {
Thread.sleep(200);
PropertyKey controllerTaskStatus =
keyBuilder.controllerTaskStatus(MessageType.SCHEDULER_MSG.toString(), msgId);
ZNRecord statusUpdate = helixDataAccessor.getProperty(controllerTaskStatus).getRecord();
if (statusUpdate.getMapFields().containsKey("SentMessageCount")) {
Assert.assertEquals(
statusUpdate.getMapFields().get("SentMessageCount").get("MessageCount"), ""
+ (_PARTITIONS * 3));
break;
}
}
for (int i = 0; i < _PARTITIONS * 3 / 5; i++) {
for (int j = 0; j < 10; j++) {
Thread.sleep(300);
if (factory._messageCount == 5 * (i + 1))
break;
}
Thread.sleep(300);
Assert.assertEquals(factory._messageCount, 5 * (i + 1));
factory.signal();
// System.err.println(i);
}
for (int j = 0; j < 10; j++) {
Thread.sleep(200);
PropertyKey controllerTaskStatus =
keyBuilder.controllerTaskStatus(MessageType.SCHEDULER_MSG.toString(), msgId);
ZNRecord statusUpdate = helixDataAccessor.getProperty(controllerTaskStatus).getRecord();
if (statusUpdate.getMapFields().containsKey("Summary")) {
break;
}
}
Assert.assertEquals(_PARTITIONS, factory._results.size());
PropertyKey controllerTaskStatus =
keyBuilder.controllerTaskStatus(MessageType.SCHEDULER_MSG.toString(), msgId);
ZNRecord statusUpdate = helixDataAccessor.getProperty(controllerTaskStatus).getRecord();
Assert.assertTrue(statusUpdate.getMapField("SentMessageCount").get("MessageCount")
.equals("" + (_PARTITIONS * 3)));
int messageResultCount = 0;