public abstract class HybridThriftResponseHandler<ThriftResponse extends org.apache.thrift.TBase<?,?>> extends Object
Modifier | Constructor and Description |
---|---|
protected |
HybridThriftResponseHandler(ThriftResponse emptyResponse) |
Modifier and Type | Method and Description |
---|---|
static <ThriftResponse extends org.apache.thrift.TBase<?,?>> |
createNoPayloadHandler(ThriftResponse response)
Encodes a response without out-of-band payloads.
|
static <ThriftResponse extends org.apache.thrift.TBase<?,?>> |
createNoPayloadHandler(ThriftResponse response,
ThrowingConsumer<ThriftResponse,IOException> validator)
Encodes a response without out-of-band payloads.
|
abstract long |
getPayloadSizeBytes(int index)
Size bytes of the nth payload.
|
ThriftResponse |
getResponse()
The thrift response.
|
abstract OutputStream |
getStreamForPayload(int index)
Where to write the nth payload bytes to.
|
abstract int |
getTotalPayloads()
Total number of payloads expected for the current thrift response.
|
void |
onResponseParsed()
Called as soon as the thrift metadata section of the response is parsed.
|
protected HybridThriftResponseHandler(ThriftResponse emptyResponse)
public static <ThriftResponse extends org.apache.thrift.TBase<?,?>> HybridThriftResponseHandler<ThriftResponse> createNoPayloadHandler(ThriftResponse response)
public static <ThriftResponse extends org.apache.thrift.TBase<?,?>> HybridThriftResponseHandler<ThriftResponse> createNoPayloadHandler(ThriftResponse response, ThrowingConsumer<ThriftResponse,IOException> validator)
public ThriftResponse getResponse()
public void onResponseParsed() throws IOException
IOException
public abstract int getTotalPayloads()
public abstract long getPayloadSizeBytes(int index)
public abstract OutputStream getStreamForPayload(int index)