use of com.linkedin.pinot.common.response.ProcessingException in project pinot by linkedin.
the class QueryException method getException.
public static ProcessingException getException(ProcessingException processingException, Exception exception, int maxLinesOfStackTrace) {
String errorType = processingException.getMessage();
ProcessingException copiedProcessingException = processingException.deepCopy();
StringWriter stringWriter = new StringWriter();
exception.printStackTrace(new PrintWriter(stringWriter));
String fullStackTrace = stringWriter.toString();
String[] lines = fullStackTrace.split("\n");
int numLinesOfStackTrace = Math.min(lines.length, maxLinesOfStackTrace);
int lengthOfStackTrace = numLinesOfStackTrace - 1;
for (int i = 0; i < numLinesOfStackTrace; i++) {
lengthOfStackTrace += lines[i].length();
}
copiedProcessingException.setMessage(errorType + ":\n" + fullStackTrace.substring(0, lengthOfStackTrace));
return copiedProcessingException;
}
use of com.linkedin.pinot.common.response.ProcessingException in project pinot by linkedin.
the class IntermediateResultsBlock method attachMetadataToDataTable.
private DataTable attachMetadataToDataTable(DataTable dataTable) {
dataTable.getMetadata().put(DataTable.NUM_DOCS_SCANNED_METADATA_KEY, String.valueOf(_numDocsScanned));
dataTable.getMetadata().put(DataTable.NUM_ENTRIES_SCANNED_IN_FILTER_METADATA_KEY, String.valueOf(_numEntriesScannedInFilter));
dataTable.getMetadata().put(DataTable.NUM_ENTRIES_SCANNED_POST_FILTER_METADATA_KEY, String.valueOf(_numEntriesScannedPostFilter));
dataTable.getMetadata().put(DataTable.TOTAL_DOCS_METADATA_KEY, String.valueOf(_numTotalRawDocs));
if (_processingExceptions != null && _processingExceptions.size() > 0) {
for (ProcessingException exception : _processingExceptions) {
dataTable.addException(exception);
}
}
return dataTable;
}
Aggregations