return atsEntity;
}
private static TimelineEntity convertDAGSubmittedEvent(DAGSubmittedEvent event) {
TimelineEntity atsEntity = new TimelineEntity();
atsEntity.setEntityId(event.getDagID().toString());
atsEntity.setEntityType(EntityTypes.TEZ_DAG_ID.name());
atsEntity.addRelatedEntity(EntityTypes.TEZ_APPLICATION_ATTEMPT.name(),
"tez_" + event.getApplicationAttemptId().toString());
atsEntity.addRelatedEntity(ATSConstants.APPLICATION_ID,
event.getApplicationAttemptId().getApplicationId().toString());
atsEntity.addRelatedEntity(ATSConstants.APPLICATION_ATTEMPT_ID,
event.getApplicationAttemptId().toString());
atsEntity.addRelatedEntity(ATSConstants.USER, event.getUser());
TimelineEvent submitEvt = new TimelineEvent();
submitEvt.setEventType(HistoryEventType.DAG_SUBMITTED.name());
submitEvt.setTimestamp(event.getSubmitTime());
atsEntity.addEvent(submitEvt);
atsEntity.setStartTime(event.getSubmitTime());
atsEntity.addPrimaryFilter(ATSConstants.USER, event.getUser());
atsEntity.addPrimaryFilter(ATSConstants.DAG_NAME, event.getDAGName());
try {
atsEntity.addOtherInfo(ATSConstants.DAG_PLAN,
DAGUtils.convertDAGPlanToATSMap(event.getDAGPlan()));
} catch (IOException e) {
throw new TezUncheckedException(e);
}
atsEntity.addOtherInfo(ATSConstants.APPLICATION_ID,
event.getApplicationAttemptId().getApplicationId().toString());
return atsEntity;
}