public final class GridCacheCountDownLatchImpl extends AtomicDataStructureProxy<GridCacheCountDownLatchValue> implements GridCacheCountDownLatchEx, IgniteChangeGlobalStateSupport, Externalizable
| Constructor and Description |
|---|
GridCacheCountDownLatchImpl()
Empty constructor required by
Externalizable. |
GridCacheCountDownLatchImpl(String name,
int initCnt,
boolean autoDel,
GridCacheInternalKey key,
IgniteInternalCache<GridCacheInternalKey,GridCacheCountDownLatchValue> latchView)
Constructor.
|
| 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.
|
void |
needCheckNotRemoved() |
void |
onUpdate(int cnt)
Callback to notify latch on changes.
|
void |
readExternal(ObjectInput in) |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
checkRemoved, invalidateLocalState, key, name, onActivate, onDeActivate, onRemoved, removed, restart, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitkeyname, removedonRemoved, restart, suspendonActivate, onDeActivatepublic GridCacheCountDownLatchImpl()
Externalizable.public GridCacheCountDownLatchImpl(String name, int initCnt, boolean autoDel, GridCacheInternalKey key, IgniteInternalCache<GridCacheInternalKey,GridCacheCountDownLatchValue> latchView)
name - Latch name.initCnt - Initial count.autoDel - Auto delete flag.key - Latch key.latchView - Latch projection.public int count()
count in interface IgniteCountDownLatchpublic int initialCount()
initialCount in interface IgniteCountDownLatchpublic boolean autoDelete()
autoDelete flag. If this flag is true latch is removed
from cache when it has been counted down to 0.autoDelete in interface IgniteCountDownLatchautoDelete flag.public void await()
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:
IgniteCountDownLatch.countDown() method on any node; or
If the current thread:
IgniteInterruptedCheckedException is thrown and the current thread's
interrupted status is cleared.await in interface IgniteCountDownLatchpublic boolean await(long timeout,
TimeUnit unit)
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:
IgniteCountDownLatch.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.
await in interface IgniteCountDownLatchtimeout - 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.public boolean await(long timeout)
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:
IgniteCountDownLatch.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.
await in interface IgniteCountDownLatchtimeout - 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.public int countDown()
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.
countDown in interface IgniteCountDownLatchpublic int countDown(int val)
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.
countDown in interface IgniteCountDownLatchval - Value to decrease counter on.public void countDownAll()
If the current count equals zero then nothing happens.
countDownAll in interface IgniteCountDownLatchpublic void needCheckNotRemoved()
needCheckNotRemoved in interface GridCacheRemovableneedCheckNotRemoved in class AtomicDataStructureProxy<GridCacheCountDownLatchValue>public void onUpdate(int cnt)
onUpdate in interface GridCacheCountDownLatchExcnt - New count.public void close()
close in interface Closeableclose in interface AutoCloseableclose in interface IgniteCountDownLatchpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundException
Follow @ApacheIgnite
Ignite Fabric : ver. 2.4.0 Release Date : March 5 2018