Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import javax.persistence.PersistenceException;
Expand Down Expand Up @@ -79,8 +80,9 @@ public void run() {
if (SHOULD_PROCESS_AZKABAN_LOG.getValue() && exceptionInfos.size() <= 1) {
exceptionInfos.addAll(getAzkabanExceptionInfoResults());
}
saveDriverExceptionLogForExceptionFingerPrinting(exceptionInfos, exceptionFingerprinting.getExceptionLogSourceInformation());
LogClass logClass = exceptionFingerprinting.classifyException(exceptionInfos);
List<ExceptionInfo> deDupedExceptionInfoList = eliminateDuplicateLogs(exceptionInfos);
saveDriverExceptionLogForExceptionFingerPrinting(deDupedExceptionInfoList, exceptionFingerprinting.getExceptionLogSourceInformation());
LogClass logClass = exceptionFingerprinting.classifyException(deDupedExceptionInfoList);
boolean isAutoTuningFault = false;
if (logClass != null && logClass.equals(LogClass.AUTOTUNING_ENABLED)) {
isAutoTuningFault = true;
Expand Down Expand Up @@ -238,4 +240,26 @@ private String processLogSourceInformation(Map<String, String> logSourceInformat
return logSource.toString();
}

}
private List<ExceptionInfo> eliminateDuplicateLogs(List<ExceptionInfo> exceptionInfos) {
HashSet<String> exceptionInfoSet = new HashSet<>();
List<ExceptionInfo> deDuplicatedExceptionInfo = new ArrayList<>();
logger.info("Size of original exception info list " + exceptionInfos.size());
for (ExceptionInfo exceptionInfo : exceptionInfos) {
boolean isDuplicate = false;
if (exceptionInfoSet.contains(exceptionInfo.getExceptionStackTrace())) {
for (String uniqueExceptions : exceptionInfoSet) {
if (uniqueExceptions.equals(exceptionInfo.getExceptionStackTrace())) {
isDuplicate = true;
break;
}
}
}
if (!isDuplicate) {
deDuplicatedExceptionInfo.add(exceptionInfo);
exceptionInfoSet.add(exceptionInfo.getExceptionStackTrace());
}
}
logger.info("Size of exception info list after deduplication" + deDuplicatedExceptionInfo.size());
return deDuplicatedExceptionInfo;
}
}