public final class CountingPoisonPill extends PoisonPill
Modifier and Type | Field and Description |
---|---|
private PoisonTrackCounter |
poisonTrackCounter |
Constructor and Description |
---|
CountingPoisonPill(int count)
Creates a non-immediate instance that could be used to stop operators in a network.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
countDown() |
Promise<java.lang.Boolean> |
getTermination()
Retrieves the promise for termination
|
void |
join()
Blocks until the number of terminated operators reaches the number specified in the constructor
|
void |
join(long timeout,
java.util.concurrent.TimeUnit unit)
Blocks until the number of terminated operators reaches the number specified in the constructor
|
getImmediateInstance, getInstance, isImmediate
private final PoisonTrackCounter poisonTrackCounter
public CountingPoisonPill(int count)
count
- The number of operators that need to be stopped before the join() method returns.public void join() throws java.lang.InterruptedException
java.lang.InterruptedException
- If the current thread gets interrupted during the blockingpublic void join(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
timeout
- the maximum time to waitunit
- the time unit of the timeout
argumentjava.lang.InterruptedException
- If the current thread gets interrupted during the blockingpublic Promise<java.lang.Boolean> getTermination()
void countDown()
countDown
in class PoisonPill