use of com.hazelcast.mapreduce.impl.operation.GetResultOperationFactory in project hazelcast by hazelcast.
the class JobSupervisor method checkFullyProcessed.
public void checkFullyProcessed(JobProcessInformation processInformation) {
if (isOwnerNode()) {
JobPartitionState[] partitionStates = processInformation.getPartitionStates();
for (JobPartitionState partitionState : partitionStates) {
if (partitionState == null || partitionState.getState() != JobPartitionState.State.PROCESSED) {
return;
}
}
final String name = configuration.getName();
final String jobId = configuration.getJobId();
final NodeEngine nodeEngine = configuration.getNodeEngine();
final GetResultOperationFactory operationFactory = new GetResultOperationFactory(name, jobId);
// Get the initial future object to eventually set the result and cleanup
final TrackableJobFuture future = jobTracker.unregisterTrackableJob(jobId);
if (future == null) {
// If already handled just return
return;
}
final JobSupervisor jobSupervisor = this;
Runnable runnable = new GetResultsRunnable(nodeEngine, operationFactory, jobId, jobSupervisor, future);
ExecutionService executionService = nodeEngine.getExecutionService();
ManagedExecutorService executor = executionService.getExecutor(ExecutionService.ASYNC_EXECUTOR);
executor.submit(runnable);
}
}
Aggregations