Search in sources :

Example 1 with AllDoneBarrier

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;
}
Also used : OrbFastAllDoneBarrier(org.goldenorb.zookeeper.OrbFastAllDoneBarrier) OrbZKFailure(org.goldenorb.zookeeper.OrbZKFailure) OrbFastAllDoneBarrier(org.goldenorb.zookeeper.OrbFastAllDoneBarrier) AllDoneBarrier(org.goldenorb.zookeeper.AllDoneBarrier)

Aggregations

AllDoneBarrier (org.goldenorb.zookeeper.AllDoneBarrier)1 OrbFastAllDoneBarrier (org.goldenorb.zookeeper.OrbFastAllDoneBarrier)1 OrbZKFailure (org.goldenorb.zookeeper.OrbZKFailure)1