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

Commit ef27c8e

Browse files
fix: migrate retry settings to grpc_service_config (#169)
This PR was generated using Autosynth. 🌈 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: 317362697 Source-Link: googleapis/googleapis@5ffdbc3 PiperOrigin-RevId: 317362671 Source-Link: googleapis/googleapis@40489b3 PiperOrigin-RevId: 317323610 Source-Link: googleapis/googleapis@a75d8da
1 parent e3871d0 commit ef27c8e

17 files changed

Lines changed: 504 additions & 464 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
2020
<dependency>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>libraries-bom</artifactId>
23-
<version>5.7.0</version>
23+
<version>7.0.0</version>
2424
<type>pom</type>
2525
<scope>import</scope>
2626
</dependency>

google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/stub/WebSecurityScannerStubSettings.java

Lines changed: 43 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -549,11 +549,13 @@ public static class Builder
549549
ImmutableMap.Builder<String, ImmutableSet<StatusCode.Code>> definitions =
550550
ImmutableMap.builder();
551551
definitions.put(
552-
"idempotent",
552+
"retry_policy_1_codes",
553553
ImmutableSet.copyOf(
554554
Lists.<StatusCode.Code>newArrayList(
555555
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
556-
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
556+
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
557+
definitions.put(
558+
"no_retry_1_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
557559
RETRYABLE_CODE_DEFINITIONS = definitions.build();
558560
}
559561

@@ -567,12 +569,22 @@ public static class Builder
567569
.setInitialRetryDelay(Duration.ofMillis(100L))
568570
.setRetryDelayMultiplier(1.3)
569571
.setMaxRetryDelay(Duration.ofMillis(60000L))
570-
.setInitialRpcTimeout(Duration.ofMillis(20000L))
572+
.setInitialRpcTimeout(Duration.ofMillis(600000L))
573+
.setRpcTimeoutMultiplier(1.0)
574+
.setMaxRpcTimeout(Duration.ofMillis(600000L))
575+
.setTotalTimeout(Duration.ofMillis(600000L))
576+
.build();
577+
definitions.put("retry_policy_1_params", settings);
578+
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
579+
definitions.put("no_retry_params", settings);
580+
settings =
581+
RetrySettings.newBuilder()
582+
.setInitialRpcTimeout(Duration.ofMillis(600000L))
571583
.setRpcTimeoutMultiplier(1.0)
572-
.setMaxRpcTimeout(Duration.ofMillis(20000L))
584+
.setMaxRpcTimeout(Duration.ofMillis(600000L))
573585
.setTotalTimeout(Duration.ofMillis(600000L))
574586
.build();
575-
definitions.put("default", settings);
587+
definitions.put("no_retry_1_params", settings);
576588
RETRY_PARAM_DEFINITIONS = definitions.build();
577589
}
578590

@@ -641,68 +653,68 @@ private static Builder initDefaults(Builder builder) {
641653

642654
builder
643655
.createScanConfigSettings()
644-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
645-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
656+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
657+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
646658

647659
builder
648660
.deleteScanConfigSettings()
649-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
650-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
661+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
662+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
651663

652664
builder
653665
.getScanConfigSettings()
654-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
655-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
666+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
667+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
656668

657669
builder
658670
.listScanConfigsSettings()
659-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
660-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
671+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
672+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
661673

662674
builder
663675
.updateScanConfigSettings()
664-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
665-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
676+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
677+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
666678

667679
builder
668680
.startScanRunSettings()
669-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
670-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
681+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
682+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
671683

672684
builder
673685
.getScanRunSettings()
674-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
675-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
686+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
687+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
676688

677689
builder
678690
.listScanRunsSettings()
679-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
680-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
691+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
692+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
681693

682694
builder
683695
.stopScanRunSettings()
684-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
685-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
696+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
697+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
686698

687699
builder
688700
.listCrawledUrlsSettings()
689-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
690-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
701+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
702+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
691703

692704
builder
693705
.getFindingSettings()
694-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
695-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
706+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
707+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
696708

697709
builder
698710
.listFindingsSettings()
699-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
700-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
711+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
712+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
701713

702714
builder
703715
.listFindingTypeStatsSettings()
704-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
705-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
716+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
717+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
706718

707719
return builder;
708720
}

0 commit comments

Comments
 (0)