Search in sources :

Example 6 with ProcessingException

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;
}
Also used : StringWriter(java.io.StringWriter) ProcessingException(com.linkedin.pinot.common.response.ProcessingException) PrintWriter(java.io.PrintWriter)

Example 7 with ProcessingException

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;
}
Also used : ProcessingException(com.linkedin.pinot.common.response.ProcessingException)

Aggregations

ProcessingException (com.linkedin.pinot.common.response.ProcessingException)7 QueryException (com.linkedin.pinot.common.exception.QueryException)3 ServerInstance (com.linkedin.pinot.common.response.ServerInstance)2 DataTable (com.linkedin.pinot.common.utils.DataTable)2 AggregationFunctionContext (com.linkedin.pinot.core.query.aggregation.AggregationFunctionContext)2 ByteBuf (io.netty.buffer.ByteBuf)2 ArrayList (java.util.ArrayList)2 AggregationInfo (com.linkedin.pinot.common.request.AggregationInfo)1 Selection (com.linkedin.pinot.common.request.Selection)1 BrokerResponse (com.linkedin.pinot.common.response.BrokerResponse)1 ResponseType (com.linkedin.pinot.common.response.BrokerResponseFactory.ResponseType)1 DataSchema (com.linkedin.pinot.common.utils.DataSchema)1 Operator (com.linkedin.pinot.core.common.Operator)1 IntermediateResultsBlock (com.linkedin.pinot.core.operator.blocks.IntermediateResultsBlock)1 AggregationGroupByResult (com.linkedin.pinot.core.query.aggregation.groupby.AggregationGroupByResult)1 AggregationGroupByTrimmingService (com.linkedin.pinot.core.query.aggregation.groupby.AggregationGroupByTrimmingService)1 GroupKeyGenerator (com.linkedin.pinot.core.query.aggregation.groupby.GroupKeyGenerator)1 TraceRunnable (com.linkedin.pinot.core.util.trace.TraceRunnable)1 IOException (java.io.IOException)1 PrintWriter (java.io.PrintWriter)1