Search in sources :

Example 16 with JobSupervisor

use of com.hazelcast.mapreduce.impl.task.JobSupervisor in project hazelcast by hazelcast.

the class RequestPartitionProcessed method run.

@Override
public void run() throws Exception {
    MapReduceService mapReduceService = getService();
    JobSupervisor supervisor = mapReduceService.getJobSupervisor(getName(), getJobId());
    if (supervisor == null) {
        result = new RequestPartitionResult(NO_SUPERVISOR, -1);
        return;
    }
    JobProcessInformationImpl processInformation = supervisor.getJobProcessInformation();
    JobPartitionState.State nextState = stateChange(getCallerAddress(), partitionId, currentState, processInformation, supervisor.getConfiguration());
    if (nextState == PROCESSED) {
        result = new RequestPartitionResult(SUCCESSFUL, partitionId);
        return;
    }
    result = new RequestPartitionResult(CHECK_STATE_FAILED, -1);
}
Also used : JobPartitionState(com.hazelcast.mapreduce.JobPartitionState) MapReduceService(com.hazelcast.mapreduce.impl.MapReduceService) JobProcessInformationImpl(com.hazelcast.mapreduce.impl.task.JobProcessInformationImpl) JobSupervisor(com.hazelcast.mapreduce.impl.task.JobSupervisor)

Aggregations

JobSupervisor (com.hazelcast.mapreduce.impl.task.JobSupervisor)16 MapReduceService (com.hazelcast.mapreduce.impl.MapReduceService)14 JobPartitionState (com.hazelcast.mapreduce.JobPartitionState)5 JobProcessInformationImpl (com.hazelcast.mapreduce.impl.task.JobProcessInformationImpl)5 AbstractJobTracker (com.hazelcast.mapreduce.impl.AbstractJobTracker)3 Address (com.hazelcast.nio.Address)3 IOException (java.io.IOException)3 CancellationException (java.util.concurrent.CancellationException)3 TrackableJobFuture (com.hazelcast.mapreduce.impl.task.TrackableJobFuture)2 JobProcessInformation (com.hazelcast.mapreduce.JobProcessInformation)1 TopologyChangedException (com.hazelcast.mapreduce.TopologyChangedException)1 TopologyChangedStrategy (com.hazelcast.mapreduce.TopologyChangedStrategy)1 JobTaskConfiguration (com.hazelcast.mapreduce.impl.task.JobTaskConfiguration)1 KeyValueSourceMappingPhase (com.hazelcast.mapreduce.impl.task.KeyValueSourceMappingPhase)1 MappingPhase (com.hazelcast.mapreduce.impl.task.MappingPhase)1 MemberAssigningJobProcessInformationImpl (com.hazelcast.mapreduce.impl.task.MemberAssigningJobProcessInformationImpl)1 NoDataMemberInClusterException (com.hazelcast.partition.NoDataMemberInClusterException)1 IPartitionService (com.hazelcast.spi.partition.IPartitionService)1 HashMap (java.util.HashMap)1