registerHealth(getSuperstep());
String addressesAndPartitionsPath =
getAddressesAndPartitionsPath(getApplicationAttempt(),
getSuperstep());
AddressesAndPartitionsWritable addressesAndPartitions =
new AddressesAndPartitionsWritable(
workerGraphPartitioner.createPartitionOwner().getClass());
try {
while (getZkExt().exists(addressesAndPartitionsPath, true) ==
null) {
getAddressesAndPartitionsReadyChangedEvent().waitForever();
getAddressesAndPartitionsReadyChangedEvent().reset();
}
WritableUtils.readFieldsFromZnode(
getZkExt(),
addressesAndPartitionsPath,
false,
null,
addressesAndPartitions);
} catch (KeeperException e) {
throw new IllegalStateException(
"startSuperstep: KeeperException getting assignments", e);
} catch (InterruptedException e) {
throw new IllegalStateException(
"startSuperstep: InterruptedException getting assignments", e);
}
workerInfoList.clear();
workerInfoList = addressesAndPartitions.getWorkerInfos();
masterInfo = addressesAndPartitions.getMasterInfo();
if (LOG.isInfoEnabled()) {
LOG.info("startSuperstep: " + masterInfo);
LOG.info("startSuperstep: Ready for computation on superstep " +
getSuperstep() + " since worker " +
"selection and vertex range assignments are done in " +
addressesAndPartitionsPath);
}
getContext().setStatus("startSuperstep: " +
getGraphTaskManager().getGraphFunctions().toString() +
" - Attempt=" + getApplicationAttempt() +
", Superstep=" + getSuperstep());
if (LOG.isDebugEnabled()) {
LOG.debug("startSuperstep: addressesAndPartitions" +
addressesAndPartitions.getWorkerInfos());
for (PartitionOwner partitionOwner : addressesAndPartitions
.getPartitionOwners()) {
LOG.debug(partitionOwner.getPartitionId() + " " +
partitionOwner.getWorkerInfo());
}
}
return addressesAndPartitions.getPartitionOwners();
}