beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pabl...@apache.org
Subject [beam] branch master updated: Add a deadline of 30s to SplitReadStream
Date Fri, 05 Mar 2021 17:12:25 GMT
This is an automated email from the ASF dual-hosted git repository.

pabloem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 38fbc8c  Add a deadline of 30s to SplitReadStream
     new adf85a1  Merge pull request #13896 from [BEAM-11326] Add a deadline of 30s to SplitReadStream
38fbc8c is described below

commit 38fbc8ca3ce1904e430e605798cff790d322e11d
Author: Kenneth Jung <kmjung@gmail.com>
AuthorDate: Thu Feb 4 10:48:21 2021 -0800

    Add a deadline of 30s to SplitReadStream
---
 .../sdk/io/gcp/bigquery/BigQueryServicesImpl.java  | 26 ++++++++++++++++------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryServicesImpl.java
b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryServicesImpl.java
index 8d95078..eb95c8b 100644
--- a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryServicesImpl.java
+++ b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryServicesImpl.java
@@ -28,7 +28,6 @@ import com.google.api.client.util.BackOffUtils;
 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;
@@ -1166,7 +1165,7 @@ class BigQueryServicesImpl implements BigQueryServices {
     private final BigQueryReadClient client;
 
     private StorageClientImpl(BigQueryOptions options) throws IOException {
-      BigQueryReadSettings.Builder builder =
+      BigQueryReadSettings.Builder settingsBuilder =
           BigQueryReadSettings.newBuilder()
               .setCredentialsProvider(FixedCredentialsProvider.create(options.getGcpCredential()))
               .setTransportChannelProvider(
@@ -1175,18 +1174,31 @@ class BigQueryServicesImpl implements BigQueryServices {
                       .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());
+
+      this.client = BigQueryReadClient.create(settingsBuilder.build());
     }
 
     @Override


Mime
View raw message