com.hazelcast.mapreduce.impl.task
Class JobSupervisor

java.lang.Object
  extended by com.hazelcast.mapreduce.impl.task.JobSupervisor

public class JobSupervisor
extends Object

The JobSupervisor is the overall control instance of a map reduce job. There is one JobSupervisor per unique name-jobId combination and per cluster member.
The emitting cluster member's JobSupervisor has a special control function to synchronize the work of the other "worker-members" that only execute the task. This job owner node also assigns reducing members to keys and checks for topology changes that hurt the currently running job and enforces the rules set by the TopologyChangedStrategy in case of a topology change situation.


Constructor Summary
JobSupervisor(JobTaskConfiguration configuration, AbstractJobTracker jobTracker, boolean ownerNode, MapReduceService mapReduceService)
           
 
Method Summary
 Address assignKeyReducerAddress(Object key)
           
 boolean assignKeyReducerAddress(Object key, Address address)
           
 TrackableJobFuture cancel()
           
 boolean cancelAndNotify(Exception exception)
           
 boolean checkAssignedMembersAvailable()
           
 void checkFullyProcessed(JobProcessInformation processInformation)
           
 JobTaskConfiguration getConfiguration()
           
 Address getJobOwner()
           
 JobProcessInformationImpl getJobProcessInformation()
           
 Map<Object,Object> getJobResults()
           
 JobTracker getJobTracker()
           
 MapReduceService getMapReduceService()
           
<K,V> DefaultContext<K,V>
getOrCreateContext(MapCombineTask mapCombineTask)
           
 Address getReducerAddressByKey(Object key)
           
<KeyIn,ValueIn,ValueOut>
Reducer<ValueIn,ValueOut>
getReducerByKey(Object key)
           
 Collection<Address> getReducerEventInterests(int partitionId)
           
 boolean isOwnerNode()
           
 void notifyRemoteException(Address remoteAddress, Throwable throwable)
           
 void onNotification(MapReduceNotification notification)
           
 void registerReducerEventInterests(int partitionId, Set<Address> remoteReducers)
           
 void startTasks(MappingPhase mappingPhase)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobSupervisor

public JobSupervisor(JobTaskConfiguration configuration,
                     AbstractJobTracker jobTracker,
                     boolean ownerNode,
                     MapReduceService mapReduceService)
Method Detail

getMapReduceService

public MapReduceService getMapReduceService()

getJobTracker

public JobTracker getJobTracker()

startTasks

public void startTasks(MappingPhase mappingPhase)

onNotification

public void onNotification(MapReduceNotification notification)

notifyRemoteException

public void notifyRemoteException(Address remoteAddress,
                                  Throwable throwable)

cancelAndNotify

public boolean cancelAndNotify(Exception exception)

cancel

public TrackableJobFuture cancel()

getJobResults

public Map<Object,Object> getJobResults()

getReducerByKey

public <KeyIn,ValueIn,ValueOut> Reducer<ValueIn,ValueOut> getReducerByKey(Object key)

getReducerAddressByKey

public Address getReducerAddressByKey(Object key)

assignKeyReducerAddress

public Address assignKeyReducerAddress(Object key)

checkAssignedMembersAvailable

public boolean checkAssignedMembersAvailable()

assignKeyReducerAddress

public boolean assignKeyReducerAddress(Object key,
                                       Address address)

checkFullyProcessed

public void checkFullyProcessed(JobProcessInformation processInformation)

getOrCreateContext

public <K,V> DefaultContext<K,V> getOrCreateContext(MapCombineTask mapCombineTask)

registerReducerEventInterests

public void registerReducerEventInterests(int partitionId,
                                          Set<Address> remoteReducers)

getReducerEventInterests

public Collection<Address> getReducerEventInterests(int partitionId)

getJobProcessInformation

public JobProcessInformationImpl getJobProcessInformation()

getJobOwner

public Address getJobOwner()

isOwnerNode

public boolean isOwnerNode()

getConfiguration

public JobTaskConfiguration getConfiguration()


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