Search in sources :

Example 1 with Barrier

use of org.goldenorb.zookeeper.Barrier in project goldenorb by jzachr.

the class OrbPartition method enterInitializationBarrier.

/**
   * 
   * @param String
   *          barrierName
   * 
   */
private void enterInitializationBarrier(String barrierName, int countToWaitFor) {
    LOG.debug("p{} creating barrier {}", getPartitionID(), barrierName);
    LOG.debug("{} will wait for {} partitions to join", barrierName, countToWaitFor);
    Barrier barrier = new OrbFastBarrier(getOrbConf(), jobInProgressPath + "/" + barrierName, countToWaitFor, Integer.toString(getPartitionID()), zk);
    try {
        barrier.enter();
        LOG.debug("p{} entered {}", getPartitionID(), barrierName);
    } catch (OrbZKFailure e) {
        LOG.error("p{} failed to complete barrier {}: " + e.getMessage(), getPartitionID(), barrierName);
        e.printStackTrace();
    }
}
Also used : OrbFastBarrier(org.goldenorb.zookeeper.OrbFastBarrier) OrbZKFailure(org.goldenorb.zookeeper.OrbZKFailure) OrbFastAllDoneBarrier(org.goldenorb.zookeeper.OrbFastAllDoneBarrier) AllDoneBarrier(org.goldenorb.zookeeper.AllDoneBarrier) OrbFastBarrier(org.goldenorb.zookeeper.OrbFastBarrier) Barrier(org.goldenorb.zookeeper.Barrier)

Example 2 with Barrier

use of org.goldenorb.zookeeper.Barrier in project goldenorb by jzachr.

the class OrbPartition method enterBarrier.

/**
   * 
   * @param String
   *          barrierName
   */
private void enterBarrier(String barrierName) {
    LOG.debug("p{} creating barrier {}", getPartitionID(), barrierName);
    Barrier barrier = null;
    synchronized (leaderGroupMembers) {
        LOG.debug("{} will wait for {} partitions", barrierName, leaderGroupMembers.size());
        barrier = new OrbFastBarrier(getOrbConf(), jobInProgressPath + "/" + barrierName, leaderGroupMembers.size(), Integer.toString(getPartitionID()), zk);
    }
    try {
        barrier.enter();
        LOG.debug("p{} entered {}", getPartitionID(), barrierName);
    } catch (OrbZKFailure e) {
        LOG.error("p{} failed to complete barrier {}: " + e.getMessage(), getPartitionID(), barrierName);
        e.printStackTrace();
    }
}
Also used : OrbFastBarrier(org.goldenorb.zookeeper.OrbFastBarrier) OrbZKFailure(org.goldenorb.zookeeper.OrbZKFailure) OrbFastAllDoneBarrier(org.goldenorb.zookeeper.OrbFastAllDoneBarrier) AllDoneBarrier(org.goldenorb.zookeeper.AllDoneBarrier) OrbFastBarrier(org.goldenorb.zookeeper.OrbFastBarrier) Barrier(org.goldenorb.zookeeper.Barrier)

Aggregations

AllDoneBarrier (org.goldenorb.zookeeper.AllDoneBarrier)2 Barrier (org.goldenorb.zookeeper.Barrier)2 OrbFastAllDoneBarrier (org.goldenorb.zookeeper.OrbFastAllDoneBarrier)2 OrbFastBarrier (org.goldenorb.zookeeper.OrbFastBarrier)2 OrbZKFailure (org.goldenorb.zookeeper.OrbZKFailure)2