lukecwik commented on code in PR #24950:
URL: https://github.com/apache/beam/pull/24950#discussion_r1065129982


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryServicesImpl.java:
##########
@@ -1491,12 +1494,36 @@ private static BigQueryWriteClient 
newBigQueryWriteClient(BigQueryOptions option
       return BigQueryWriteClient.create(
           BigQueryWriteSettings.newBuilder()
               .setCredentialsProvider(() -> 
options.as(GcpOptions.class).getGcpCredential())
+              .setBackgroundExecutorProvider(new 
OptionsExecutionProvider(options))
               .build());
     } catch (Exception e) {
       throw new RuntimeException(e);
     }
   }
 
+  /**
+   * OptionsExecutionProvider is a utility class used to wrap the 
Pipeline-wide {@link
+   * ScheduledExecutorService} into a supplier for the {@link 
BigQueryWriteClient}.
+   */
+  private static class OptionsExecutionProvider implements ExecutorProvider {

Review Comment:
   Consider using 
https://github.com/googleapis/gax-java/blob/47b9247a50347e9fd61ad5a9f5adaa4bdb757a26/gax/src/main/java/com/google/api/gax/core/FixedExecutorProvider.java#L54
 instead of creating a class that is effectively a FixedExecutorProvider



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to