Interface Future<V>
- All Superinterfaces:
Awaitable,io.netty.util.concurrent.Future<V>,Future<V>,com.google.common.util.concurrent.ListenableFuture<V>
- All Known Subinterfaces:
Promise<V>,RunnableFuture<V>
- All Known Implementing Classes:
AbstractFuture,AsymmetricRemoteSyncTask,AsyncChannelPromise,AsyncFuture,AsyncOneResponse,AsyncPromise,AsyncPromise.WithExecutor,BlockingPartitionRepair,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
public interface Future<V>
extends io.netty.util.concurrent.Future<V>, com.google.common.util.concurrent.ListenableFuture<V>, Awaitable
A Future that integrates several different (but equivalent) APIs used within Cassandra into a single concept,
integrating also with our
Awaitable abstraction, to overall improve coherency and clarity in the codebase.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.concurrent.Awaitable
Awaitable.AbstractAwaitable, Awaitable.AsyncAwaitable, Awaitable.Defaults, Awaitable.SyncAwaitable -
Method Summary
Modifier and TypeMethodDescriptionaddCallback(com.google.common.util.concurrent.FutureCallback<? super V> callback) SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)nativelyaddCallback(com.google.common.util.concurrent.FutureCallback<? super V> callback, Executor executor) SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)nativelyaddCallback(BiConsumer<? super V, Throwable> callback) SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)nativelyaddCallback(BiConsumer<? super V, Throwable> callback, Executor executor) SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)nativelyaddCallback(Consumer<? super V> onSuccess, Consumer<? super Throwable> onFailure) SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)nativelyaddCallback(Consumer<? super V> onSuccess, Consumer<? super Throwable> onFailure, Executor executor) SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)nativelyaddListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> genericFutureListener) voidaddListener(Runnable runnable) Invokerunnableon completion.voidaddListener(Runnable runnable, Executor executor) Invokerunnableon completion, usingexecutor.addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... genericFutureListeners) await()Wait indefinitely for this future to complete, throwing any interruptdefault booleanawait(long l) Deprecated.See CASSANDRA-16924Wait indefinitely for this promise to complete, throwing any interrupt as an UncheckedInterruptedExceptionWait indefinitely for this future to completedefault booleanawaitUninterruptibly(long l) Deprecated.See CASSANDRA-16924default <T> Future<T>SupportFutures.transformAsync(ListenableFuture, AsyncFunction, Executor)natively<T> Future<T>SupportFutures.transformAsync(ListenableFuture, AsyncFunction, Executor)nativelydefault <T> Future<T>SupportFutures.transform(ListenableFuture, com.google.common.base.Function, Executor)natively<T> Future<T>SupportFutures.transform(ListenableFuture, com.google.common.base.Function, Executor)nativelyremoveListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> genericFutureListener) removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... genericFutureListeners) default voidsync()waits for completion; in case of failure rethrows the original exception without a new wrapping exception so may cause problems for reporting stack traceswaits for completion; in case of failure rethrows the original exception without a new wrapping exception so may cause problems for reporting stack traceswaits for completion; in case of failure rethrows the original exception without a new wrapping exception so may cause problems for reporting stack tracesMethods inherited from interface org.apache.cassandra.utils.concurrent.Awaitable
await, awaitThrowUncheckedOnInterrupt, awaitUninterruptibly, awaitUntil, awaitUntilThrowUncheckedOnInterrupt, awaitUntilUninterruptiblyMethods inherited from interface io.netty.util.concurrent.Future
await, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccessMethods inherited from interface java.util.concurrent.Future
get, get, isCancelled, isDone
-
Method Details
-
await
Wait indefinitely for this future to complete, throwing any interrupt- Specified by:
awaitin interfaceAwaitable- Specified by:
awaitin interfaceio.netty.util.concurrent.Future<V>- Throws:
InterruptedException- if interrupted
-
awaitUninterruptibly
Wait indefinitely for this future to complete- Specified by:
awaitUninterruptiblyin interfaceAwaitable- Specified by:
awaitUninterruptiblyin interfaceio.netty.util.concurrent.Future<V>
-
awaitThrowUncheckedOnInterrupt
Wait indefinitely for this promise to complete, throwing any interrupt as an UncheckedInterruptedException- Specified by:
awaitThrowUncheckedOnInterruptin interfaceAwaitable- Throws:
UncheckedInterruptedException- if interrupted
-
rethrowIfFailed
default void rethrowIfFailed() -
sync
waits for completion; in case of failure rethrows the original exception without a new wrapping exception so may cause problems for reporting stack traces- Specified by:
syncin interfaceio.netty.util.concurrent.Future<V>- Throws:
InterruptedException
-
syncUninterruptibly
waits for completion; in case of failure rethrows the original exception without a new wrapping exception so may cause problems for reporting stack traces- Specified by:
syncUninterruptiblyin interfaceio.netty.util.concurrent.Future<V>
-
syncThrowUncheckedOnInterrupt
waits for completion; in case of failure rethrows the original exception without a new wrapping exception so may cause problems for reporting stack traces -
await
Deprecated.See CASSANDRA-16924- Specified by:
awaitin interfaceio.netty.util.concurrent.Future<V>- Throws:
InterruptedException
-
awaitUninterruptibly
Deprecated.See CASSANDRA-16924- Specified by:
awaitUninterruptiblyin interfaceio.netty.util.concurrent.Future<V>
-
addCallback
SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)natively -
addCallback
SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)natively -
addCallback
SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)natively -
addCallback
Future<V> addCallback(com.google.common.util.concurrent.FutureCallback<? super V> callback, Executor executor) SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)natively -
addCallback
SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)natively -
addCallback
Future<V> addCallback(Consumer<? super V> onSuccess, Consumer<? super Throwable> onFailure, Executor executor) SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)natively -
map
SupportFutures.transform(ListenableFuture, com.google.common.base.Function, Executor)natively -
map
SupportFutures.transform(ListenableFuture, com.google.common.base.Function, Executor)natively -
flatMap
SupportFutures.transformAsync(ListenableFuture, AsyncFunction, Executor)natively -
flatMap
SupportFutures.transformAsync(ListenableFuture, AsyncFunction, Executor)natively -
addListener
Invokerunnableon completion, usingexecutor. Tasks are submitted to their executors in the order they were added to this Future.- Specified by:
addListenerin interfacecom.google.common.util.concurrent.ListenableFuture<V>
-
addListener
Invokerunnableon completion. Depending on the implementation and its configuration, this may be executed immediately by the notifying/completing thread, or asynchronously by an executor. Tasks are executed, or submitted to the executor, in the order they were added to this Future. -
notifyExecutor
Executor notifyExecutor() -
addListener
Future<V> addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> genericFutureListener) - Specified by:
addListenerin interfaceio.netty.util.concurrent.Future<V>
-
addListeners
Future<V> addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... genericFutureListeners) - Specified by:
addListenersin interfaceio.netty.util.concurrent.Future<V>
-
removeListener
Future<V> removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> genericFutureListener) - Specified by:
removeListenerin interfaceio.netty.util.concurrent.Future<V>
-
removeListeners
Future<V> removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... genericFutureListeners) - Specified by:
removeListenersin interfaceio.netty.util.concurrent.Future<V>
-