use of com.hazelcast.mapreduce.impl.AbstractJobTracker in project hazelcast by hazelcast.
the class KeyValueJob method startSupervisionTask.
private <T> JobCompletableFuture<T> startSupervisionTask(TrackableJobFuture<T> jobFuture, String jobId) {
AbstractJobTracker jobTracker = (AbstractJobTracker) this.jobTracker;
JobTrackerConfig config = jobTracker.getJobTrackerConfig();
boolean communicateStats = config.isCommunicateStats();
if (chunkSize == -1) {
chunkSize = config.getChunkSize();
}
if (topologyChangedStrategy == null) {
topologyChangedStrategy = config.getTopologyChangedStrategy();
}
ClusterService clusterService = nodeEngine.getClusterService();
for (Member member : clusterService.getMembers(KeyValueJobOperation.MEMBER_SELECTOR)) {
Operation operation = new KeyValueJobOperation<KeyIn, ValueIn>(name, jobId, chunkSize, keyValueSource, mapper, combinerFactory, reducerFactory, communicateStats, topologyChangedStrategy);
executeOperation(operation, member.getAddress(), mapReduceService, nodeEngine);
}
// After we prepared all the remote systems we can now start the processing
for (Member member : clusterService.getMembers(DATA_MEMBER_SELECTOR)) {
Operation operation = new StartProcessingJobOperation<KeyIn>(name, jobId, keys, predicate);
executeOperation(operation, member.getAddress(), mapReduceService, nodeEngine);
}
return jobFuture;
}
use of com.hazelcast.mapreduce.impl.AbstractJobTracker in project hazelcast by hazelcast.
the class GetResultOperation method run.
@Override
public void run() throws Exception {
MapReduceService mapReduceService = getService();
JobSupervisor supervisor = mapReduceService.getJobSupervisor(getName(), getJobId());
if (supervisor != null) {
result = supervisor.getJobResults();
// This is the final call so cleanup on all nodes that are not job owners
if (!supervisor.isOwnerNode()) {
mapReduceService.destroyJobSupervisor(supervisor);
AbstractJobTracker jobTracker = (AbstractJobTracker) mapReduceService.getJobTracker(getName());
jobTracker.unregisterTrackableJob(getJobId());
jobTracker.unregisterMapCombineTask(getJobId());
jobTracker.unregisterReducerTask(getJobId());
}
}
}
Aggregations