Package org.apache.druid.server
Class QueryResultPusher
- java.lang.Object
-
- org.apache.druid.server.QueryResultPusher
-
public abstract class QueryResultPusher extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceQueryResultPusher.ResultsWriterclassQueryResultPusher.StreamingHttpResponseAccumulatorstatic interfaceQueryResultPusher.Writer
-
Constructor Summary
Constructors Constructor Description QueryResultPusher(javax.servlet.http.HttpServletRequest request, com.fasterxml.jackson.databind.ObjectMapper jsonMapper, ResponseContextConfig responseContextConfig, DruidNode selfNode, QueryResource.QueryMetricCounter counter, String queryId, javax.ws.rs.core.MediaType contentType, Map<String,String> extraHeaders)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Responsepush()Pushes results out.abstract QueryResultPusher.ResultsWriterstart()Builds a ResultsWriter to start the lifecycle of the QueryResultPusher.abstract voidwriteException(Exception e, OutputStream out)
-
-
-
Constructor Detail
-
QueryResultPusher
public QueryResultPusher(javax.servlet.http.HttpServletRequest request, com.fasterxml.jackson.databind.ObjectMapper jsonMapper, ResponseContextConfig responseContextConfig, DruidNode selfNode, QueryResource.QueryMetricCounter counter, String queryId, javax.ws.rs.core.MediaType contentType, Map<String,String> extraHeaders)
-
-
Method Detail
-
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.
-
-