public class RemoteMonitoredFuture<R> extends Object implements MonitoredFuture<R>
Modifier and Type | Field and Description |
---|---|
protected List<CommandHandleInfo> |
handles |
protected ResultMerger<R> |
merger |
protected Object |
MUTEX |
Constructor and Description |
---|
RemoteMonitoredFuture(CommandHandleInfo handle) |
RemoteMonitoredFuture(ResultMerger<R> merger,
List<CommandHandleInfo> handles) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
R |
get() |
R |
get(long duration,
TimeUnit unit) |
R |
getStatus()
Returns the partial status of the
MonitoredCallable or
the final result if the command has completed successfully. |
protected List<CommandHandleInfo> |
handleFailed(CommandHandleInfo handle,
RMIException e) |
boolean |
isCancelled() |
boolean |
isDone() |
protected final ResultMerger<R> merger
protected final Object MUTEX
protected List<CommandHandleInfo> handles
public RemoteMonitoredFuture(CommandHandleInfo handle)
public RemoteMonitoredFuture(ResultMerger<R> merger, List<CommandHandleInfo> handles)
public boolean cancel(boolean mayInterruptIfRunning)
public final R get() throws InterruptedException, ExecutionException
get
in interface Future<R>
InterruptedException
ExecutionException
public final R get(long duration, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<R>
InterruptedException
ExecutionException
TimeoutException
public final boolean isCancelled()
isCancelled
in interface Future<R>
public final R getStatus() throws ExecutionException, InterruptedException
MonitoredFuture
MonitoredCallable
or
the final result if the command has completed successfully. In the event
that the command fails, this will return a status of the command following the exception.
In the case where it is a DistributedCallable
, the result returned by the future
will be the result of calling DistributedCallable.merge(java.util.List)
on the status's or final results.getStatus
in interface MonitoredFuture<R>
ExecutionException
- if there was an (I/O) error fetching the status.InterruptedException
- if interrupted while waiting for the status. Note that getStatus
does not block in the end-to-end sense, but does block waiting for network IO so it can potentially
throw InterruptedExceptionprotected List<CommandHandleInfo> handleFailed(CommandHandleInfo handle, RMIException e) throws ExecutionException
handle
- e
- ExecutionException
Copyright © 2016 Actian Corporation. All Rights Reserved.