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 ofUnaryCallSettings
class to configure aUnaryCallable
for calls to an API method that supports batching. The batching settings are provided using the instance ofBatchingSettings
.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 Modifier and Type Class Description static class
BatchingCallSettings.Builder<ElementT,ElementResultT,RequestT,ResponseT>
A base builder class forBatchingCallSettings
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BatchingDescriptor<ElementT,ElementResultT,RequestT,ResponseT>
getBatchingDescriptor()
BatchingSettings
getBatchingSettings()
Returns 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.BatchingCallSettings.Builder<ElementT,ElementResultT,RequestT,ResponseT>
toBuilder()
Get a builder with the same values as this object.String
toString()
-
Methods inherited from class com.google.api.gax.rpc.UnaryCallSettings
equals, getRetryableCodes, getRetrySettings, hashCode, newUnaryCallSettingsBuilder
-
-
-
-
Method Detail
-
getBatchingDescriptor
@InternalApi("For google-cloud-java client use only") public BatchingDescriptor<ElementT,ElementResultT,RequestT,ResponseT> getBatchingDescriptor()
-
getBatchingSettings
public BatchingSettings getBatchingSettings()
Returns batching settings which contains multiple batch threshold levels.
-
newBuilder
@InternalApi("For google-cloud-java client use only") public static <ElementT,ElementResultT,RequestT,ResponseT> BatchingCallSettings.Builder<ElementT,ElementResultT,RequestT,ResponseT> newBuilder(BatchingDescriptor<ElementT,ElementResultT,RequestT,ResponseT> batchingDescriptor)
Please usetoBuilder()
to override settings values.
-
toBuilder
public final BatchingCallSettings.Builder<ElementT,ElementResultT,RequestT,ResponseT> toBuilder()
Get a builder with the same values as this object. See the class documentation ofBatchingCallSettings
for a sample settings configuration.- Overrides:
toBuilder
in classUnaryCallSettings<RequestT,ResponseT>
-
toString
public String toString()
- Overrides:
toString
in classUnaryCallSettings<RequestT,ResponseT>
-
-