// Initialize aggregator at worker side during setup.
// Do this just before vertex and edge loading.
globalCommHandler.prepareSuperstep(workerAggregatorRequestProcessor);
VertexEdgeCount vertexEdgeCount;
long entriesLoaded;
if (getConfiguration().hasMappingInputFormat()) {
// Ensure the mapping InputSplits are ready for processing
ensureInputSplitsReady(mappingInputSplitsPaths, mappingInputSplitsEvents);
getContext().progress();
try {
entriesLoaded = loadMapping();
// successfully loaded mapping
// now initialize graphPartitionerFactory with this data
getGraphPartitionerFactory().initialize(localData);
} catch (InterruptedException e) {
throw new IllegalStateException(
"setup: loadMapping failed with InterruptedException", e);
} catch (KeeperException e) {
throw new IllegalStateException(
"setup: loadMapping failed with KeeperException", e);
}
getContext().progress();
if (LOG.isInfoEnabled()) {
LOG.info("setup: Finally loaded a total of " +
entriesLoaded + " entries from inputSplits");
}
// Workers wait for each other to finish, coordinated by master
markCurrentWorkerDoneThenWaitForOthers(mappingInputSplitsPaths,
mappingInputSplitsEvents);
// Print stats for data stored in localData once mapping is fully
// loaded on all the workers
localData.printStats();
}
if (getConfiguration().hasVertexInputFormat()) {
// Ensure the vertex InputSplits are ready for processing
ensureInputSplitsReady(vertexInputSplitsPaths, vertexInputSplitsEvents);
getContext().progress();
try {
vertexEdgeCount = loadVertices();
} catch (InterruptedException e) {
throw new IllegalStateException(
"setup: loadVertices failed with InterruptedException", e);
} catch (KeeperException e) {
throw new IllegalStateException(
"setup: loadVertices failed with KeeperException", e);
}
getContext().progress();
} else {
vertexEdgeCount = new VertexEdgeCount();
}
WorkerProgress.get().finishLoadingVertices();
if (getConfiguration().hasEdgeInputFormat()) {
// Ensure the edge InputSplits are ready for processing
ensureInputSplitsReady(edgeInputSplitsPaths, edgeInputSplitsEvents);
getContext().progress();
try {
vertexEdgeCount = vertexEdgeCount.incrVertexEdgeCount(0, loadEdges());
} catch (InterruptedException e) {
throw new IllegalStateException(
"setup: loadEdges failed with InterruptedException", e);
} catch (KeeperException e) {
throw new IllegalStateException(