public interface IgniteCountDownLatch extends Closeable
java.util.CountDownLatch
.
Note that you cannot remove count down latch having count greater that zero. It should be
counted down to zero first.
Ignite.countDownLatch(String, int, boolean, boolean)
.Modifier and Type | Method and Description |
---|---|
boolean |
autoDelete()
Gets
autoDelete flag. |
void |
await()
Causes the current thread to wait until the latch has counted down to
zero, unless current thread is interrupted.
|
boolean |
await(long timeout)
Causes the current thread to wait until the latch has counted down to
zero, unless the thread is interrupted, or the specified waiting time elapses.
|
boolean |
await(long timeout,
TimeUnit unit)
Causes the current thread to wait until the latch has counted down to
zero, unless the thread is interrupted, or the specified waiting time elapses.
|
void |
close()
Removes this count down latch.
|
int |
count()
Gets current count value of the latch.
|
int |
countDown()
Decrements the count of the latch, releasing all waiting threads
on all nodes if the count reaches zero.
|
int |
countDown(int val)
Decreases the count of the latch using passed in value,
releasing all waiting threads on all nodes if the count reaches zero.
|
void |
countDownAll()
Counts down this latch to zero, releasing all waiting threads on all nodes.
|
int |
initialCount()
Gets initial count value of the latch.
|
String |
name()
Gets name of the latch.
|
boolean |
removed()
Gets
removed status of the latch. |
String name()
int count()
int initialCount()
boolean autoDelete()
autoDelete
flag. If this flag is true
latch is removed
from cache when it has been counted down to 0.autoDelete
flag.void await() throws IgniteException
If the current count of the latch is zero then this method returns immediately.
If the current count is greater than zero then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of two things happen:
countDown()
method on any node; or
If the current thread:
IgniteInterruptedCheckedException
is thrown and the current thread's
interrupted status is cleared.IgniteException
- If operation failed.IgniteInterruptedException
- if the current thread is interrupted
while waitingboolean await(long timeout) throws IgniteException
If the current count is zero then this method returns immediately
with the value true
.
If the current count is greater than zero then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of three things happen:
countDown()
method on any node; or
If the count reaches zero then the method returns with the
value true
.
If the current thread:
IgniteInterruptedCheckedException
is thrown and the current thread's
interrupted status is cleared.
If the specified waiting time elapses then the value false
is returned. If the time is less than or equal to zero, the method
will not wait at all.
timeout
- The maximum time to wait in milliseconds.True
if the count reached zero and false
if the waiting time elapsed before the count reached zero.IgniteInterruptedException
- If the current thread is interrupted
while waiting.IgniteException
- If operation failed.boolean await(long timeout, TimeUnit unit) throws IgniteException
If the current count is zero then this method returns immediately
with the value true
.
If the current count is greater than zero then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of three things happen:
countDown()
method on any node; or
If the count reaches zero then the method returns with the
value true
.
If the current thread:
IgniteInterruptedCheckedException
is thrown and the current thread's
interrupted status is cleared.
If the specified waiting time elapses then the value false
is returned. If the time is less than or equal to zero, the method
will not wait at all.
timeout
- The maximum time to wait.unit
- The time unit of the timeout
argument.True
if the count reached zero and false
if the waiting time elapsed before the count reached zero.IgniteInterruptedException
- If the current thread is interrupted
while waiting.IgniteException
- If operation failed.int countDown() throws IgniteException
If the current count is greater than zero then it is decremented. If the new count is zero then all waiting threads are re-enabled for thread scheduling purposes.
If the current count equals zero then nothing happens.
IgniteException
- If operation failed.int countDown(int val) throws IgniteException
If the current count is greater than zero then it is decreased. If the new count is zero then all waiting threads are re-enabled for thread scheduling purposes.
If the current count equals zero then nothing happens.
val
- Value to decrease counter on.IgniteException
- If operation failed.void countDownAll() throws IgniteException
If the current count equals zero then nothing happens.
IgniteException
- If operation failed.boolean removed()
removed
status of the latch.True
if latch was removed from cache, false
otherwise.void close()
close
in interface AutoCloseable
close
in interface Closeable
IgniteException
- If operation failed.
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024