Skip to content

Commit 664b550

Browse files
fix: add comment/documentation for setRetrySettings (#2309)
* fix: add retry setting documentation * . * . * 🦉 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>
1 parent d3cbfa0 commit 664b550

File tree

3 files changed

+39
-5
lines changed

3 files changed

+39
-5
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ implementation 'com.google.cloud:google-cloud-bigquerystorage'
5757
If you are using Gradle without BOM, add this to your dependencies:
5858

5959
```Groovy
60-
implementation 'com.google.cloud:google-cloud-bigquerystorage:2.44.1'
60+
implementation 'com.google.cloud:google-cloud-bigquerystorage:2.45.0'
6161
```
6262

6363
If you are using SBT, add this to your dependencies:
6464

6565
```Scala
66-
libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "2.44.1"
66+
libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "2.45.0"
6767
```
6868
<!-- {x-version-update-end} -->
6969

@@ -220,7 +220,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
220220
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquerystorage/java11.html
221221
[stability-image]: https://img.shields.io/badge/stability-stable-green
222222
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquerystorage.svg
223-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquerystorage/2.44.1
223+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquerystorage/2.45.0
224224
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
225225
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
226226
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonStreamWriter.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,24 @@ public Builder setCompressorName(String compressorName) {
348348
}
349349

350350
/**
351-
* Sets the RetrySettings to use for in-stream error retry.
351+
* Enable client lib automatic retries on request level errors.
352+
*
353+
* <pre>
354+
* Immeidate Retry code:
355+
* ABORTED, UNAVAILABLE, CANCELLED, INTERNAL, DEADLINE_EXCEEDED
356+
* Backoff Retry code:
357+
* RESOURCE_EXHAUSTED
358+
*
359+
* Example:
360+
* RetrySettings retrySettings = RetrySettings.newBuilder()
361+
* .setInitialRetryDelay(Duration.ofMillis(500)) // applies to backoff retry
362+
* .setRetryDelayMultiplier(1.1) // applies to backoff retry
363+
* .setMaxAttempts(5) // applies to both retries
364+
* .setMaxRetryDelay(Duration.ofMinutes(1)) // applies to backoff retry .build();
365+
* </pre>
352366
*
353367
* @param retrySettings
354-
* @return Builder
368+
* @return
355369
*/
356370
public Builder setRetrySettings(RetrySettings retrySettings) {
357371
this.schemaAwareStreamWriterBuilder.setRetrySettings(retrySettings);

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,26 @@ public Builder setDefaultMissingValueInterpretation(
766766
return this;
767767
}
768768

769+
/**
770+
* Enable client lib automatic retries on request level errors.
771+
*
772+
* <pre>
773+
* Immeidate Retry code:
774+
* ABORTED, UNAVAILABLE, CANCELLED, INTERNAL, DEADLINE_EXCEEDED
775+
* Backoff Retry code:
776+
* RESOURCE_EXHAUSTED
777+
*
778+
* Example:
779+
* RetrySettings retrySettings = RetrySettings.newBuilder()
780+
* .setInitialRetryDelay(Duration.ofMillis(500)) // applies to backoff retry
781+
* .setRetryDelayMultiplier(1.1) // applies to backoff retry
782+
* .setMaxAttempts(5) // applies to both retries
783+
* .setMaxRetryDelay(Duration.ofMinutes(1)) // applies to backoff retry .build();
784+
* </pre>
785+
*
786+
* @param retrySettings
787+
* @return
788+
*/
769789
public Builder setRetrySettings(RetrySettings retrySettings) {
770790
this.retrySettings = retrySettings;
771791
return this;

0 commit comments

Comments
 (0)