use of com.hazelcast.mapreduce.impl.task.JobTaskConfiguration in project hazelcast by hazelcast.
the class KeyValueJobOperation method run.
@Override
public void run() throws Exception {
MapReduceService mapReduceService = getService();
Address jobOwner = getCallerAddress();
if (jobOwner == null) {
jobOwner = getNodeEngine().getThisAddress();
}
// Inject managed context
injectManagedContext(mapper, combinerFactory, reducerFactory, keyValueSource);
// Build immutable configuration
JobTaskConfiguration config = new JobTaskConfiguration(jobOwner, getNodeEngine(), chunkSize, name, jobId, mapper, combinerFactory, reducerFactory, keyValueSource, communicateStats, topologyChangedStrategy);
JobSupervisor supervisor = mapReduceService.createJobSupervisor(config);
if (supervisor == null) {
// 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);
}
}
}
Aggregations