V
- type of the resulting valuepublic class TrackableJobFuture<V> extends AbstractCompletableFuture<V> implements TrackableJob<V>, JobCompletableFuture<V>
ICompletableFuture
and is returned to the users codebase. It hides the exposed JobPartitionState array from
JobProcessInformationImpl
by wrapping it into an adapter
that creates a full copy prior to returning it to the end user.nodeEngine, NULL_VALUE, result, resultUpdater
Constructor and Description |
---|
TrackableJobFuture(String name,
String jobId,
JobTracker jobTracker,
NodeEngine nodeEngine,
Collator collator) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
V |
get(long timeout,
TimeUnit unit) |
ICompletableFuture<V> |
getCompletableFuture()
Returns the
ICompletableFuture to add callbacks
or wait for the resulting value of the tracked job |
String |
getJobId()
Returns the unique job id of the tracked job
|
JobProcessInformation |
getJobProcessInformation()
Returns an instance of
JobProcessInformation to find out the state and
statistics of a running task or null if the underlying job id is not available because job is already
finished or not yet submitted.It even returns null if not requested on the job issuing cluster member or client since those values are not distributed to all clusters for traffic reasons. |
JobTracker |
getJobTracker()
Returns the assigned
JobTracker |
String |
getName()
Returns the name of the underlying
JobTracker |
boolean |
isCancelled() |
void |
setResult(Object result) |
andThen, andThen, fireCallbacks, get, getAsyncExecutor, getResult, isDone
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
andThen, andThen
public TrackableJobFuture(String name, String jobId, JobTracker jobTracker, NodeEngine nodeEngine, Collator collator)
public void setResult(Object result)
setResult
in class AbstractCompletableFuture<V>
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<V>
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<V>
InterruptedException
ExecutionException
TimeoutException
public JobTracker getJobTracker()
TrackableJob
JobTracker
getJobTracker
in interface TrackableJob<V>
public String getName()
TrackableJob
JobTracker
getName
in interface TrackableJob<V>
public String getJobId()
TrackableJob
getJobId
in interface JobCompletableFuture<V>
getJobId
in interface TrackableJob<V>
public ICompletableFuture<V> getCompletableFuture()
TrackableJob
ICompletableFuture
to add callbacks
or wait for the resulting value of the tracked jobgetCompletableFuture
in interface TrackableJob<V>
public JobProcessInformation getJobProcessInformation()
TrackableJob
JobProcessInformation
to find out the state and
statistics of a running task or null if the underlying job id is not available because job is already
finished or not yet submitted.getJobProcessInformation
in interface TrackableJob<V>
Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.