Search in sources :

Example 31 with DAGSubmittedEvent

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;
}
Also used : TezDAGID(org.apache.tez.dag.records.TezDAGID) DAGRecoveredEvent(org.apache.tez.dag.history.events.DAGRecoveredEvent) HistoryEventType(org.apache.tez.dag.history.HistoryEventType) DAGSubmittedEvent(org.apache.tez.dag.history.events.DAGSubmittedEvent)

Aggregations

DAGSubmittedEvent (org.apache.tez.dag.history.events.DAGSubmittedEvent)31 TezDAGID (org.apache.tez.dag.records.TezDAGID)22 Configuration (org.apache.hadoop.conf.Configuration)21 DAGHistoryEvent (org.apache.tez.dag.history.DAGHistoryEvent)21 DAGPlan (org.apache.tez.dag.api.records.DAGProtos.DAGPlan)18 Path (org.apache.hadoop.fs.Path)16 ApplicationId (org.apache.hadoop.yarn.api.records.ApplicationId)15 SystemClock (org.apache.hadoop.yarn.util.SystemClock)13 DAGRecoveryData (org.apache.tez.dag.app.RecoveryParser.DAGRecoveryData)12 RecoveryService (org.apache.tez.dag.history.recovery.RecoveryService)11 TaskAttemptStartedEvent (org.apache.tez.dag.history.events.TaskAttemptStartedEvent)8 TaskStartedEvent (org.apache.tez.dag.history.events.TaskStartedEvent)8 VertexFinishedEvent (org.apache.tez.dag.history.events.VertexFinishedEvent)8 VertexStartedEvent (org.apache.tez.dag.history.events.VertexStartedEvent)8 TezVertexID (org.apache.tez.dag.records.TezVertexID)8 TezConfiguration (org.apache.tez.dag.api.TezConfiguration)7 HistoryEventType (org.apache.tez.dag.history.HistoryEventType)7 DAGCommitStartedEvent (org.apache.tez.dag.history.events.DAGCommitStartedEvent)7 DAGInitializedEvent (org.apache.tez.dag.history.events.DAGInitializedEvent)7 HistoryEvent (org.apache.tez.dag.history.HistoryEvent)6