| Modifier and Type | Method and Description |
|---|---|
Object |
await(RaftGroupId groupId,
String name,
UUID invocationUid,
long timeoutMs)
Causes the current thread to wait until the latch has counted down
to zero, or an exception is thrown, or the specified waiting time
elapses.
|
void |
countDown(RaftGroupId groupId,
String name,
UUID invocationUid,
int expectedRound)
Decrements the count of the latch, releasing all waiting threads if
the count reaches zero.
|
Object |
getCount(RaftGroupId groupId,
String name)
Returns the current count.
|
Object |
getRound(RaftGroupId groupId,
String name)
Returns the current round.
|
Object |
trySetCount(RaftGroupId groupId,
String name,
int count)
Sets the count to the given value if the current count is zero.
|
Object trySetCount(RaftGroupId groupId, String name, int count)
groupId - CP group id of this CountDownLatch instancename - Name of the CountDownLatch instancecount - The number of times countDown must be invoked before
threads can pass through awaitObject await(RaftGroupId groupId, String name, UUID invocationUid, long timeoutMs)
countDown method, this
ICountDownLatch instance is destroyed, the countdown owner becomes
disconnected, some other thread Thread#interrupt interrupts the current
thread, or the specified waiting time elapses. If the count reaches zero
then the method returns with the value true. If the current thread has
its interrupted status set on entry to this method, or is interrupted
while waiting, then InterruptedException 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.groupId - CP group id of this CountDownLatch instancename - Name of this CountDownLatch instanceinvocationUid - UID of this invocationtimeoutMs - The maximum time in milliseconds to waitvoid countDown(RaftGroupId groupId, String name, UUID invocationUid, int expectedRound)
groupId - CP group id of this CountDownLatch instancename - Name of the CountDownLatch instanceinvocationUid - UID of this invocationexpectedRound - The round this invocation will be performed onObject getCount(RaftGroupId groupId, String name)
groupId - CP group id of this CountDownLatch instancename - Name of the CountDownLatch instanceObject getRound(RaftGroupId groupId, String name)
groupId - CP group id of this CountDownLatch instancename - Name of the CountDownLatch instanceCopyright © 2019. All Rights Reserved.