Interface Awaitable
-
- All Known Subinterfaces:
Condition,ConditionAsConsumer<T>,CountDownLatch,Future<V>,Promise<V>,RunnableFuture<V>,WaitQueue.Signal
- All Known Implementing Classes:
AbstractFuture,AsymmetricRemoteSyncTask,AsyncChannelPromise,AsyncFuture,AsyncOneResponse,AsyncPromise,AsyncPromise.WithExecutor,Awaitable.AbstractAwaitable,Awaitable.AsyncAwaitable,Awaitable.SyncAwaitable,BlockingPartitionRepair,Condition.Async,Condition.Sync,ConditionAsConsumer.Async,CountDownLatch.Async,CountDownLatch.Sync,FutureCombiner,FutureTask,FutureTaskWithResources,ImmediateFuture,LocalSyncTask,PaxosCleanup,PaxosCleanupComplete,PaxosCleanupLocalCoordinator,PaxosCleanupSession,PaxosFinishPrepareCleanup,PaxosStartPrepareCleanup,RepairJob,RepairSession,Scheduler.Task,SnapshotTask,StreamResultFuture,SymmetricRemoteSyncTask,SyncFuture,SyncFutureTask,SyncPromise,SyncPromise.WithExecutor,SyncTask,ValidationTask,WaitQueue.Standard.AbstractSignal
public interface AwaitableA generic signal consumer, supporting all of the typical patterns used in Cassandra. All of the methods defined inAwaitablemay be waited on without a loop, as this interface declares that there are no spurious wake-ups.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAwaitable.AbstractAwaitablestatic classAwaitable.AsyncAwaitableA barebones asynchronousAwaitable.static classAwaitable.Defaultsstatic classAwaitable.SyncAwaitableA barebonesAwaitablethat uses mutual exclusion.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Awaitableawait()Await indefinitely, throwing any interrupt.booleanawait(long time, java.util.concurrent.TimeUnit units)Await for the specified period, throwing any interrupt.AwaitableawaitThrowUncheckedOnInterrupt()Await indefinitely, throwing any interrupt as an unchecked exception.booleanawaitThrowUncheckedOnInterrupt(long time, java.util.concurrent.TimeUnit units)Await for the specified period, throwing any interrupt as an unchecked exception.AwaitableawaitUninterruptibly()Await indefinitely, ignoring interrupts (but maintaining the interrupt flag on exit).booleanawaitUninterruptibly(long time, java.util.concurrent.TimeUnit units)Await until the deadline (in nanoTime), ignoring interrupts (but maintaining the interrupt flag on exit).booleanawaitUntil(long nanoTimeDeadline)Await until the deadline (in nanoTime), throwing any interrupt.booleanawaitUntilThrowUncheckedOnInterrupt(long nanoTimeDeadline)Await until the deadline (in nanoTime), throwing any interrupt as an unchecked exception.booleanawaitUntilUninterruptibly(long nanoTimeDeadline)Await until the deadline (in nanoTime), ignoring interrupts (but maintaining the interrupt flag on exit).
-
-
-
Method Detail
-
awaitUntil
boolean awaitUntil(long nanoTimeDeadline) throws java.lang.InterruptedExceptionAwait until the deadline (in nanoTime), throwing any interrupt. No spurious wakeups.- Returns:
- true if we were signalled, false if the deadline elapsed
- Throws:
java.lang.InterruptedException- if interrupted
-
awaitUntilThrowUncheckedOnInterrupt
boolean awaitUntilThrowUncheckedOnInterrupt(long nanoTimeDeadline) throws UncheckedInterruptedExceptionAwait until the deadline (in nanoTime), throwing any interrupt as an unchecked exception. No spurious wakeups.- Returns:
- true if we were signalled, false if the deadline elapsed
- Throws:
UncheckedInterruptedException- if interrupted
-
awaitUntilUninterruptibly
boolean awaitUntilUninterruptibly(long nanoTimeDeadline)
Await until the deadline (in nanoTime), ignoring interrupts (but maintaining the interrupt flag on exit). No spurious wakeups.- Returns:
- true if we were signalled, false if the deadline elapsed
-
await
boolean await(long time, java.util.concurrent.TimeUnit units) throws java.lang.InterruptedExceptionAwait for the specified period, throwing any interrupt. No spurious wakeups.- Returns:
- true if we were signalled, false if the timeout elapses
- Throws:
java.lang.InterruptedException- if interrupted
-
awaitThrowUncheckedOnInterrupt
boolean awaitThrowUncheckedOnInterrupt(long time, java.util.concurrent.TimeUnit units) throws UncheckedInterruptedExceptionAwait for the specified period, throwing any interrupt as an unchecked exception. No spurious wakeups.- Returns:
- true if we were signalled, false if the timeout elapses
- Throws:
UncheckedInterruptedException- if interrupted
-
awaitUninterruptibly
boolean awaitUninterruptibly(long time, java.util.concurrent.TimeUnit units)Await until the deadline (in nanoTime), ignoring interrupts (but maintaining the interrupt flag on exit). No spurious wakeups.- Returns:
- true if we were signalled, false if the timeout elapses
-
await
Awaitable await() throws java.lang.InterruptedException
Await indefinitely, throwing any interrupt. No spurious wakeups.- Throws:
java.lang.InterruptedException- if interrupted
-
awaitThrowUncheckedOnInterrupt
Awaitable awaitThrowUncheckedOnInterrupt() throws UncheckedInterruptedException
Await indefinitely, throwing any interrupt as an unchecked exception. No spurious wakeups.- Throws:
UncheckedInterruptedException- if interrupted
-
awaitUninterruptibly
Awaitable awaitUninterruptibly()
Await indefinitely, ignoring interrupts (but maintaining the interrupt flag on exit). No spurious wakeups.
-
-