Package com.google.api.gax.batching
Class BatchingCallSettings<ElementT,ElementResultT,RequestT,ResponseT>
java.lang.Object
com.google.api.gax.rpc.UnaryCallSettings<RequestT,ResponseT>
com.google.api.gax.batching.BatchingCallSettings<ElementT,ElementResultT,RequestT,ResponseT>
- Type Parameters:
ElementT- The type of each individual element to be batched.ElementResultT- The type of the result for each individual element.RequestT- The type of the request that will contain the accumulated elements.ResponseT- The type of the response that will unpack into individual element results.
public final class BatchingCallSettings<ElementT,ElementResultT,RequestT,ResponseT>
extends UnaryCallSettings<RequestT,ResponseT>
This is an extension of
UnaryCallSettings class to configure a UnaryCallable for
calls to an API method that supports batching. The batching settings are provided using the
instance of BatchingSettings.
Retry configuration will be applied on each batching RPC request.
Sample settings configuration:
BatchingCallSettings batchingCallSettings = // Default BatchingCallSettings from the client
BatchingCallSettings customBatchingCallSettings =
batchingCallSettings
.toBuilder()
.setRetryableCodes(StatusCode.Code.UNAVAILABLE, ...)
.setRetrySettings(RetrySettings.newBuilder()...build())
.setBatchingSettings(BatchingSettings.newBuilder()...build())
.build();
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionReturns batching settings which contains multiple batch threshold levels.static <ElementT,ElementResultT, RequestT, ResponseT>
BatchingCallSettings.Builder<ElementT,ElementResultT, RequestT, ResponseT> newBuilder(BatchingDescriptor<ElementT, ElementResultT, RequestT, ResponseT> batchingDescriptor) Please usetoBuilder()to override settings values.Get a builder with the same values as this object.toString()Methods inherited from class com.google.api.gax.rpc.UnaryCallSettings
equals, getRetryableCodes, getRetrySettings, hashCode, newUnaryCallSettingsBuilder
-
Method Details
-
getBatchingDescriptor
@InternalApi("For google-cloud-java client use only") public BatchingDescriptor<ElementT,ElementResultT, getBatchingDescriptor()RequestT, ResponseT> -
getBatchingSettings
Returns batching settings which contains multiple batch threshold levels. -
newBuilder
@InternalApi("For google-cloud-java client use only") public static <ElementT,ElementResultT, BatchingCallSettings.Builder<ElementT,RequestT, ResponseT> ElementResultT, newBuilderRequestT, ResponseT> (BatchingDescriptor<ElementT, ElementResultT, RequestT, ResponseT> batchingDescriptor) Please usetoBuilder()to override settings values. -
toBuilder
Get a builder with the same values as this object. See the class documentation ofBatchingCallSettingsfor a sample settings configuration.- Overrides:
toBuilderin classUnaryCallSettings<RequestT,ResponseT>
-
toString
- Overrides:
toStringin classUnaryCallSettings<RequestT,ResponseT>
-