Search in sources :

Example 1 with KeyValueSourceMappingPhase

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

the class StartProcessingJobOperation method run.

@Override
public void run() throws Exception {
    MapReduceService mapReduceService = getService();
    if (mapReduceService.unregisterJobSupervisorCancellation(name, jobId)) {
        // Supervisor was cancelled prior to creation
        AbstractJobTracker jobTracker = (AbstractJobTracker) mapReduceService.getJobTracker(name);
        TrackableJobFuture future = jobTracker.unregisterTrackableJob(jobId);
        if (future != null) {
            Exception exception = new CancellationException("Operation was cancelled by the user");
            future.setResult(exception);
        }
        return;
    }
    JobSupervisor supervisor = mapReduceService.getJobSupervisor(name, jobId);
    if (supervisor == null) {
        return;
    }
    // Create actual mapping operation
    MappingPhase mappingPhase = new KeyValueSourceMappingPhase(keys, predicate);
    supervisor.startTasks(mappingPhase);
}
Also used : MappingPhase(com.hazelcast.mapreduce.impl.task.MappingPhase) KeyValueSourceMappingPhase(com.hazelcast.mapreduce.impl.task.KeyValueSourceMappingPhase) TrackableJobFuture(com.hazelcast.mapreduce.impl.task.TrackableJobFuture) KeyValueSourceMappingPhase(com.hazelcast.mapreduce.impl.task.KeyValueSourceMappingPhase) CancellationException(java.util.concurrent.CancellationException) MapReduceService(com.hazelcast.mapreduce.impl.MapReduceService) AbstractJobTracker(com.hazelcast.mapreduce.impl.AbstractJobTracker) CancellationException(java.util.concurrent.CancellationException) IOException(java.io.IOException) JobSupervisor(com.hazelcast.mapreduce.impl.task.JobSupervisor)

Aggregations

AbstractJobTracker (com.hazelcast.mapreduce.impl.AbstractJobTracker)1 MapReduceService (com.hazelcast.mapreduce.impl.MapReduceService)1 JobSupervisor (com.hazelcast.mapreduce.impl.task.JobSupervisor)1 KeyValueSourceMappingPhase (com.hazelcast.mapreduce.impl.task.KeyValueSourceMappingPhase)1 MappingPhase (com.hazelcast.mapreduce.impl.task.MappingPhase)1 TrackableJobFuture (com.hazelcast.mapreduce.impl.task.TrackableJobFuture)1 IOException (java.io.IOException)1 CancellationException (java.util.concurrent.CancellationException)1