Search in sources :

Example 1 with AMContainerEventTASucceeded

use of org.apache.tez.dag.app.rm.container.AMContainerEventTASucceeded in project tez by apache.

the class TaskSchedulerManager method handleTASucceeded.

private void handleTASucceeded(AMSchedulerEventTAEnded event) {
    TaskAttempt attempt = event.getAttempt();
    ContainerId usedContainerId = event.getUsedContainerId();
    // assigned to it.
    if (event.getUsedContainerId() != null) {
        sendEvent(new AMContainerEventTASucceeded(usedContainerId, event.getAttemptID()));
        sendEvent(new AMNodeEventTaskAttemptSucceeded(appContext.getAllContainers().get(usedContainerId).getContainer().getNodeId(), event.getSchedulerId(), usedContainerId, event.getAttemptID()));
    }
    boolean wasContainerAllocated = false;
    try {
        wasContainerAllocated = taskSchedulers[event.getSchedulerId()].deallocateTask(attempt, true, null, event.getDiagnostics());
    } catch (Exception e) {
        String msg = "Error in TaskScheduler for handling Task De-allocation" + ", eventType=" + event.getType() + ", scheduler=" + Utils.getTaskSchedulerIdentifierString(event.getSchedulerId(), appContext) + ", taskAttemptId=" + attempt.getID();
        LOG.error(msg, e);
        sendEvent(new DAGAppMasterEventUserServiceFatalError(DAGAppMasterEventType.TASK_SCHEDULER_SERVICE_FATAL_ERROR, msg, e));
        return;
    }
    if (!wasContainerAllocated) {
        LOG.error("De-allocated successful task: " + attempt.getID() + ", but TaskScheduler reported no container assigned to task");
    }
}
Also used : DAGAppMasterEventUserServiceFatalError(org.apache.tez.dag.app.dag.event.DAGAppMasterEventUserServiceFatalError) AMContainerEventTASucceeded(org.apache.tez.dag.app.rm.container.AMContainerEventTASucceeded) ContainerId(org.apache.hadoop.yarn.api.records.ContainerId) AMNodeEventTaskAttemptSucceeded(org.apache.tez.dag.app.rm.node.AMNodeEventTaskAttemptSucceeded) TaskAttempt(org.apache.tez.dag.app.dag.TaskAttempt) TezUncheckedException(org.apache.tez.dag.api.TezUncheckedException) TezException(org.apache.tez.dag.api.TezException)

Aggregations

ContainerId (org.apache.hadoop.yarn.api.records.ContainerId)1 TezException (org.apache.tez.dag.api.TezException)1 TezUncheckedException (org.apache.tez.dag.api.TezUncheckedException)1 TaskAttempt (org.apache.tez.dag.app.dag.TaskAttempt)1 DAGAppMasterEventUserServiceFatalError (org.apache.tez.dag.app.dag.event.DAGAppMasterEventUserServiceFatalError)1 AMContainerEventTASucceeded (org.apache.tez.dag.app.rm.container.AMContainerEventTASucceeded)1 AMNodeEventTaskAttemptSucceeded (org.apache.tez.dag.app.rm.node.AMNodeEventTaskAttemptSucceeded)1