Skip to content
This repository was archived by the owner on Nov 9, 2023. It is now read-only.

Commit 62a5b68

Browse files
fix: migrate to grpc_service_config (#108)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/c330ec71-3b2b-4ad2-9d49-78b97f45869d/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 315961930 Source-Link: googleapis/googleapis@0edf3ff PiperOrigin-RevId: 315961855 Source-Link: googleapis/googleapis@2e34b87
1 parent 09c04e8 commit 62a5b68

File tree

3 files changed

+31
-27
lines changed

3 files changed

+31
-27
lines changed

google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta1/stub/DocumentUnderstandingServiceStubSettings.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ public static class Builder
199199
ImmutableMap.Builder<String, ImmutableSet<StatusCode.Code>> definitions =
200200
ImmutableMap.builder();
201201
definitions.put(
202-
"idempotent",
202+
"retry_policy_1_codes",
203203
ImmutableSet.copyOf(
204204
Lists.<StatusCode.Code>newArrayList(
205205
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
206-
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
206+
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
207207
RETRYABLE_CODE_DEFINITIONS = definitions.build();
208208
}
209209

@@ -217,12 +217,14 @@ public static class Builder
217217
.setInitialRetryDelay(Duration.ofMillis(100L))
218218
.setRetryDelayMultiplier(1.3)
219219
.setMaxRetryDelay(Duration.ofMillis(60000L))
220-
.setInitialRpcTimeout(Duration.ofMillis(20000L))
220+
.setInitialRpcTimeout(Duration.ofMillis(60000L))
221221
.setRpcTimeoutMultiplier(1.0)
222-
.setMaxRpcTimeout(Duration.ofMillis(20000L))
223-
.setTotalTimeout(Duration.ofMillis(600000L))
222+
.setMaxRpcTimeout(Duration.ofMillis(60000L))
223+
.setTotalTimeout(Duration.ofMillis(60000L))
224224
.build();
225-
definitions.put("default", settings);
225+
definitions.put("retry_policy_1_params", settings);
226+
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
227+
definitions.put("no_retry_params", settings);
226228
RETRY_PARAM_DEFINITIONS = definitions.build();
227229
}
228230

@@ -256,15 +258,15 @@ private static Builder initDefaults(Builder builder) {
256258

257259
builder
258260
.batchProcessDocumentsSettings()
259-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
260-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
261+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
262+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
261263
builder
262264
.batchProcessDocumentsOperationSettings()
263265
.setInitialCallSettings(
264266
UnaryCallSettings
265267
.<BatchProcessDocumentsRequest, OperationSnapshot>newUnaryCallSettingsBuilder()
266-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
267-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
268+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
269+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"))
268270
.build())
269271
.setResponseTransformer(
270272
ProtoOperationTransformers.ResponseTransformer.create(

google-cloud-document-ai/src/main/java/com/google/cloud/documentai/v1beta2/stub/DocumentUnderstandingServiceStubSettings.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@ public static class Builder
210210
ImmutableMap.Builder<String, ImmutableSet<StatusCode.Code>> definitions =
211211
ImmutableMap.builder();
212212
definitions.put(
213-
"idempotent",
213+
"retry_policy_1_codes",
214214
ImmutableSet.copyOf(
215215
Lists.<StatusCode.Code>newArrayList(
216216
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
217-
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
217+
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
218218
RETRYABLE_CODE_DEFINITIONS = definitions.build();
219219
}
220220

@@ -228,12 +228,14 @@ public static class Builder
228228
.setInitialRetryDelay(Duration.ofMillis(100L))
229229
.setRetryDelayMultiplier(1.3)
230230
.setMaxRetryDelay(Duration.ofMillis(60000L))
231-
.setInitialRpcTimeout(Duration.ofMillis(20000L))
231+
.setInitialRpcTimeout(Duration.ofMillis(60000L))
232232
.setRpcTimeoutMultiplier(1.0)
233-
.setMaxRpcTimeout(Duration.ofMillis(20000L))
234-
.setTotalTimeout(Duration.ofMillis(600000L))
233+
.setMaxRpcTimeout(Duration.ofMillis(60000L))
234+
.setTotalTimeout(Duration.ofMillis(60000L))
235235
.build();
236-
definitions.put("default", settings);
236+
definitions.put("retry_policy_1_params", settings);
237+
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
238+
definitions.put("no_retry_params", settings);
237239
RETRY_PARAM_DEFINITIONS = definitions.build();
238240
}
239241

@@ -270,20 +272,20 @@ private static Builder initDefaults(Builder builder) {
270272

271273
builder
272274
.batchProcessDocumentsSettings()
273-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
274-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
275+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
276+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
275277

276278
builder
277279
.processDocumentSettings()
278-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
279-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
280+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
281+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
280282
builder
281283
.batchProcessDocumentsOperationSettings()
282284
.setInitialCallSettings(
283285
UnaryCallSettings
284286
.<BatchProcessDocumentsRequest, OperationSnapshot>newUnaryCallSettingsBuilder()
285-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
286-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
287+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
288+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"))
287289
.build())
288290
.setResponseTransformer(
289291
ProtoOperationTransformers.ResponseTransformer.create(

synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/java-document-ai.git",
7-
"sha": "c720819576f9ad0ab42419ea2db0a49aafb46016"
7+
"sha": "09c04e895ccd6e871e7dacce6c98a74a5beb7b37"
88
}
99
},
1010
{
1111
"git": {
1212
"name": "googleapis",
1313
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "ed1174659dc748903dbb635c7e01e38c3f812fbb",
15-
"internalRef": "315627096"
14+
"sha": "0edf3ff6625f50cdcab5b3c40f2ef109bf73cef4",
15+
"internalRef": "315961930"
1616
}
1717
},
1818
{
1919
"git": {
2020
"name": "googleapis",
2121
"remote": "https://github.com/googleapis/googleapis.git",
22-
"sha": "ed1174659dc748903dbb635c7e01e38c3f812fbb",
23-
"internalRef": "315627096"
22+
"sha": "0edf3ff6625f50cdcab5b3c40f2ef109bf73cef4",
23+
"internalRef": "315961930"
2424
}
2525
},
2626
{

0 commit comments

Comments
 (0)