Skip to content

Commit

Permalink
feat: update retry settings (#201)
Browse files Browse the repository at this point in the history
Renames the service name from Stackdriver Logging to Cloud Logging. Specifies client retry behavior and a few other documentation updates.

PiperOrigin-RevId: 320016414

Source-Author: Google APIs <noreply@google.com>
Source-Date: Tue Jul 7 10:52:01 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: aba9760d6abc15f724753c26d6f306e0f76dd11a
Source-Link: googleapis/googleapis@aba9760

Co-authored-by: Jeff Ching <chingor@google.com>
  • Loading branch information
yoshi-automation and chingor13 committed Sep 1, 2020
1 parent 839f4c5 commit 6b9d382
Show file tree
Hide file tree
Showing 40 changed files with 893 additions and 743 deletions.
Expand Up @@ -15,7 +15,7 @@
*/

/**
* A client to Stackdriver Logging API.
* A client to Cloud Logging API.
*
* <p>The interfaces provided are listed below, along with usage samples.
*
Expand Down
Expand Up @@ -49,7 +49,7 @@

// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
* Base stub class for Stackdriver Logging API.
* Base stub class for Cloud Logging API.
*
* <p>This class is for advanced usage and reflects the underlying API directly.
*/
Expand Down
Expand Up @@ -501,18 +501,15 @@ public static class Builder extends StubSettings.Builder<ConfigServiceV2StubSett
ImmutableMap.Builder<String, ImmutableSet<StatusCode.Code>> definitions =
ImmutableMap.builder();
definitions.put(
"idempotent",
"no_retry_2_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
definitions.put(
"retry_policy_3_codes",
ImmutableSet.copyOf(
Lists.<StatusCode.Code>newArrayList(
StatusCode.Code.DEADLINE_EXCEEDED,
StatusCode.Code.INTERNAL,
StatusCode.Code.UNAVAILABLE)));
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
definitions.put(
"idempotent2",
ImmutableSet.copyOf(
Lists.<StatusCode.Code>newArrayList(
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}

Expand All @@ -526,12 +523,22 @@ public static class Builder extends StubSettings.Builder<ConfigServiceV2StubSett
.setInitialRetryDelay(Duration.ofMillis(100L))
.setRetryDelayMultiplier(1.3)
.setMaxRetryDelay(Duration.ofMillis(60000L))
.setInitialRpcTimeout(Duration.ofMillis(20000L))
.setInitialRpcTimeout(Duration.ofMillis(60000L))
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ofMillis(60000L))
.setTotalTimeout(Duration.ofMillis(60000L))
.build();
definitions.put("retry_policy_3_params", settings);
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
definitions.put("no_retry_params", settings);
settings =
RetrySettings.newBuilder()
.setInitialRpcTimeout(Duration.ofMillis(120000L))
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ofMillis(20000L))
.setTotalTimeout(Duration.ofMillis(600000L))
.setMaxRpcTimeout(Duration.ofMillis(120000L))
.setTotalTimeout(Duration.ofMillis(120000L))
.build();
definitions.put("default", settings);
definitions.put("no_retry_2_params", settings);
RETRY_PARAM_DEFINITIONS = definitions.build();
}

Expand Down Expand Up @@ -606,78 +613,78 @@ private static Builder initDefaults(Builder builder) {

builder
.deleteSinkSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));

builder
.updateSinkSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));

builder
.deleteExclusionSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));

builder
.listBucketsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.getBucketSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.updateBucketSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.listSinksSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));

builder
.getSinkSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));

builder
.createSinkSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params"));

builder
.listExclusionsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));

builder
.getExclusionSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));

builder
.createExclusionSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params"));

builder
.updateExclusionSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params"));

builder
.getCmekSettingsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.updateCmekSettingsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

return builder;
}
Expand Down
Expand Up @@ -36,7 +36,7 @@

// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
* gRPC callable factory implementation for Stackdriver Logging API.
* gRPC callable factory implementation for Cloud Logging API.
*
* <p>This class is for advanced usage.
*/
Expand Down
Expand Up @@ -60,7 +60,7 @@

// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
* gRPC stub implementation for Stackdriver Logging API.
* gRPC stub implementation for Cloud Logging API.
*
* <p>This class is for advanced usage and reflects the underlying API directly.
*/
Expand Down
Expand Up @@ -36,7 +36,7 @@

// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
* gRPC callable factory implementation for Stackdriver Logging API.
* gRPC callable factory implementation for Cloud Logging API.
*
* <p>This class is for advanced usage.
*/
Expand Down
Expand Up @@ -47,7 +47,7 @@

// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
* gRPC stub implementation for Stackdriver Logging API.
* gRPC stub implementation for Cloud Logging API.
*
* <p>This class is for advanced usage and reflects the underlying API directly.
*/
Expand Down
Expand Up @@ -36,7 +36,7 @@

// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
* gRPC callable factory implementation for Stackdriver Logging API.
* gRPC callable factory implementation for Cloud Logging API.
*
* <p>This class is for advanced usage.
*/
Expand Down
Expand Up @@ -43,7 +43,7 @@

// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
* gRPC stub implementation for Stackdriver Logging API.
* gRPC stub implementation for Cloud Logging API.
*
* <p>This class is for advanced usage and reflects the underlying API directly.
*/
Expand Down
Expand Up @@ -36,7 +36,7 @@

// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
* Base stub class for Stackdriver Logging API.
* Base stub class for Cloud Logging API.
*
* <p>This class is for advanced usage and reflects the underlying API directly.
*/
Expand Down
Expand Up @@ -514,18 +514,20 @@ public static class Builder extends StubSettings.Builder<LoggingServiceV2StubSet
ImmutableMap.Builder<String, ImmutableSet<StatusCode.Code>> definitions =
ImmutableMap.builder();
definitions.put(
"idempotent",
"retry_policy_1_codes",
ImmutableSet.copyOf(
Lists.<StatusCode.Code>newArrayList(
StatusCode.Code.DEADLINE_EXCEEDED,
StatusCode.Code.INTERNAL,
StatusCode.Code.UNAVAILABLE)));
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
definitions.put(
"idempotent2",
"retry_policy_2_codes",
ImmutableSet.copyOf(
Lists.<StatusCode.Code>newArrayList(
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
StatusCode.Code.DEADLINE_EXCEEDED,
StatusCode.Code.INTERNAL,
StatusCode.Code.UNAVAILABLE)));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}

Expand All @@ -539,12 +541,25 @@ public static class Builder extends StubSettings.Builder<LoggingServiceV2StubSet
.setInitialRetryDelay(Duration.ofMillis(100L))
.setRetryDelayMultiplier(1.3)
.setMaxRetryDelay(Duration.ofMillis(60000L))
.setInitialRpcTimeout(Duration.ofMillis(20000L))
.setInitialRpcTimeout(Duration.ofMillis(60000L))
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ofMillis(60000L))
.setTotalTimeout(Duration.ofMillis(60000L))
.build();
definitions.put("retry_policy_1_params", settings);
settings =
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(100L))
.setRetryDelayMultiplier(1.3)
.setMaxRetryDelay(Duration.ofMillis(60000L))
.setInitialRpcTimeout(Duration.ofMillis(3600000L))
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ofMillis(20000L))
.setTotalTimeout(Duration.ofMillis(600000L))
.setMaxRpcTimeout(Duration.ofMillis(3600000L))
.setTotalTimeout(Duration.ofMillis(3600000L))
.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();
}

Expand Down Expand Up @@ -592,13 +607,13 @@ private static Builder initDefaults(Builder builder) {

builder
.deleteLogSettings()
.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
.listLogEntriesSettings()
.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
.writeLogEntriesSettings()
Expand All @@ -616,18 +631,18 @@ private static Builder initDefaults(Builder builder) {
.build());
builder
.writeLogEntriesSettings()
.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
.listMonitoredResourceDescriptorsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
.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
.listLogsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
.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;
}
Expand Down
Expand Up @@ -32,7 +32,7 @@

// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
* Base stub class for Stackdriver Logging API.
* Base stub class for Cloud Logging API.
*
* <p>This class is for advanced usage and reflects the underlying API directly.
*/
Expand Down

0 comments on commit 6b9d382

Please sign in to comment.