use of org.apache.hyracks.control.cc.job.TaskAttempt in project asterixdb by apache.
the class JobExecutor method notifyTaskComplete.
public void notifyTaskComplete(TaskAttempt ta) throws HyracksException {
TaskAttemptId taId = ta.getTaskAttemptId();
TaskCluster tc = ta.getTask().getTaskCluster();
TaskClusterAttempt lastAttempt = findLastTaskClusterAttempt(tc);
if (lastAttempt == null || taId.getAttempt() != lastAttempt.getAttempt()) {
LOGGER.warning("Ignoring task complete notification: " + taId + " -- Current last attempt = " + lastAttempt);
return;
}
TaskAttempt.TaskStatus taStatus = ta.getStatus();
if (taStatus != TaskAttempt.TaskStatus.RUNNING) {
LOGGER.warning("Spurious task complete notification: " + taId + " Current state = " + taStatus);
return;
}
ta.setStatus(TaskAttempt.TaskStatus.COMPLETED, null);
ta.setEndTime(System.currentTimeMillis());
if (lastAttempt.decrementPendingTasksCounter() == 0) {
lastAttempt.setStatus(TaskClusterAttempt.TaskClusterStatus.COMPLETED);
lastAttempt.setEndTime(System.currentTimeMillis());
inProgressTaskClusters.remove(tc);
startRunnableActivityClusters();
}
}
Aggregations