in tez-dag/src/main/java/org/apache/tez/dag/history/logging/impl/HistoryEventJsonConversion.java [47:112]
public static JSONObject convertToJson(HistoryEvent historyEvent) throws JSONException {
if (!historyEvent.isHistoryEvent()) {
throw new UnsupportedOperationException("Invalid Event, does not support history"
+ ", eventType=" + historyEvent.getEventType());
}
JSONObject jsonObject = null;
switch (historyEvent.getEventType()) {
case AM_LAUNCHED:
jsonObject = convertAMLaunchedEvent((AMLaunchedEvent) historyEvent);
break;
case AM_STARTED:
jsonObject = convertAMStartedEvent((AMStartedEvent) historyEvent);
break;
case CONTAINER_LAUNCHED:
jsonObject = convertContainerLaunchedEvent((ContainerLaunchedEvent) historyEvent);
break;
case CONTAINER_STOPPED:
jsonObject = convertContainerStoppedEvent((ContainerStoppedEvent) historyEvent);
break;
case DAG_SUBMITTED:
jsonObject = convertDAGSubmittedEvent((DAGSubmittedEvent) historyEvent);
break;
case DAG_INITIALIZED:
jsonObject = convertDAGInitializedEvent((DAGInitializedEvent) historyEvent);
break;
case DAG_STARTED:
jsonObject = convertDAGStartedEvent((DAGStartedEvent) historyEvent);
break;
case DAG_FINISHED:
jsonObject = convertDAGFinishedEvent((DAGFinishedEvent) historyEvent);
break;
case VERTEX_INITIALIZED:
jsonObject = convertVertexInitializedEvent((VertexInitializedEvent) historyEvent);
break;
case VERTEX_STARTED:
jsonObject = convertVertexStartedEvent((VertexStartedEvent) historyEvent);
break;
case VERTEX_FINISHED:
jsonObject = convertVertexFinishedEvent((VertexFinishedEvent) historyEvent);
break;
case TASK_STARTED:
jsonObject = convertTaskStartedEvent((TaskStartedEvent) historyEvent);
break;
case TASK_FINISHED:
jsonObject = convertTaskFinishedEvent((TaskFinishedEvent) historyEvent);
break;
case TASK_ATTEMPT_STARTED:
jsonObject = convertTaskAttemptStartedEvent((TaskAttemptStartedEvent) historyEvent);
break;
case TASK_ATTEMPT_FINISHED:
jsonObject = convertTaskAttemptFinishedEvent((TaskAttemptFinishedEvent) historyEvent);
break;
case VERTEX_DATA_MOVEMENT_EVENTS_GENERATED:
case VERTEX_COMMIT_STARTED:
case VERTEX_GROUP_COMMIT_STARTED:
case VERTEX_GROUP_COMMIT_FINISHED:
case VERTEX_PARALLELISM_UPDATED:
case DAG_COMMIT_STARTED:
throw new UnsupportedOperationException("Invalid Event, does not support history"
+ ", eventType=" + historyEvent.getEventType());
default:
throw new UnsupportedOperationException("Unhandled Event"
+ ", eventType=" + historyEvent.getEventType());
}
return jsonObject;
}