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

Add support for setting an HTTP read timeout for BigQueryIO #32118

Merged
merged 1 commit into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ public interface BigQueryOptions
void setTempDatasetId(String value);

@Description(
"Timeout for HTTP requests to BigQuery service in milliseconds. Set to 0 to disable.")
"Timeout for HTTP read requests to BigQuery service in milliseconds. Set to 0 to disable.")
@Default.Integer(80 * 1000)
Integer getHTTPReadTimeout();

void setHTTPReadTimeout(Integer timeout);

@Description(
"Timeout for HTTP write requests to BigQuery service in milliseconds. Set to 0 to disable.")
@Default.Integer(900 * 1000)
Integer getHTTPWriteTimeout();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1584,6 +1584,7 @@ private static Bigquery.Builder newBigQueryClient(BigQueryOptions options) {
RetryHttpRequestInitializer httpRequestInitializer =
new RetryHttpRequestInitializer(ImmutableList.of(404));
httpRequestInitializer.setCustomErrors(createBigQueryClientCustomErrors());
httpRequestInitializer.setReadTimeout(options.getHTTPReadTimeout());
httpRequestInitializer.setWriteTimeout(options.getHTTPWriteTimeout());
ImmutableList.Builder<HttpRequestInitializer> initBuilder = ImmutableList.builder();
Credentials credential = options.getGcpCredential();
Expand Down
Loading