Class BytesFullResponseHandler
- java.lang.Object
-
- org.apache.druid.java.util.http.client.response.BytesFullResponseHandler
-
- All Implemented Interfaces:
HttpResponseHandler<BytesFullResponseHolder,BytesFullResponseHolder>
public class BytesFullResponseHandler extends Object implements HttpResponseHandler<BytesFullResponseHolder,BytesFullResponseHolder>
HttpResponseHandlerfor stream data of byte array type. The stream data is appended toBytesFullResponseHolderwheneverhandleChunk(org.apache.druid.java.util.http.client.response.ClientResponse<org.apache.druid.java.util.http.client.response.BytesFullResponseHolder>, org.jboss.netty.handler.codec.http.HttpChunk, long)is called.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.druid.java.util.http.client.response.HttpResponseHandler
HttpResponseHandler.TrafficCop
-
-
Constructor Summary
Constructors Constructor Description BytesFullResponseHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientResponse<BytesFullResponseHolder>done(ClientResponse<BytesFullResponseHolder> response)Called after the final handleResponse() or handleChunk() call, signifying that no more data will arrive.voidexceptionCaught(ClientResponse<BytesFullResponseHolder> clientResponse, Throwable e)ClientResponse<BytesFullResponseHolder>handleChunk(ClientResponse<BytesFullResponseHolder> response, org.jboss.netty.handler.codec.http.HttpChunk chunk, long chunkNum)Called for chunked responses, indicating another HttpChunk has arrived.ClientResponse<BytesFullResponseHolder>handleResponse(org.jboss.netty.handler.codec.http.HttpResponse response, HttpResponseHandler.TrafficCop trafficCop)Handles the initial HttpResponse object that comes back from Netty.
-
-
-
Method Detail
-
handleResponse
public ClientResponse<BytesFullResponseHolder> handleResponse(org.jboss.netty.handler.codec.http.HttpResponse response, HttpResponseHandler.TrafficCop trafficCop)
Description copied from interface:HttpResponseHandlerHandles the initial HttpResponse object that comes back from Netty.- Specified by:
handleResponsein interfaceHttpResponseHandler<BytesFullResponseHolder,BytesFullResponseHolder>- Parameters:
response- response from NettytrafficCop- flow controller, allows resuming suspended reads- Returns:
- response that may be "finished" or "unfinished".
-
handleChunk
public ClientResponse<BytesFullResponseHolder> handleChunk(ClientResponse<BytesFullResponseHolder> response, org.jboss.netty.handler.codec.http.HttpChunk chunk, long chunkNum)
Description copied from interface:HttpResponseHandlerCalled for chunked responses, indicating another HttpChunk has arrived.- Specified by:
handleChunkin interfaceHttpResponseHandler<BytesFullResponseHolder,BytesFullResponseHolder>- Parameters:
response- last response returned by the prior handleResponse() or handleChunk()chunk- the new chunk of datachunkNum- the sequence number of this chunk (increases monotonically)- Returns:
- response that may be "finished" or "unfinished".
-
done
public ClientResponse<BytesFullResponseHolder> done(ClientResponse<BytesFullResponseHolder> response)
Description copied from interface:HttpResponseHandlerCalled after the final handleResponse() or handleChunk() call, signifying that no more data will arrive.- Specified by:
donein interfaceHttpResponseHandler<BytesFullResponseHolder,BytesFullResponseHolder>- Parameters:
response- last response returned by handleResponse() or handleChunk()- Returns:
- response containing an object to hand back to the caller. It must be a "finished" response.
-
exceptionCaught
public void exceptionCaught(ClientResponse<BytesFullResponseHolder> clientResponse, Throwable e)
- Specified by:
exceptionCaughtin interfaceHttpResponseHandler<BytesFullResponseHolder,BytesFullResponseHolder>
-
-