|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.curator.framework.recipes.barriers.DistributedDoubleBarrier
public class DistributedDoubleBarrier
A double barrier as described in the ZK recipes. Quoting the recipe:
Double barriers enable clients to synchronize the beginning and the end of a computation. When enough processes have joined the barrier, processes start their computation and leave the barrier once they have finished.
| Constructor Summary | |
|---|---|
DistributedDoubleBarrier(org.apache.curator.framework.CuratorFramework client,
String barrierPath,
int memberQty)
Creates the barrier abstraction. |
|
| Method Summary | |
|---|---|
void |
enter()
Enter the barrier and block until all members have entered |
boolean |
enter(long maxWait,
TimeUnit unit)
Enter the barrier and block until all members have entered or the timeout has elapsed |
protected List<String> |
getChildrenForEntering()
|
void |
leave()
Leave the barrier and block until all members have left |
boolean |
leave(long maxWait,
TimeUnit unit)
Leave the barrier and block until all members have left or the timeout has elapsed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DistributedDoubleBarrier(org.apache.curator.framework.CuratorFramework client,
String barrierPath,
int memberQty)
memberQty is the number of members in the
barrier. When enter() is called, it blocks until all members have entered. When
leave() is called, it blocks until all members have left.
client - the clientbarrierPath - path to usememberQty - the number of members in the barrier. NOTE: more than memberQty
can enter the barrier. memberQty is a threshold, not a limit| Method Detail |
|---|
public void enter()
throws Exception
Exception - interruptions, errors, etc.
public boolean enter(long maxWait,
TimeUnit unit)
throws Exception
maxWait - max time to blockunit - time unit
Exception - interruptions, errors, etc.
public void leave()
throws Exception
Exception - interruptions, errors, etc.
public boolean leave(long maxWait,
TimeUnit unit)
throws Exception
maxWait - max time to blockunit - time unit
Exception - interruptions, errors, etc.
protected List<String> getChildrenForEntering()
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||