use of org.apache.tez.dag.history.events.DAGSubmittedEvent in project tez by apache.
the class ATSHistoryLoggingService method isValidEvent.
private boolean isValidEvent(DAGHistoryEvent event) {
HistoryEventType eventType = event.getHistoryEvent().getEventType();
TezDAGID dagId = event.getDagID();
if (eventType.equals(HistoryEventType.DAG_SUBMITTED)) {
DAGSubmittedEvent dagSubmittedEvent = (DAGSubmittedEvent) event.getHistoryEvent();
String dagName = dagSubmittedEvent.getDAGName();
if ((dagName != null && dagName.startsWith(TezConstants.TEZ_PREWARM_DAG_NAME_PREFIX)) || (!dagSubmittedEvent.isHistoryLoggingEnabled())) {
// Skip recording pre-warm DAG events
skippedDAGs.add(dagId);
return false;
}
}
if (eventType.equals(HistoryEventType.DAG_RECOVERED)) {
DAGRecoveredEvent dagRecoveredEvent = (DAGRecoveredEvent) event.getHistoryEvent();
if (!dagRecoveredEvent.isHistoryLoggingEnabled()) {
skippedDAGs.add(dagRecoveredEvent.getDagID());
return false;
}
}
if (eventType.equals(HistoryEventType.DAG_FINISHED)) {
// No more events should be seen after this point.
if (skippedDAGs.remove(dagId)) {
return false;
}
}
if (dagId != null && skippedDAGs.contains(dagId)) {
// Skip pre-warm DAGs
return false;
}
return true;
}
Aggregations