@BetaApi(value="The surface for batching is not stable yet and may change in the future.")
public interface BatchingDescriptor<RequestT,ResponseT>
Implementations of BatchingDescriptor must guarantee that all methods are stateless and thread safe.
This class is designed to be used by generated code.
| Modifier and Type | Method and Description |
|---|---|
long |
countBytes(RequestT request)
Returns the size in bytes of this request.
|
long |
countElements(RequestT request)
Returns the number of elements contained in this request.
|
PartitionKey |
getBatchPartitionKey(RequestT request)
Returns the value of the partition key for the given request.
|
RequestBuilder<RequestT> |
getRequestBuilder()
Get the Builder object for the request type RequestT.
|
void |
splitException(Throwable throwable,
Collection<? extends BatchedRequestIssuer<ResponseT>> batch)
Splits the exception that resulted from a batched call into an individual setException call on
each RequestIssuer.
|
void |
splitResponse(ResponseT batchResponse,
Collection<? extends BatchedRequestIssuer<ResponseT>> batch)
Splits the result from a batched call into an individual setResponse call on each
RequestIssuer.
|
PartitionKey getBatchPartitionKey(RequestT request)
RequestBuilder<RequestT> getRequestBuilder()
void splitResponse(ResponseT batchResponse, Collection<? extends BatchedRequestIssuer<ResponseT>> batch)
void splitException(Throwable throwable, Collection<? extends BatchedRequestIssuer<ResponseT>> batch)
long countElements(RequestT request)
long countBytes(RequestT request)