use of org.apache.tez.dag.api.HistoryLogLevel in project tez by apache.
the class HistoryEventHandler method shouldLogEvent.
private boolean shouldLogEvent(DAGHistoryEvent event) {
TezDAGID dagId = event.getDagID();
HistoryLogLevel dagLogLevel = null;
if (dagId != null) {
dagLogLevel = dagIdToLogLevel.get(dagId);
}
if (dagLogLevel == null) {
dagLogLevel = amHistoryLogLevel;
}
HistoryEvent historyEvent = event.getHistoryEvent();
HistoryEventType eventType = historyEvent.getEventType();
if (eventType == HistoryEventType.DAG_SUBMITTED) {
Configuration dagConf = ((DAGSubmittedEvent) historyEvent).getConf();
dagLogLevel = HistoryLogLevel.getLogLevel(dagConf, amHistoryLogLevel);
dagIdToLogLevel.put(dagId, dagLogLevel);
maybeUpdateDagTaskAttemptFilters(dagId, dagLogLevel, dagConf);
} else if (eventType == HistoryEventType.DAG_RECOVERED) {
if (context.getCurrentDAG() != null) {
Configuration dagConf = context.getCurrentDAG().getConf();
dagLogLevel = HistoryLogLevel.getLogLevel(dagConf, amHistoryLogLevel);
dagIdToLogLevel.put(dagId, dagLogLevel);
maybeUpdateDagTaskAttemptFilters(dagId, dagLogLevel, dagConf);
}
} else if (eventType == HistoryEventType.DAG_FINISHED) {
dagIdToLogLevel.remove(dagId);
dagIdToTaskAttemptFilters.remove(dagId);
suppressedEvents.clear();
}
if (dagLogLevel.shouldLog(historyEvent.getEventType().getHistoryLogLevel())) {
return shouldLogTaskAttemptEvents(event, dagLogLevel);
}
return false;
}
Aggregations