assert (map != null);
synchronized (map) {
mapEntries = new HashSet<Object>(map.keySet());
}
boolean ok =
LabelPropagationServer.runIoTask(new IoRunnable() {
public void run() throws IOException {
proxy.notifyCrossNodeEdges(mapEntries, localNodeId);
} },
wdog, nodeId, maxIoAttempts, retryWaitTime, CLASS_NAME);
if (!ok) {
failed = true;
break;
}
} else {
logger.log(Level.FINE, "{0}: could not exchange edges with {1}",
localNodeId, nodeId);
failed = true;
break;
}
}
// Tell the server we're ready for the iterations to begin. If we
// cannot contact the server, the server will eventually detect this
// by timing out waiting for a response from this node.
final boolean runFailed = failed;
LabelPropagationServer.runIoTask(new IoRunnable() {
public void run() throws IOException {
server.readyToBegin(localNodeId, runFailed);
} }, wdog, localNodeId, maxIoAttempts, retryWaitTime, CLASS_NAME);
synchronized (stateLock) {
state = State.WAITING_FOR_SERVER;