com.hazelcast.mapreduce.impl
Class AbstractJobTracker

java.lang.Object
  extended by com.hazelcast.mapreduce.impl.AbstractJobTracker
All Implemented Interfaces:
DistributedObject, JobTracker

public abstract class AbstractJobTracker
extends Object
implements JobTracker

This is the base class for all JobTracker implementations on node and client side.
It combines a lot of the base functionality to handle remote operations.


Field Summary
protected  ExecutorService executorService
           
protected  JobTrackerConfig jobTrackerConfig
           
protected  ConcurrentMap<String,MapCombineTask> mapCombineTasks
           
protected  MapReduceService mapReduceService
           
protected  String name
           
protected  NodeEngine nodeEngine
           
protected  ConcurrentMap<String,ReducerTask> reducerTasks
           
protected  ConcurrentMap<String,TrackableJobFuture> trackableJobs
           
 
Method Summary
 void destroy()
          Destroys this object cluster-wide.
 Object getId()
          Returns the unique id for this object.
 JobTrackerConfig getJobTrackerConfig()
           
<KeyIn,ValueIn,KeyOut,ValueOut,Chunk>
MapCombineTask<KeyIn,ValueIn,KeyOut,ValueOut,Chunk>
getMapCombineTask(String jobId)
           
 String getName()
          Returns the unique name for this DistributedObject.
 String getPartitionKey()
          Returns the key of the partition that this DistributedObject is assigned to.
<Key,Chunk>
ReducerTask<Key,Chunk>
getReducerTask(String jobId)
           
 String getServiceName()
          Returns the service name for this object.
<V> TrackableJobFuture<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.
<KeyIn,ValueIn,KeyOut,ValueOut,Chunk>
void
registerMapCombineTask(MapCombineTask<KeyIn,ValueIn,KeyOut,ValueOut,Chunk> mapCombineTask)
           
<Key,Chunk>
void
registerReducerTask(ReducerTask<Key,Chunk> reducerTask)
           
<V> boolean
registerTrackableJob(TrackableJobFuture<V> trackableJob)
           
 MapCombineTask unregisterMapCombineTask(String jobId)
           
 ReducerTask unregisterReducerTask(String jobId)
           
<V> TrackableJobFuture<V>
unregisterTrackableJob(String jobId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.hazelcast.mapreduce.JobTracker
newJob
 

Field Detail

trackableJobs

protected final ConcurrentMap<String,TrackableJobFuture> trackableJobs

reducerTasks

protected final ConcurrentMap<String,ReducerTask> reducerTasks

mapCombineTasks

protected final ConcurrentMap<String,MapCombineTask> mapCombineTasks

nodeEngine

protected final NodeEngine nodeEngine

executorService

protected final ExecutorService executorService

mapReduceService

protected final MapReduceService mapReduceService

jobTrackerConfig

protected final JobTrackerConfig jobTrackerConfig

name

protected final String name
Method Detail

destroy

public void destroy()
Description copied from interface: DistributedObject
Destroys this object cluster-wide. Clears and releases all resources for this object.

Specified by:
destroy in interface DistributedObject

getId

public Object getId()
Description copied from interface: DistributedObject
Returns the unique id for this object.

Specified by:
getId in interface DistributedObject
Returns:
id the of this instance

getPartitionKey

public String getPartitionKey()
Description copied from interface: DistributedObject
Returns the key of the partition that this DistributedObject is assigned to. The returned value only has meaning for a non-partitioned data structure like an IAtomicLong. For a partitioned data structure like an IMap, the returned value will not be null, but otherwise undefined.

Specified by:
getPartitionKey in interface DistributedObject
Returns:
the partition key.

getName

public final String getName()
Description copied from interface: DistributedObject
Returns the unique name for this DistributedObject. The returned value will never be null.

Specified by:
getName in interface DistributedObject
Returns:
the unique name for this object.

getServiceName

public final String getServiceName()
Description copied from interface: DistributedObject
Returns the service name for this object.

Specified by:
getServiceName in interface DistributedObject
Returns:
the service name for this object.

getJobTrackerConfig

public JobTrackerConfig getJobTrackerConfig()

registerTrackableJob

public <V> boolean registerTrackableJob(TrackableJobFuture<V> trackableJob)

unregisterTrackableJob

public <V> TrackableJobFuture<V> unregisterTrackableJob(String jobId)

getTrackableJob

public <V> TrackableJobFuture<V> getTrackableJob(String jobId)
Description copied from interface: JobTracker
Returns an implementation of TrackableJob if the job or null if the job id is not available or is already finished.

Specified by:
getTrackableJob in interface JobTracker
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

registerReducerTask

public <Key,Chunk> void registerReducerTask(ReducerTask<Key,Chunk> reducerTask)

unregisterReducerTask

public ReducerTask unregisterReducerTask(String jobId)

getReducerTask

public <Key,Chunk> ReducerTask<Key,Chunk> getReducerTask(String jobId)

registerMapCombineTask

public <KeyIn,ValueIn,KeyOut,ValueOut,Chunk> void registerMapCombineTask(MapCombineTask<KeyIn,ValueIn,KeyOut,ValueOut,Chunk> mapCombineTask)

unregisterMapCombineTask

public MapCombineTask unregisterMapCombineTask(String jobId)

getMapCombineTask

public <KeyIn,ValueIn,KeyOut,ValueOut,Chunk> MapCombineTask<KeyIn,ValueIn,KeyOut,ValueOut,Chunk> getMapCombineTask(String jobId)


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