Skip to content

Commit

Permalink
chore: update retry settings for backup rpcs (#2107)
Browse files Browse the repository at this point in the history
* chore: update retry settings for backup rpcs

PiperOrigin-RevId: 605367937

Source-Link: googleapis/googleapis@63d2a60

Source-Link: https://github.com/googleapis/googleapis-gen/commit/36c1d985f2b077cc97b2bc69f0e2982c3b6e6bf5
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzZjMWQ5ODVmMmIwNzdjYzk3YjJiYzY5ZjBlMjk4MmMzYjZlNmJmNSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Feb 8, 2024
1 parent a6c7c77 commit 2804b2c
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -628,14 +628,14 @@ public static class Builder
ImmutableMap.Builder<String, ImmutableSet<StatusCode.Code>> definitions =
ImmutableMap.builder();
definitions.put(
"no_retry_5_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
"no_retry_4_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
definitions.put(
"retry_policy_6_codes",
"retry_policy_5_codes",
ImmutableSet.copyOf(
Lists.<StatusCode.Code>newArrayList(
StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED)));
definitions.put(
"no_retry_7_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
"no_retry_6_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}
Expand All @@ -652,7 +652,7 @@ public static class Builder
.setMaxRpcTimeout(Duration.ofMillis(300000L))
.setTotalTimeout(Duration.ofMillis(300000L))
.build();
definitions.put("no_retry_5_params", settings);
definitions.put("no_retry_4_params", settings);
settings =
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(1000L))
Expand All @@ -663,15 +663,15 @@ public static class Builder
.setMaxRpcTimeout(Duration.ofMillis(60000L))
.setTotalTimeout(Duration.ofMillis(60000L))
.build();
definitions.put("retry_policy_6_params", settings);
definitions.put("retry_policy_5_params", settings);
settings =
RetrySettings.newBuilder()
.setInitialRpcTimeout(Duration.ofMillis(60000L))
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ofMillis(60000L))
.setTotalTimeout(Duration.ofMillis(60000L))
.build();
definitions.put("no_retry_7_params", settings);
definitions.put("no_retry_6_params", settings);
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
definitions.put("no_retry_params", settings);
RETRY_PARAM_DEFINITIONS = definitions.build();
Expand Down Expand Up @@ -811,53 +811,53 @@ private static Builder createDefault() {
private static Builder initDefaults(Builder builder) {
builder
.createInstanceSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_5_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params"));

builder
.getInstanceSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));

builder
.listInstancesSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));

builder
.updateInstanceSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));

builder
.partialUpdateInstanceSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));

builder
.deleteInstanceSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params"));

builder
.createClusterSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params"));

builder
.getClusterSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));

builder
.listClustersSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));

builder
.updateClusterSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));

builder
.partialUpdateClusterSettings()
Expand All @@ -866,61 +866,61 @@ private static Builder initDefaults(Builder builder) {

builder
.deleteClusterSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params"));

builder
.createAppProfileSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params"));

builder
.getAppProfileSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));

builder
.listAppProfilesSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));

builder
.updateAppProfileSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));

builder
.deleteAppProfileSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params"));

builder
.getIamPolicySettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));

builder
.setIamPolicySettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params"));

builder
.testIamPermissionsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));

builder
.listHotTabletsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"));

builder
.createInstanceOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.<CreateInstanceRequest, OperationSnapshot>newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_5_params"))
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Instance.class))
Expand All @@ -943,8 +943,8 @@ private static Builder initDefaults(Builder builder) {
.setInitialCallSettings(
UnaryCallSettings
.<PartialUpdateInstanceRequest, OperationSnapshot>newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"))
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Instance.class))
Expand All @@ -967,8 +967,8 @@ private static Builder initDefaults(Builder builder) {
.setInitialCallSettings(
UnaryCallSettings
.<CreateClusterRequest, OperationSnapshot>newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params"))
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Cluster.class))
Expand All @@ -990,8 +990,8 @@ private static Builder initDefaults(Builder builder) {
.updateClusterOperationSettings()
.setInitialCallSettings(
UnaryCallSettings.<Cluster, OperationSnapshot>newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"))
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Cluster.class))
Expand Down Expand Up @@ -1039,8 +1039,8 @@ private static Builder initDefaults(Builder builder) {
.setInitialCallSettings(
UnaryCallSettings
.<UpdateAppProfileRequest, OperationSnapshot>newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params"))
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(AppProfile.class))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -732,12 +732,7 @@ public static class Builder
definitions.put(
"no_retry_1_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
definitions.put(
"no_retry_4_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
definitions.put(
"retry_policy_3_codes",
ImmutableSet.copyOf(
Lists.<StatusCode.Code>newArrayList(
StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED)));
"no_retry_3_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}

Expand Down Expand Up @@ -782,18 +777,7 @@ public static class Builder
.setMaxRpcTimeout(Duration.ofMillis(3600000L))
.setTotalTimeout(Duration.ofMillis(3600000L))
.build();
definitions.put("no_retry_4_params", settings);
settings =
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(1000L))
.setRetryDelayMultiplier(2.0)
.setMaxRetryDelay(Duration.ofMillis(60000L))
.setInitialRpcTimeout(Duration.ofMillis(60000L))
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ofMillis(60000L))
.setTotalTimeout(Duration.ofMillis(60000L))
.build();
definitions.put("retry_policy_3_params", settings);
definitions.put("no_retry_3_params", settings);
RETRY_PARAM_DEFINITIONS = definitions.build();
}

Expand Down Expand Up @@ -988,18 +972,18 @@ private static Builder initDefaults(Builder builder) {

builder
.dropRowRangeSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params"));

builder
.generateConsistencyTokenSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));

builder
.checkConsistencySettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));

builder
.snapshotTableSettings()
Expand All @@ -1013,8 +997,8 @@ private static Builder initDefaults(Builder builder) {

builder
.listSnapshotsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));

builder
.deleteSnapshotSettings()
Expand Down Expand Up @@ -1058,8 +1042,8 @@ private static Builder initDefaults(Builder builder) {

builder
.getIamPolicySettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));

builder
.setIamPolicySettings()
Expand All @@ -1068,8 +1052,8 @@ private static Builder initDefaults(Builder builder) {

builder
.testIamPermissionsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params"));

builder
.createTableFromSnapshotOperationSettings()
Expand Down

0 comments on commit 2804b2c

Please sign in to comment.