scwhittle commented on code in PR #32272:
URL: https://github.com/apache/beam/pull/32272#discussion_r1725729289


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/SplittableProcessFnFactory.java:
##########
@@ -131,6 +137,13 @@ public DoFnRunner<KeyedWorkItem<byte[], KV<InputT, 
RestrictionT>>, OutputT> crea
         OutputManager outputManager,
         DoFnSchemaInformation doFnSchemaInformation,
         Map<String, PCollectionView<?>> sideInputMapping) {
+      if (this.ses.get() == null) {

Review Comment:
   remembered a cleaner way to do this:
   
   private final Supplier sesSupplier = 
               Suppliers.memoize(
                   () ->  Executors.newScheduledThreadPool(
                   Runtime.getRuntime().availableProcessors(),
                   new 
ThreadFactoryBuilder().setNameFormat("df-sdf-executor-%d").build())));
   
   and then just ses.get() below



-- 
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