com.hazelcast.mapreduce
Interface JobTracker

All Superinterfaces:
DistributedObject
All Known Implementing Classes:
AbstractJobTracker, ClientMapReduceProxy

@Beta
public interface JobTracker
extends DistributedObject

The JobTracker interface is used to create instances of Jobs depending on the given data structure / data source.

The underlying created instance of the Job depends on whether it is used for a HazelcastClient or a Hazelcast member node.

The default usage is same for both cases and looks similar to the following example:

 HazelcastInstance hz = getHazelcastInstance();
 IMap map = hz.getMap( getMapName() );
 JobTracker tracker = hz.getJobTracker( "default" );
 Job job = tracker.newJob( KeyValueSource.fromMap( map ) );
 

The created instance of JobTracker is fully threadsafe and can be used concurrently and multiple times.
Caution: Do not use the JobTracker with data structures of other HazelcastInstance instances than the one used for creation of the JobTracker. Unexpected results may happen!

Since:
3.2

Method Summary
<V> TrackableJob<V>
getTrackableJob(String jobId)
          Returns an implementation of TrackableJob if the job or null if the job id is not available or is already finished.
<K,V> Job<K,V>
newJob(KeyValueSource<K,V> source)
          Builds a Job instance for the given KeyValueSource instance.
 
Methods inherited from interface com.hazelcast.core.DistributedObject
destroy, getId, getName, getPartitionKey, getServiceName
 

Method Detail

newJob

<K,V> Job<K,V> newJob(KeyValueSource<K,V> source)
Builds a Job instance for the given KeyValueSource instance. The returning implementation is depending on the HazelcastInstance that was creating the JobTracker.
Caution: Do not use the JobTracker with data structures of other HazelcastInstance instances than the one used for creation of the JobTracker. Unexpected results may happen!

Type Parameters:
K - type of the key
V - type of the value
Parameters:
source - data source the created Job should work on
Returns:
instance of the Job bound to the given KeyValueSource

getTrackableJob

<V> TrackableJob<V> getTrackableJob(String jobId)
Returns an implementation of TrackableJob if the job or null if the job id is not available or is already finished.

Type Parameters:
V - type of the resulting value
Parameters:
jobId - job id to search the TrackableJob for
Returns:
a trackable job for given job id or null if job id is not available


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.