Skip to content

Commit 6b9d382

Browse files
feat: update retry settings (#201)
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 <[email protected]> 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 <[email protected]>
1 parent 839f4c5 commit 6b9d382

40 files changed

+893
-743
lines changed

google-cloud-logging/src/main/java/com/google/cloud/logging/v2/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
/**
18-
* A client to Stackdriver Logging API.
18+
* A client to Cloud Logging API.
1919
*
2020
* <p>The interfaces provided are listed below, along with usage samples.
2121
*

google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
// AUTO-GENERATED DOCUMENTATION AND CLASS
5151
/**
52-
* Base stub class for Stackdriver Logging API.
52+
* Base stub class for Cloud Logging API.
5353
*
5454
* <p>This class is for advanced usage and reflects the underlying API directly.
5555
*/

google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java

Lines changed: 48 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -501,18 +501,15 @@ public static class Builder extends StubSettings.Builder<ConfigServiceV2StubSett
501501
ImmutableMap.Builder<String, ImmutableSet<StatusCode.Code>> definitions =
502502
ImmutableMap.builder();
503503
definitions.put(
504-
"idempotent",
504+
"no_retry_2_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
505+
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
506+
definitions.put(
507+
"retry_policy_3_codes",
505508
ImmutableSet.copyOf(
506509
Lists.<StatusCode.Code>newArrayList(
507510
StatusCode.Code.DEADLINE_EXCEEDED,
508511
StatusCode.Code.INTERNAL,
509512
StatusCode.Code.UNAVAILABLE)));
510-
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
511-
definitions.put(
512-
"idempotent2",
513-
ImmutableSet.copyOf(
514-
Lists.<StatusCode.Code>newArrayList(
515-
StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
516513
RETRYABLE_CODE_DEFINITIONS = definitions.build();
517514
}
518515

@@ -526,12 +523,22 @@ public static class Builder extends StubSettings.Builder<ConfigServiceV2StubSett
526523
.setInitialRetryDelay(Duration.ofMillis(100L))
527524
.setRetryDelayMultiplier(1.3)
528525
.setMaxRetryDelay(Duration.ofMillis(60000L))
529-
.setInitialRpcTimeout(Duration.ofMillis(20000L))
526+
.setInitialRpcTimeout(Duration.ofMillis(60000L))
527+
.setRpcTimeoutMultiplier(1.0)
528+
.setMaxRpcTimeout(Duration.ofMillis(60000L))
529+
.setTotalTimeout(Duration.ofMillis(60000L))
530+
.build();
531+
definitions.put("retry_policy_3_params", settings);
532+
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
533+
definitions.put("no_retry_params", settings);
534+
settings =
535+
RetrySettings.newBuilder()
536+
.setInitialRpcTimeout(Duration.ofMillis(120000L))
530537
.setRpcTimeoutMultiplier(1.0)
531-
.setMaxRpcTimeout(Duration.ofMillis(20000L))
532-
.setTotalTimeout(Duration.ofMillis(600000L))
538+
.setMaxRpcTimeout(Duration.ofMillis(120000L))
539+
.setTotalTimeout(Duration.ofMillis(120000L))
533540
.build();
534-
definitions.put("default", settings);
541+
definitions.put("no_retry_2_params", settings);
535542
RETRY_PARAM_DEFINITIONS = definitions.build();
536543
}
537544

@@ -606,78 +613,78 @@ private static Builder initDefaults(Builder builder) {
606613

607614
builder
608615
.deleteSinkSettings()
609-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
610-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
616+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
617+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
611618

612619
builder
613620
.updateSinkSettings()
614-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
615-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
621+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
622+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
616623

617624
builder
618625
.deleteExclusionSettings()
619-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
620-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
626+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
627+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
621628

622629
builder
623630
.listBucketsSettings()
624-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
625-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
631+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
632+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
626633

627634
builder
628635
.getBucketSettings()
629-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
630-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
636+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
637+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
631638

632639
builder
633640
.updateBucketSettings()
634-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
635-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
641+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
642+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
636643

637644
builder
638645
.listSinksSettings()
639-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
640-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
646+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
647+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
641648

642649
builder
643650
.getSinkSettings()
644-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
645-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
651+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
652+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
646653

647654
builder
648655
.createSinkSettings()
649-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
650-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
656+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes"))
657+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params"));
651658

652659
builder
653660
.listExclusionsSettings()
654-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
655-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
661+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
662+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
656663

657664
builder
658665
.getExclusionSettings()
659-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
660-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
666+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes"))
667+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params"));
661668

662669
builder
663670
.createExclusionSettings()
664-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
665-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
671+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes"))
672+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params"));
666673

667674
builder
668675
.updateExclusionSettings()
669-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
670-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
676+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes"))
677+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params"));
671678

672679
builder
673680
.getCmekSettingsSettings()
674-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2"))
675-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
681+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
682+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
676683

677684
builder
678685
.updateCmekSettingsSettings()
679-
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
680-
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
686+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
687+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
681688

682689
return builder;
683690
}

google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
// AUTO-GENERATED DOCUMENTATION AND CLASS
3838
/**
39-
* gRPC callable factory implementation for Stackdriver Logging API.
39+
* gRPC callable factory implementation for Cloud Logging API.
4040
*
4141
* <p>This class is for advanced usage.
4242
*/

google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060

6161
// AUTO-GENERATED DOCUMENTATION AND CLASS
6262
/**
63-
* gRPC stub implementation for Stackdriver Logging API.
63+
* gRPC stub implementation for Cloud Logging API.
6464
*
6565
* <p>This class is for advanced usage and reflects the underlying API directly.
6666
*/

google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
// AUTO-GENERATED DOCUMENTATION AND CLASS
3838
/**
39-
* gRPC callable factory implementation for Stackdriver Logging API.
39+
* gRPC callable factory implementation for Cloud Logging API.
4040
*
4141
* <p>This class is for advanced usage.
4242
*/

google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
// AUTO-GENERATED DOCUMENTATION AND CLASS
4949
/**
50-
* gRPC stub implementation for Stackdriver Logging API.
50+
* gRPC stub implementation for Cloud Logging API.
5151
*
5252
* <p>This class is for advanced usage and reflects the underlying API directly.
5353
*/

google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
// AUTO-GENERATED DOCUMENTATION AND CLASS
3838
/**
39-
* gRPC callable factory implementation for Stackdriver Logging API.
39+
* gRPC callable factory implementation for Cloud Logging API.
4040
*
4141
* <p>This class is for advanced usage.
4242
*/

google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
// AUTO-GENERATED DOCUMENTATION AND CLASS
4545
/**
46-
* gRPC stub implementation for Stackdriver Logging API.
46+
* gRPC stub implementation for Cloud Logging API.
4747
*
4848
* <p>This class is for advanced usage and reflects the underlying API directly.
4949
*/

google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
// AUTO-GENERATED DOCUMENTATION AND CLASS
3838
/**
39-
* Base stub class for Stackdriver Logging API.
39+
* Base stub class for Cloud Logging API.
4040
*
4141
* <p>This class is for advanced usage and reflects the underlying API directly.
4242
*/

0 commit comments

Comments
 (0)