Package org.apache.druid.server
Class QueryResultPusher.StreamingHttpResponseAccumulator
java.lang.Object
org.apache.druid.server.QueryResultPusher.StreamingHttpResponseAccumulator
- All Implemented Interfaces:
Closeable,AutoCloseable,Accumulator<javax.ws.rs.core.Response,Object>
- Enclosing class:
- QueryResultPusher
public class QueryResultPusher.StreamingHttpResponseAccumulator
extends Object
implements Accumulator<javax.ws.rs.core.Response,Object>, Closeable
-
Constructor Summary
ConstructorsConstructorDescriptionStreamingHttpResponseAccumulator(ResponseContext responseContext, QueryResultPusher.ResultsWriter resultsWriter) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Responseaccumulate(javax.ws.rs.core.Response retVal, Object in) voidclose()voidflush()longvoidInitializes the response.boolean
-
Constructor Details
-
StreamingHttpResponseAccumulator
public StreamingHttpResponseAccumulator(ResponseContext responseContext, QueryResultPusher.ResultsWriter resultsWriter)
-
-
Method Details
-
getNumBytesSent
public long getNumBytesSent() -
isInitialized
public boolean isInitialized() -
initialize
public void initialize()Initializes the response. This is done lazily so that we can put various metadata that we only get once we have some of the response stream into the result.It is okay for this to be called multiple times.
-
accumulate
- Specified by:
accumulatein interfaceAccumulator<javax.ws.rs.core.Response,Object>
-
flush
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-