use of org.goldenorb.zookeeper.AllDoneBarrier in project goldenorb by jzachr.
the class OrbPartition method enterAllDoneBarrier.
/**
* @param boolean iAmDone
* @param String
* barrierName
*/
private boolean enterAllDoneBarrier(String barrierName, boolean iAmDone) {
LOG.debug("p{} creating barrier {}", getPartitionID(), barrierName);
AllDoneBarrier barrier = null;
synchronized (leaderGroupMembers) {
barrier = new OrbFastAllDoneBarrier(getOrbConf(), jobInProgressPath + "/" + barrierName, leaderGroupMembers.size(), Integer.toString(getPartitionID()), zk);
}
try {
boolean entered = barrier.enter(iAmDone);
LOG.debug("p{} entered {}", getPartitionID(), barrierName);
return entered;
} catch (OrbZKFailure e) {
LOG.error("p{} failed to complete barrier: {}" + e.getMessage(), getPartitionID(), barrierName);
e.printStackTrace();
}
return false;
}
Aggregations