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.Constructor and Description |
---|
TrackableJobFuture(String name,
String jobId,
JobTracker jobTracker,
NodeEngine nodeEngine,
Collator collator) |
Modifier and Type | Method and Description |
---|---|
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 returns null if the underlying job ID is not available because the job is already
finished or has not yet been submitted.It 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 |
void |
setResult(Object result) |
protected boolean |
shouldCancel(boolean mayInterruptIfRunning)
Protected method invoked on cancel().
|
andThen, andThen, cancel, cancelled, done, get, get, getResult, isCancelled, 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>
protected boolean shouldCancel(boolean mayInterruptIfRunning)
AbstractCompletableFuture
shouldCancel
in class AbstractCompletableFuture<V>
mayInterruptIfRunning
- passed through from cancel callpublic 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 job.getCompletableFuture
in interface TrackableJob<V>
public JobProcessInformation getJobProcessInformation()
TrackableJob
JobProcessInformation
to find out the state and
statistics of a running task, or returns null if the underlying job ID is not available because the job is already
finished or has not yet been submitted.getJobProcessInformation
in interface TrackableJob<V>
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.