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>
HttpResponseHandler for stream data of byte array type.
The stream data is appended to BytesFullResponseHolder whenever handleChunk(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 -
Method Summary
Modifier and TypeMethodDescriptiondone(ClientResponse<BytesFullResponseHolder> response) Called after the final handleResponse() or handleChunk() call, signifying that no more data will arrive.voidexceptionCaught(ClientResponse<BytesFullResponseHolder> clientResponse, Throwable e) handleChunk(ClientResponse<BytesFullResponseHolder> response, org.jboss.netty.handler.codec.http.HttpChunk chunk, long chunkNum) Called for chunked responses, indicating another HttpChunk has arrived.handleResponse(org.jboss.netty.handler.codec.http.HttpResponse response, HttpResponseHandler.TrafficCop trafficCop) Handles the initial HttpResponse object that comes back from Netty.
-
Constructor Details
-
BytesFullResponseHandler
public BytesFullResponseHandler()
-
-
Method Details
-
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
- Specified by:
exceptionCaughtin interfaceHttpResponseHandler<BytesFullResponseHolder,BytesFullResponseHolder>
-