Class QueryResultPusher

java.lang.Object
org.apache.druid.server.QueryResultPusher
Direct Known Subclasses:
QueryResourceQueryResultPusherFactory.QueryResourceQueryResultPusher

public abstract class QueryResultPusher extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • start

      public abstract QueryResultPusher.ResultsWriter start()
      Builds a ResultsWriter to start the lifecycle of the QueryResultPusher. The ResultsWriter encapsulates the logic to run the query, serialize it and also report success/failure.

      This response must not be null. The job of this ResultsWriter is largely to provide lifecycle management to the query running and reporting, so this object must never be null.

      This start() method should do as little work as possible, it should really just make the ResultsWriter and return.

      Returns:
      a new ResultsWriter
    • writeException

      public abstract void writeException(Exception e, OutputStream out) throws IOException
      Throws:
      IOException
    • push

      @Nullable public javax.ws.rs.core.Response push()
      Pushes results out. Can sometimes return a JAXRS Response object instead of actually pushing to the output stream, primarily for error handling that occurs before switching the servlet to asynchronous mode.
      Returns:
      null if the response has already been handled and pushed out, or a non-null Response object if it expects the container to put the bytes on the wire.
    • handleDruidExceptionBeforeResponseStarted

      public static javax.ws.rs.core.Response handleDruidExceptionBeforeResponseStarted(DruidException e, javax.ws.rs.core.MediaType contentType, Map<String,String> extraHeaders)
      Generates a response for a DruidException that occurs prior to any query results being sent out.