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

Commit 3d1762d

Browse files
fix: migrate to grpc_service_config (#188)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/064d885f-e246-4a73-93ae-61c4d27d9d17/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 319092854 Source-Link: googleapis/googleapis@83a83a4 PiperOrigin-RevId: 319092844 Source-Link: googleapis/googleapis@f6d35b4
1 parent e3b1b1f commit 3d1762d

File tree

3 files changed

+43
-39
lines changed

3 files changed

+43
-39
lines changed

google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/LanguageServiceStubSettings.java

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ public static class Builder extends StubSettings.Builder<LanguageServiceStubSett
238238
ImmutableMap.Builder<String, ImmutableSet<StatusCode.Code>> definitions =
239239
ImmutableMap.builder();
240240
definitions.put(
241-
"idempotent",
241+
"retry_policy_1_codes",
242242
ImmutableSet.copyOf(
243243
Lists.<StatusCode.Code>newArrayList(
244244
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
245-
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
245+
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
246246
RETRYABLE_CODE_DEFINITIONS = definitions.build();
247247
}
248248

@@ -256,12 +256,14 @@ public static class Builder extends StubSettings.Builder<LanguageServiceStubSett
256256
.setInitialRetryDelay(Duration.ofMillis(100L))
257257
.setRetryDelayMultiplier(1.3)
258258
.setMaxRetryDelay(Duration.ofMillis(60000L))
259-
.setInitialRpcTimeout(Duration.ofMillis(20000L))
259+
.setInitialRpcTimeout(Duration.ofMillis(600000L))
260260
.setRpcTimeoutMultiplier(1.0)
261-
.setMaxRpcTimeout(Duration.ofMillis(20000L))
261+
.setMaxRpcTimeout(Duration.ofMillis(600000L))
262262
.setTotalTimeout(Duration.ofMillis(600000L))
263263
.build();
264-
definitions.put("default", settings);
264+
definitions.put("retry_policy_1_params", settings);
265+
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
266+
definitions.put("no_retry_params", settings);
265267
RETRY_PARAM_DEFINITIONS = definitions.build();
266268
}
267269

@@ -309,33 +311,33 @@ private static Builder initDefaults(Builder builder) {
309311

310312
builder
311313
.analyzeSentimentSettings()
312-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
313-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
314+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
315+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
314316

315317
builder
316318
.analyzeEntitiesSettings()
317-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
318-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
319+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
320+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
319321

320322
builder
321323
.analyzeEntitySentimentSettings()
322-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
323-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
324+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
325+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
324326

325327
builder
326328
.analyzeSyntaxSettings()
327-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
328-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
329+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
330+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
329331

330332
builder
331333
.classifyTextSettings()
332-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
333-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
334+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
335+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
334336

335337
builder
336338
.annotateTextSettings()
337-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
338-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
339+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
340+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
339341

340342
return builder;
341343
}

google-cloud-language/src/main/java/com/google/cloud/language/v1beta2/stub/LanguageServiceStubSettings.java

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ public static class Builder extends StubSettings.Builder<LanguageServiceStubSett
238238
ImmutableMap.Builder<String, ImmutableSet<StatusCode.Code>> definitions =
239239
ImmutableMap.builder();
240240
definitions.put(
241-
"idempotent",
241+
"retry_policy_1_codes",
242242
ImmutableSet.copyOf(
243243
Lists.<StatusCode.Code>newArrayList(
244-
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
245-
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
244+
StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED)));
245+
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
246246
RETRYABLE_CODE_DEFINITIONS = definitions.build();
247247
}
248248

@@ -256,12 +256,14 @@ public static class Builder extends StubSettings.Builder<LanguageServiceStubSett
256256
.setInitialRetryDelay(Duration.ofMillis(100L))
257257
.setRetryDelayMultiplier(1.3)
258258
.setMaxRetryDelay(Duration.ofMillis(60000L))
259-
.setInitialRpcTimeout(Duration.ofMillis(60000L))
259+
.setInitialRpcTimeout(Duration.ofMillis(600000L))
260260
.setRpcTimeoutMultiplier(1.0)
261-
.setMaxRpcTimeout(Duration.ofMillis(60000L))
261+
.setMaxRpcTimeout(Duration.ofMillis(600000L))
262262
.setTotalTimeout(Duration.ofMillis(600000L))
263263
.build();
264-
definitions.put("default", settings);
264+
definitions.put("retry_policy_1_params", settings);
265+
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
266+
definitions.put("no_retry_params", settings);
265267
RETRY_PARAM_DEFINITIONS = definitions.build();
266268
}
267269

@@ -309,33 +311,33 @@ private static Builder initDefaults(Builder builder) {
309311

310312
builder
311313
.analyzeSentimentSettings()
312-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
313-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
314+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
315+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
314316

315317
builder
316318
.analyzeEntitiesSettings()
317-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
318-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
319+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
320+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
319321

320322
builder
321323
.analyzeEntitySentimentSettings()
322-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
323-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
324+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
325+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
324326

325327
builder
326328
.analyzeSyntaxSettings()
327-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
328-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
329+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
330+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
329331

330332
builder
331333
.classifyTextSettings()
332-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
333-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
334+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
335+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
334336

335337
builder
336338
.annotateTextSettings()
337-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
338-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
339+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
340+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
339341

340342
return builder;
341343
}

synth.metadata

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
"git": {
1212
"name": "googleapis",
1313
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "c4e37010d74071851ff24121f522e802231ac86e",
15-
"internalRef": "313460921"
14+
"sha": "83a83a43ded3f0bfc8a5b0aa13be10a210ef319d",
15+
"internalRef": "319092854"
1616
}
1717
},
1818
{
1919
"git": {
2020
"name": "googleapis",
2121
"remote": "https://github.com/googleapis/googleapis.git",
22-
"sha": "c4e37010d74071851ff24121f522e802231ac86e",
23-
"internalRef": "313460921"
22+
"sha": "83a83a43ded3f0bfc8a5b0aa13be10a210ef319d",
23+
"internalRef": "319092854"
2424
}
2525
},
2626
{

0 commit comments

Comments
 (0)