From c99f5089e2e5822ea3147f3216cb5cbdf31634d4 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 22 Jun 2020 13:01:19 -0700 Subject: [PATCH] fix: migrate retry settings to grpc_service_config (#192) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/51b19127-021c-490f-9add-0c6fb0ed82bf/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 317323517 Source-Link: https://github.com/googleapis/googleapis/commit/f41a9f99b485bc09e95e0cfca979e2f419482336 PiperOrigin-RevId: 317323505 Source-Link: https://github.com/googleapis/googleapis/commit/617df4668ef143fb6ba3632ec0c716bba081010e --- .../v1/stub/WebRiskServiceStubSettings.java | 38 ++++++++++++------- .../WebRiskServiceV1Beta1StubSettings.java | 24 ++++++------ synth.metadata | 10 ++--- 3 files changed, 43 insertions(+), 29 deletions(-) diff --git a/google-cloud-webrisk/src/main/java/com/google/cloud/webrisk/v1/stub/WebRiskServiceStubSettings.java b/google-cloud-webrisk/src/main/java/com/google/cloud/webrisk/v1/stub/WebRiskServiceStubSettings.java index 3efa99ae..efc2a6bc 100644 --- a/google-cloud-webrisk/src/main/java/com/google/cloud/webrisk/v1/stub/WebRiskServiceStubSettings.java +++ b/google-cloud-webrisk/src/main/java/com/google/cloud/webrisk/v1/stub/WebRiskServiceStubSettings.java @@ -208,11 +208,13 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "idempotent", + "retry_policy_1_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -226,12 +228,22 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "idempotent", + "retry_policy_1_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -217,12 +217,14 @@ public static class Builder .setInitialRetryDelay(Duration.ofMillis(100L)) .setRetryDelayMultiplier(1.3) .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) .setTotalTimeout(Duration.ofMillis(600000L)) .build(); - definitions.put("default", settings); + definitions.put("retry_policy_1_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -259,18 +261,18 @@ private static Builder initDefaults(Builder builder) { builder .computeThreatListDiffSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .searchUrisSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .searchHashesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); return builder; } diff --git a/synth.metadata b/synth.metadata index 6715ad1b..6e1de453 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,23 +4,23 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-webrisk.git", - "sha": "fcffa703dadcb414bf5ede9786bfc8fccbf1c71f" + "sha": "db4d29225228d7b498b7c35f3ddca79d6b86512c" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "13883b8fa7fc17ec20b563a31bc9d2aa1d491d4d", - "internalRef": "316978043" + "sha": "f41a9f99b485bc09e95e0cfca979e2f419482336", + "internalRef": "317323517" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "13883b8fa7fc17ec20b563a31bc9d2aa1d491d4d", - "internalRef": "316978043" + "sha": "f41a9f99b485bc09e95e0cfca979e2f419482336", + "internalRef": "317323517" } }, {