Package org.apache.tez.dag.history.events

Examples of org.apache.tez.dag.history.events.TaskAttemptFinishedEvent


  @SuppressWarnings("unchecked")
  protected void logJobHistoryAttemptFinishedEvent(TaskAttemptStateInternal state) {
    //Log finished events only if an attempt started.
    if (getLaunchTime() == 0) return;

    TaskAttemptFinishedEvent finishEvt = new TaskAttemptFinishedEvent(
        attemptId, getTask().getVertex().getName(), getLaunchTime(),
        getFinishTime(), TaskAttemptState.SUCCEEDED, "",
        getCounters());
    // FIXME how do we store information regd completion events
    eventHandler.handle(new DAGHistoryEvent(finishEvt));
View Full Code Here


  }

  @SuppressWarnings("unchecked")
  protected void logJobHistoryAttemptUnsuccesfulCompletion(
      TaskAttemptState state) {
    TaskAttemptFinishedEvent finishEvt = new TaskAttemptFinishedEvent(
        attemptId, getTask().getVertex().getName(), getLaunchTime(),
        clock.getTime(), state,
        StringUtils.join(
            LINE_SEPARATOR, getDiagnostics()),
        getCounters());
View Full Code Here

    task.restoreFromEvent(new TaskStartedEvent(taskId, "v1", 0, 0));
    for (int i = 0; i < maxFailedAttempts; ++i) {
      TezTaskAttemptID attemptId = getNewTaskAttemptID(lastTaskId);
      task.restoreFromEvent(new TaskAttemptStartedEvent(attemptId, "v1", 0,
          mockContainerId, mockNodeId, "", ""));
      task.restoreFromEvent(new TaskAttemptFinishedEvent(attemptId, "v1", 0, 0,
          TaskAttemptState.KILLED, "", null));
    }
    assertEquals(maxFailedAttempts, task.getAttempts().size());
    assertEquals(0, task.failedAttempts);
View Full Code Here

    task.restoreFromEvent(new TaskStartedEvent(taskId, "v1", 0, 0));
    for (int i = 0; i < maxFailedAttempts; ++i) {
      TezTaskAttemptID attemptId = getNewTaskAttemptID(lastTaskId);
      task.restoreFromEvent(new TaskAttemptStartedEvent(attemptId, "v1", 0,
          mockContainerId, mockNodeId, "", ""));
      task.restoreFromEvent(new TaskAttemptFinishedEvent(attemptId, "v1", 0, 0,
          TaskAttemptState.FAILED, "", null));
    }
    assertEquals(maxFailedAttempts, task.getAttempts().size());
    assertEquals(maxFailedAttempts, task.failedAttempts);
View Full Code Here

    task.restoreFromEvent(new TaskStartedEvent(taskId, "v1", 0, 0));
    for (int i = 0; i < maxFailedAttempts - 1; ++i) {
      TezTaskAttemptID attemptId = getNewTaskAttemptID(lastTaskId);
      task.restoreFromEvent(new TaskAttemptStartedEvent(attemptId, "v1", 0,
          mockContainerId, mockNodeId, "", ""));
      task.restoreFromEvent(new TaskAttemptFinishedEvent(attemptId, "v1", 0, 0,
          TaskAttemptState.FAILED, "", null));
    }
    assertEquals(maxFailedAttempts - 1, task.getAttempts().size());
    assertEquals(maxFailedAttempts - 1, task.failedAttempts);
View Full Code Here

        case TASK_ATTEMPT_STARTED:
          event = new TaskAttemptStartedEvent(tezTaskAttemptID, "v1", random.nextInt(), containerId,
              nodeId, null, null);
          break;
        case TASK_ATTEMPT_FINISHED:
          event = new TaskAttemptFinishedEvent(tezTaskAttemptID, "v1", random.nextInt(),
              random.nextInt(), TaskAttemptState.FAILED, null, null);
          break;
        case CONTAINER_LAUNCHED:
          event = new ContainerLaunchedEvent(containerId, random.nextInt(),
              applicationAttemptId);
View Full Code Here

      {
        if (!recoveryStartEventSeen) {
          throw new RuntimeException("Finished Event seen but"
              + " no Started Event was encountered earlier");
        }
        TaskAttemptFinishedEvent tEvent = (TaskAttemptFinishedEvent) historyEvent;
        this.finishTime = tEvent.getFinishTime();
        this.reportedStatus.counters = tEvent.getCounters();
        this.reportedStatus.progress = 1f;
        this.reportedStatus.state = tEvent.getState();
        this.diagnostics.add(tEvent.getDiagnostics());
        this.recoveredState = tEvent.getState();
        return recoveredState;
      }
      default:
        throw new RuntimeException("Unexpected event received for restoring"
            + " state, eventType=" + historyEvent.getEventType());
View Full Code Here

  @SuppressWarnings("unchecked")
  protected void logJobHistoryAttemptFinishedEvent(TaskAttemptStateInternal state) {
    //Log finished events only if an attempt started.
    if (getLaunchTime() == 0) return;

    TaskAttemptFinishedEvent finishEvt = new TaskAttemptFinishedEvent(
        attemptId, getTask().getVertex().getName(), getLaunchTime(),
        getFinishTime(), TaskAttemptState.SUCCEEDED, "",
        getCounters());
    // FIXME how do we store information regd completion events
    this.appContext.getHistoryHandler().handle(
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  protected void logJobHistoryAttemptUnsuccesfulCompletion(
      TaskAttemptState state) {
    TaskAttemptFinishedEvent finishEvt = new TaskAttemptFinishedEvent(
        attemptId, getTask().getVertex().getName(), getLaunchTime(),
        clock.getTime(), state,
        StringUtils.join(
            LINE_SEPARATOR, getDiagnostics()),
        getCounters());
View Full Code Here

        break;
      case TASK_ATTEMPT_STARTED:
        event = new TaskAttemptStartedEvent();
        break;
      case TASK_ATTEMPT_FINISHED:
        event = new TaskAttemptFinishedEvent();
        break;
      case VERTEX_DATA_MOVEMENT_EVENTS_GENERATED:
        event = new VertexDataMovementEventsGeneratedEvent();
        break;
      default:
View Full Code Here

TOP

Related Classes of org.apache.tez.dag.history.events.TaskAttemptFinishedEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.