List<TaskInProgress> maps = job.getSpeculativeCandidates(TaskType.MAP);
if (maps != null) {
for (TaskInProgress tip : maps) {
if (!speculatedMaps.contains(tip)) {
// Speculate the tip
ResourceRequest req =
resourceTracker.newMapRequest(tip.getSplitLocations());
excludeHostsUnprotected(req, tip);
registerNewRequestForTip(tip, req);
}
}
speculatedMaps.clear();
speculatedMaps.addAll(maps);
}
List<TaskInProgress> reduces = job
.getSpeculativeCandidates(TaskType.REDUCE);
if (reduces != null) {
for (TaskInProgress tip : reduces) {
if (!speculatedReduces.contains(tip)) {
// Speculate the tip
ResourceRequest req = resourceTracker.newReduceRequest();
excludeHostsUnprotected(req, tip);
registerNewRequestForTip(tip, req);
}
}
speculatedReduces.clear();