Skip to content

Commit 337e8b1

Browse files
committed
docs(bigquery): add javadoc comments to retry-wrapping helper methods
1 parent 9845a87 commit 337e8b1

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2413,6 +2413,12 @@ private static boolean isRetryErrorCodeHttpNotFound(BigQueryRetryHelperException
24132413
return false;
24142414
}
24152415

2416+
/**
2417+
* Helper to retrieve the retry algorithm wrapped for safe HTTP 5xx error retries.
2418+
*
2419+
* <p>This delegates to {@link BigQueryRetryHelper#maybeWrapForHttpRetry} to ensure safe
2420+
* conditional wrapping of the default algorithm while leaving custom user algorithms untouched.
2421+
*/
24162422
@SuppressWarnings("unchecked")
24172423
private <V> ResultRetryAlgorithm<V> getRetryAlgorithmWithHttpRetry() {
24182424
return BigQueryRetryHelper.maybeWrapForHttpRetry(

java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ private static <V> V run(
121121
return retryingFuture.get();
122122
}
123123

124+
/**
125+
* Conditionally wraps the provided retry algorithm with a wrapper that retries on transient HTTP
126+
* 5xx errors (500, 502, 503, 504).
127+
*
128+
* <p>Wrapping only occurs if the provided algorithm is the default {@link
129+
* BigQueryBaseService#DEFAULT_BIGQUERY_EXCEPTION_HANDLER}. Custom user-defined retry algorithms
130+
* are returned unmodified to preserve custom retry policies.
131+
*/
124132
static <V> ResultRetryAlgorithm<V> maybeWrapForHttpRetry(ResultRetryAlgorithm<V> algorithm) {
125133
if (algorithm == BigQueryBaseService.DEFAULT_BIGQUERY_EXCEPTION_HANDLER) {
126134
return wrapDefaultAlgorithm(algorithm);

0 commit comments

Comments
 (0)