public static List convertToTimelineEntities()

in tez-plugins/tez-yarn-timeline-history/src/main/java/org/apache/tez/dag/history/logging/ats/HistoryEventTimelineConversion.java [74:139]


  public static List<TimelineEntity> convertToTimelineEntities(HistoryEvent historyEvent) {
    validateEvent(historyEvent);
    switch (historyEvent.getEventType()) {
      case APP_LAUNCHED:
        return Collections.singletonList(convertAppLaunchedEvent((AppLaunchedEvent) historyEvent));
      case AM_LAUNCHED:
        return Collections.singletonList(convertAMLaunchedEvent((AMLaunchedEvent) historyEvent));
      case AM_STARTED:
        return Collections.singletonList(convertAMStartedEvent((AMStartedEvent) historyEvent));
      case CONTAINER_LAUNCHED:
        return Collections.singletonList(
            convertContainerLaunchedEvent((ContainerLaunchedEvent) historyEvent));
      case CONTAINER_STOPPED:
        return Collections.singletonList(
            convertContainerStoppedEvent((ContainerStoppedEvent) historyEvent));
      case DAG_SUBMITTED:
        return Lists.newArrayList(
            convertDAGSubmittedEvent((DAGSubmittedEvent)historyEvent),
            convertDAGSubmittedToDAGExtraInfoEntity((DAGSubmittedEvent)historyEvent));
      case DAG_INITIALIZED:
        return Collections.singletonList(
            convertDAGInitializedEvent((DAGInitializedEvent) historyEvent));
      case DAG_STARTED:
        return Collections.singletonList(convertDAGStartedEvent((DAGStartedEvent) historyEvent));
      case DAG_FINISHED:
        return Lists.newArrayList(
            convertDAGFinishedEvent((DAGFinishedEvent) historyEvent),
            convertDAGFinishedToDAGExtraInfoEntity((DAGFinishedEvent) historyEvent));
      case VERTEX_INITIALIZED:
        return Collections.singletonList(
            convertVertexInitializedEvent((VertexInitializedEvent) historyEvent));
      case VERTEX_STARTED:
        return Collections.singletonList(
            convertVertexStartedEvent((VertexStartedEvent) historyEvent));
      case VERTEX_FINISHED:
        return Collections.singletonList(
            convertVertexFinishedEvent((VertexFinishedEvent) historyEvent));
      case TASK_STARTED:
        return Collections.singletonList(convertTaskStartedEvent((TaskStartedEvent) historyEvent));
      case TASK_FINISHED:
        return Collections.singletonList(
            convertTaskFinishedEvent((TaskFinishedEvent) historyEvent));
      case TASK_ATTEMPT_STARTED:
        return Collections.singletonList(
            convertTaskAttemptStartedEvent((TaskAttemptStartedEvent) historyEvent));
      case TASK_ATTEMPT_FINISHED:
        return Collections.singletonList(
            convertTaskAttemptFinishedEvent((TaskAttemptFinishedEvent) historyEvent));
      case VERTEX_CONFIGURE_DONE:
        return Collections.singletonList(
            convertVertexReconfigureDoneEvent((VertexConfigurationDoneEvent) historyEvent));
      case DAG_RECOVERED:
        return Collections.singletonList(
            convertDAGRecoveredEvent((DAGRecoveredEvent) historyEvent));
      case VERTEX_COMMIT_STARTED:
      case VERTEX_GROUP_COMMIT_STARTED:
      case VERTEX_GROUP_COMMIT_FINISHED:
      case DAG_COMMIT_STARTED:
      case DAG_KILL_REQUEST:
        throw new UnsupportedOperationException("Invalid Event, does not support history"
            + ", eventType=" + historyEvent.getEventType());
        // Do not add default, if a new event type is added, we'll get a warning for the switch.
    }
    throw new UnsupportedOperationException("Unhandled Event, eventType=" +
        historyEvent.getEventType());
  }