Skip to content

Commit

Permalink
fix: add comment/documentation for setRetrySettings (#2309)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
yirutang and gcf-owl-bot[bot] committed Nov 7, 2023
1 parent d3cbfa0 commit 664b550
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -57,13 +57,13 @@ implementation 'com.google.cloud:google-cloud-bigquerystorage'
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-bigquerystorage:2.44.1'
implementation 'com.google.cloud:google-cloud-bigquerystorage:2.45.0'
```

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

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

Expand Down Expand Up @@ -220,7 +220,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquerystorage/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquerystorage.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquerystorage/2.44.1
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquerystorage/2.45.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Expand Up @@ -348,10 +348,24 @@ public Builder setCompressorName(String compressorName) {
}

/**
* Sets the RetrySettings to use for in-stream error retry.
* Enable client lib automatic retries on request level errors.
*
* <pre>
* Immeidate Retry code:
* ABORTED, UNAVAILABLE, CANCELLED, INTERNAL, DEADLINE_EXCEEDED
* Backoff Retry code:
* RESOURCE_EXHAUSTED
*
* Example:
* RetrySettings retrySettings = RetrySettings.newBuilder()
* .setInitialRetryDelay(Duration.ofMillis(500)) // applies to backoff retry
* .setRetryDelayMultiplier(1.1) // applies to backoff retry
* .setMaxAttempts(5) // applies to both retries
* .setMaxRetryDelay(Duration.ofMinutes(1)) // applies to backoff retry .build();
* </pre>
*
* @param retrySettings
* @return Builder
* @return
*/
public Builder setRetrySettings(RetrySettings retrySettings) {
this.schemaAwareStreamWriterBuilder.setRetrySettings(retrySettings);
Expand Down
Expand Up @@ -766,6 +766,26 @@ public Builder setDefaultMissingValueInterpretation(
return this;
}

/**
* Enable client lib automatic retries on request level errors.
*
* <pre>
* Immeidate Retry code:
* ABORTED, UNAVAILABLE, CANCELLED, INTERNAL, DEADLINE_EXCEEDED
* Backoff Retry code:
* RESOURCE_EXHAUSTED
*
* Example:
* RetrySettings retrySettings = RetrySettings.newBuilder()
* .setInitialRetryDelay(Duration.ofMillis(500)) // applies to backoff retry
* .setRetryDelayMultiplier(1.1) // applies to backoff retry
* .setMaxAttempts(5) // applies to both retries
* .setMaxRetryDelay(Duration.ofMinutes(1)) // applies to backoff retry .build();
* </pre>
*
* @param retrySettings
* @return
*/
public Builder setRetrySettings(RetrySettings retrySettings) {
this.retrySettings = retrySettings;
return this;
Expand Down

0 comments on commit 664b550

Please sign in to comment.