Package org.apache.druid.server
Interface QueryResultPusher.ResultsWriter
-
- All Superinterfaces:
AutoCloseable,Closeable
- Enclosing class:
- QueryResultPusher
public static interface QueryResultPusher.ResultsWriter extends Closeable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description QueryResponse<Object>getQueryResponse()Gets the results of running the query.QueryResultPusher.WritermakeWriter(OutputStream out)voidrecordFailure(Exception e)voidrecordSuccess(long numBytes)javax.ws.rs.core.Response.ResponseBuilderstart()Runs the query and prepares the QueryResponse to be returned
-
-
-
Method Detail
-
start
@Nullable javax.ws.rs.core.Response.ResponseBuilder start()
Runs the query and prepares the QueryResponse to be returnedThis also serves as a hook for any logic that runs on the metadata from a QueryResponse. If this method returns
nullthen the Pusher can continue with normal logic. If this method chooses to return a ResponseBuilder, then the Pusher will attach any extra metadata it has to the Response and return the response built from the Builder without attempting to process the results of the query.In all cases,
Closeable.close()should be called on this object.- Returns:
- QueryResponse or null if no more work to do.
-
getQueryResponse
QueryResponse<Object> getQueryResponse()
Gets the results of running the query.start()must be called before this method is called.- Returns:
- the results of running the query as prepared by the
start()method
-
makeWriter
QueryResultPusher.Writer makeWriter(OutputStream out) throws IOException
- Throws:
IOException
-
recordSuccess
void recordSuccess(long numBytes)
-
recordFailure
void recordFailure(Exception e)
-
-