Skip to content
Merged
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 @@ -28,7 +28,6 @@
import com.google.api.client.util.ExponentialBackOff;
import com.google.api.client.util.Sleeper;
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.rpc.FixedHeaderProvider;
import com.google.api.gax.rpc.HeaderProvider;
import com.google.api.gax.rpc.ServerStream;
Expand Down Expand Up @@ -1166,7 +1165,7 @@ static class StorageClientImpl implements StorageClient {
private final BigQueryReadClient client;

private StorageClientImpl(BigQueryOptions options) throws IOException {
BigQueryReadSettings.Builder builder =
BigQueryReadSettings.Builder settingsBuilder =
BigQueryReadSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(options.getGcpCredential()))
.setTransportChannelProvider(
Expand All @@ -1175,18 +1174,31 @@ private StorageClientImpl(BigQueryOptions options) throws IOException {
.build());

UnaryCallSettings.Builder<CreateReadSessionRequest, ReadSession> createReadSessionSettings =
builder.getStubSettingsBuilder().createReadSessionSettings();
settingsBuilder.getStubSettingsBuilder().createReadSessionSettings();

RetrySettings.Builder retrySettings =
createReadSessionSettings.setRetrySettings(
createReadSessionSettings
.getRetrySettings()
.toBuilder()
.setInitialRpcTimeout(org.threeten.bp.Duration.ofHours(2))
.setMaxRpcTimeout(org.threeten.bp.Duration.ofHours(2))
.setTotalTimeout(org.threeten.bp.Duration.ofHours(2));
.setTotalTimeout(org.threeten.bp.Duration.ofHours(2))
.build());

createReadSessionSettings.setRetrySettings(retrySettings.build());
this.client = BigQueryReadClient.create(builder.build());
UnaryCallSettings.Builder<SplitReadStreamRequest, SplitReadStreamResponse>
splitReadStreamSettings =
settingsBuilder.getStubSettingsBuilder().splitReadStreamSettings();

splitReadStreamSettings.setRetrySettings(
splitReadStreamSettings
.getRetrySettings()
.toBuilder()
.setInitialRpcTimeout(org.threeten.bp.Duration.ofSeconds(30))
.setMaxRpcTimeout(org.threeten.bp.Duration.ofSeconds(30))
.setTotalTimeout(org.threeten.bp.Duration.ofSeconds(30))
.build());
Comment on lines +1190 to +1199
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it may be a silly question, but I'd just confirm to be sure: you don't need to call build again on splitReadStreamSettings and pass it back to settingsBuilder?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kmjung just confirming?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the existing code is correct. @stephaniewang526 can you confirm?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good -- shouldn't need to call .build() again on splitReadStreamSettings.


this.client = BigQueryReadClient.create(settingsBuilder.build());
}

@Override
Expand Down