From 1f4f1c0075d7fd2ad945f82a20aa68426f1f9114 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 22 Jun 2020 12:58:18 -0700 Subject: [PATCH] fix: migrate to grpc_service_config (#198) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/5c193786-fcd8-4a90-b8a2-1d007566f359/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 316978059 Source-Link: https://github.com/googleapis/googleapis/commit/251d9358730b5cec7625d9f42879444a7d5369d5 PiperOrigin-RevId: 316978043 Source-Link: https://github.com/googleapis/googleapis/commit/13883b8fa7fc17ec20b563a31bc9d2aa1d491d4d PiperOrigin-RevId: 316978028 Source-Link: https://github.com/googleapis/googleapis/commit/b89b7a0ecae0271420cdb128658d3a8e5f9efa92 PiperOrigin-RevId: 316966872 Source-Link: https://github.com/googleapis/googleapis/commit/76dba26d5c81fa7ddbadbd2c2dcef26eeed49401 PiperOrigin-RevId: 316965262 Source-Link: https://github.com/googleapis/googleapis/commit/c00a3bc9d0fd404201861358973dc5fc95f61df9 --- README.md | 2 +- .../VideoIntelligenceServiceStubSettings.java | 22 +++++++++------- .../VideoIntelligenceServiceStubSettings.java | 22 +++++++++------- .../VideoIntelligenceServiceStubSettings.java | 22 +++++++++------- .../VideoIntelligenceServiceStubSettings.java | 22 +++++++++------- ...gVideoIntelligenceServiceStubSettings.java | 26 ++++++++++++++++--- .../VideoIntelligenceServiceStubSettings.java | 22 +++++++++------- synth.metadata | 6 ++--- 8 files changed, 86 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 5adfc5ea9..1c1cd3596 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 5.7.0 + 7.0.0 pom import diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/stub/VideoIntelligenceServiceStubSettings.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/stub/VideoIntelligenceServiceStubSettings.java index ecae6140b..b2031d3b0 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/stub/VideoIntelligenceServiceStubSettings.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1/stub/VideoIntelligenceServiceStubSettings.java @@ -194,11 +194,11 @@ public static class Builder ImmutableMap.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())); + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -212,12 +212,14 @@ public static class Builder .setInitialRetryDelay(Duration.ofMillis(1000L)) .setRetryDelayMultiplier(2.5) .setMaxRetryDelay(Duration.ofMillis(120000L)) - .setInitialRpcTimeout(Duration.ofMillis(120000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(120000L)) + .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(); } @@ -251,15 +253,15 @@ private static Builder initDefaults(Builder builder) { builder .annotateVideoSettings() - .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 .annotateVideoOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .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")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(AnnotateVideoResponse.class)) diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/stub/VideoIntelligenceServiceStubSettings.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/stub/VideoIntelligenceServiceStubSettings.java index 9e48b98cd..a5540b4b4 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/stub/VideoIntelligenceServiceStubSettings.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1beta2/stub/VideoIntelligenceServiceStubSettings.java @@ -194,11 +194,11 @@ public static class Builder ImmutableMap.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())); + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -212,12 +212,14 @@ public static class Builder .setInitialRetryDelay(Duration.ofMillis(1000L)) .setRetryDelayMultiplier(2.5) .setMaxRetryDelay(Duration.ofMillis(120000L)) - .setInitialRpcTimeout(Duration.ofMillis(120000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(120000L)) + .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(); } @@ -251,15 +253,15 @@ private static Builder initDefaults(Builder builder) { builder .annotateVideoSettings() - .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 .annotateVideoOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .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")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(AnnotateVideoResponse.class)) diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/stub/VideoIntelligenceServiceStubSettings.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/stub/VideoIntelligenceServiceStubSettings.java index 54a949b6c..2a1685e32 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/stub/VideoIntelligenceServiceStubSettings.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p1beta1/stub/VideoIntelligenceServiceStubSettings.java @@ -194,11 +194,11 @@ public static class Builder ImmutableMap.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())); + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -212,12 +212,14 @@ public static class Builder .setInitialRetryDelay(Duration.ofMillis(1000L)) .setRetryDelayMultiplier(2.5) .setMaxRetryDelay(Duration.ofMillis(120000L)) - .setInitialRpcTimeout(Duration.ofMillis(120000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(120000L)) + .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(); } @@ -251,15 +253,15 @@ private static Builder initDefaults(Builder builder) { builder .annotateVideoSettings() - .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 .annotateVideoOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .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")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(AnnotateVideoResponse.class)) diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStubSettings.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStubSettings.java index a9e26d36b..7dfda201a 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStubSettings.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStubSettings.java @@ -194,11 +194,11 @@ public static class Builder ImmutableMap.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())); + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -212,12 +212,14 @@ public static class Builder .setInitialRetryDelay(Duration.ofMillis(1000L)) .setRetryDelayMultiplier(2.5) .setMaxRetryDelay(Duration.ofMillis(120000L)) - .setInitialRpcTimeout(Duration.ofMillis(120000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(120000L)) + .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(); } @@ -251,15 +253,15 @@ private static Builder initDefaults(Builder builder) { builder .annotateVideoSettings() - .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 .annotateVideoOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .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")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(AnnotateVideoResponse.class)) diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/StreamingVideoIntelligenceServiceStubSettings.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/StreamingVideoIntelligenceServiceStubSettings.java index 71ace0b2a..0d6aa63cf 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/StreamingVideoIntelligenceServiceStubSettings.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/StreamingVideoIntelligenceServiceStubSettings.java @@ -165,11 +165,16 @@ public static class Builder ImmutableMap.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())); + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -178,6 +183,17 @@ public static class Builder static { ImmutableMap.Builder definitions = ImmutableMap.builder(); RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.5) + .setMaxRetryDelay(Duration.ofMillis(120000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("retry_policy_1_params", settings); settings = RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(100L)) @@ -188,7 +204,9 @@ public static class Builder .setMaxRpcTimeout(Duration.ofMillis(10800000L)) .setTotalTimeout(Duration.ofMillis(10800000L)) .build(); - definitions.put("default", settings); + definitions.put("retry_policy_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } diff --git a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/VideoIntelligenceServiceStubSettings.java b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/VideoIntelligenceServiceStubSettings.java index 5adf90dc9..a970715c6 100644 --- a/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/VideoIntelligenceServiceStubSettings.java +++ b/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p3beta1/stub/VideoIntelligenceServiceStubSettings.java @@ -194,11 +194,11 @@ public static class Builder ImmutableMap.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())); + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -212,12 +212,14 @@ public static class Builder .setInitialRetryDelay(Duration.ofMillis(1000L)) .setRetryDelayMultiplier(2.5) .setMaxRetryDelay(Duration.ofMillis(120000L)) - .setInitialRpcTimeout(Duration.ofMillis(120000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(120000L)) + .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(); } @@ -251,15 +253,15 @@ private static Builder initDefaults(Builder builder) { builder .annotateVideoSettings() - .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 .annotateVideoOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .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")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(AnnotateVideoResponse.class)) diff --git a/synth.metadata b/synth.metadata index 14ffdf9b5..0839eeaa9 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-video-intelligence.git", - "sha": "6e0071f7503e0daeff76104f9f721976d14fd936" + "sha": "6138864096330e7101353f0694059d7e501f999c" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c4e37010d74071851ff24121f522e802231ac86e", - "internalRef": "313460921" + "sha": "251d9358730b5cec7625d9f42879444a7d5369d5", + "internalRef": "316978059" } }, {