Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add comment/documentation for setRetrySettings #2309

Merged
merged 4 commits into from Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 retrys
yirutang marked this conversation as resolved.
Show resolved Hide resolved
* .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 retrys
yirutang marked this conversation as resolved.
Show resolved Hide resolved
* .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