Class DistributedBarrier
java.lang.Object
org.apache.curator.framework.recipes.barriers.DistributedBarrier
A barrier as described in the ZK recipes. Quoting the recipe:
Distributed systems use barriers to block processing of a set of nodes until a condition is met at which time all the nodes are allowed to proceed
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Utility to remove the barrier nodevoid
Utility to set the barrier nodevoid
Blocks until the barrier node comes into existenceboolean
waitOnBarrier
(long maxWait, TimeUnit unit) Blocks until the barrier no longer exists or the timeout elapses
-
Constructor Details
-
DistributedBarrier
- Parameters:
client
- clientbarrierPath
- path to use as the barrier
-
-
Method Details
-
setBarrier
Utility to set the barrier node- Throws:
Exception
- errors
-
removeBarrier
Utility to remove the barrier node- Throws:
Exception
- errors
-
waitOnBarrier
Blocks until the barrier node comes into existence- Throws:
Exception
- errors
-
waitOnBarrier
Blocks until the barrier no longer exists or the timeout elapses- Parameters:
maxWait
- max time to blockunit
- time unit- Returns:
- true if the wait was successful, false if the timeout elapsed first
- Throws:
Exception
- errors
-