Search in sources :

Example 1 with TaskStateInternal

use of org.apache.tez.dag.app.dag.TaskStateInternal in project tez by apache.

the class TaskImpl method handle.

@Override
public void handle(TaskEvent event) {
    if (LOG.isDebugEnabled()) {
        LOG.debug("Processing TaskEvent " + event.getTaskID() + " of type " + event.getType() + " while in state " + getInternalState() + ". Event: " + event);
    }
    try {
        writeLock.lock();
        TaskStateInternal oldState = getInternalState();
        try {
            stateMachine.doTransition(event.getType(), event);
        } catch (InvalidStateTransitonException e) {
            LOG.error("Can't handle this event" + event.getType() + " at current state " + oldState + " for task " + this.taskId, e);
            internalError(event.getType());
        } catch (RuntimeException e) {
            LOG.error("Uncaught exception when trying handle event " + event.getType() + " at current state " + oldState + " for task " + this.taskId, e);
            internalErrorUncaughtException(event.getType(), e);
        }
        if (oldState != getInternalState()) {
            if (LOG.isDebugEnabled()) {
                LOG.debug(taskId + " Task Transitioned from " + oldState + " to " + getInternalState() + " due to event " + event.getType());
            }
        }
    } finally {
        writeLock.unlock();
    }
}
Also used : TaskStateInternal(org.apache.tez.dag.app.dag.TaskStateInternal) InvalidStateTransitonException(org.apache.hadoop.yarn.state.InvalidStateTransitonException)

Aggregations

InvalidStateTransitonException (org.apache.hadoop.yarn.state.InvalidStateTransitonException)1 TaskStateInternal (org.apache.tez.dag.app.dag.TaskStateInternal)1