public final class VortexFuture<TOutput> extends Object implements Future<TOutput>, VortexFutureDelegate<TOutput>
| Constructor and Description |
|---|
VortexFuture(Executor executor,
VortexMaster vortexMaster,
int taskletId)
Creates a
VortexFuture. |
VortexFuture(Executor executor,
VortexMaster vortexMaster,
int taskletId,
FutureCallback<TOutput> callbackHandler)
Creates a
VortexFuture with a callback. |
| Modifier and Type | Method and Description |
|---|---|
void |
aggregationCompleted(List<Integer> taskletIds,
TOutput result)
VortexMaster should never call this.
|
void |
aggregationThrewException(List<Integer> taskletIds,
Exception exception)
VortexMaster should never call this.
|
boolean |
cancel(boolean mayInterruptIfRunning)
Sends a cancel signal and blocks and waits until the task is cancelled, completed, or failed.
|
boolean |
cancel(boolean mayInterruptIfRunning,
long timeout,
TimeUnit unit)
Sends a cancel signal and blocks and waits until the task is cancelled, completed, or failed, or
if the timeout has expired.
|
void |
cancelled(int pTaskletId)
Called by VortexMaster to let the user know that the Tasklet was cancelled.
|
void |
completed(int pTaskletId,
TOutput result)
Called by VortexMaster to let the user know that the Tasklet completed.
|
TOutput |
get()
Infinitely wait for the result of the task.
|
TOutput |
get(long timeout,
TimeUnit unit)
Wait a certain period of time for the result of the task.
|
boolean |
isCancelled() |
boolean |
isDone() |
void |
threwException(int pTaskletId,
Exception exception)
Called by VortexMaster to let the user know that the Tasklet threw an exception.
|
public VortexFuture(Executor executor, VortexMaster vortexMaster, int taskletId)
VortexFuture.public VortexFuture(Executor executor, VortexMaster vortexMaster, int taskletId, FutureCallback<TOutput> callbackHandler)
VortexFuture with a callback.public boolean cancel(boolean mayInterruptIfRunning)
public boolean cancel(boolean mayInterruptIfRunning, long timeout, TimeUnit unit) throws TimeoutException
TimeoutExceptionpublic boolean isCancelled()
isCancelled in interface Future<TOutput>public boolean isDone()
public TOutput get() throws InterruptedException, ExecutionException, CancellationException
get in interface Future<TOutput>InterruptedException - if the thread is interrupted.ExecutionException - if the Tasklet execution failed to complete.CancellationException - if the Tasklet was cancelled.public TOutput get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException, CancellationException
get in interface Future<TOutput>TimeoutException - if the timeout provided hits before the Tasklet is done.InterruptedException - if the thread is interrupted.ExecutionException - if the Tasklet execution failed to complete.CancellationException - if the Tasklet was cancelled.public void completed(int pTaskletId, TOutput result)
completed in interface VortexFutureDelegate<TOutput>public void aggregationCompleted(List<Integer> taskletIds, TOutput result)
aggregationCompleted in interface VortexFutureDelegate<TOutput>public void threwException(int pTaskletId, Exception exception)
threwException in interface VortexFutureDelegate<TOutput>public void aggregationThrewException(List<Integer> taskletIds, Exception exception)
aggregationThrewException in interface VortexFutureDelegate<TOutput>public void cancelled(int pTaskletId)
cancelled in interface VortexFutureDelegate<TOutput>Copyright © 2017 The Apache Software Foundation. All rights reserved.