arunpandianp commented on code in PR #41806:
URL: https://github.com/apache/beam/pull/41806#discussion_r4763239537


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/SimpleParDoFnHelpers.java:
##########
@@ -162,58 +180,24 @@ void startBundle(Receiver... receivers) throws Exception {
   void reallyStartBundle() throws Exception {
     checkState(fnRunner == null, "bundle already started (or not properly 
finished)");
 
+    @Nullable Receiver mainReceiver =
+        receivers != null && mainReceiverIndex >= 0 && mainReceiverIndex < 
receivers.length

Review Comment:
   any reason to not move this to OutputManager constructor?



##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/SimpleParDoFnHelpers.java:
##########
@@ -78,6 +80,16 @@ class SimpleParDoFnHelpers<InputT, OutputT, W extends 
BoundedWindow> {
 
   private static final String COUNTER_NAME = "per-element-output-count";
 
+  // Concrete WindowedValues classes that always reside in GlobalWindow. 
Checking exact Class
+  // identity avoids HotSpot's _secondary_super_cache ping-pong (JDK-8180450) 
caused by interface
+  // checks across concurrent worker threads.
+  //
+  // TODO: Once Beam is on JDK 24, we can revert to a simpler instanceof call.
+  private static final Class<?> VALUE_IN_GLOBAL_WINDOW_CLASS =

Review Comment:
   can we reuse constants in 
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/DataflowOutputCounter.java?



##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/SimpleParDoFn.java:
##########


Review Comment:
   this can call the new registerStateCleanup method.



##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/SimpleParDoFnHelpers.java:
##########
@@ -244,14 +228,157 @@ void finishBundle(StreamingSideInputProcessor<?, ?> 
sideInputProcessor) throws E
       fnRunner = null;
       activeFnInfo = null;
       fnSignature = null;
+      hasState = false;
       sideInputProcessor = null;

Review Comment:
   nit: sideInputProcessor = null can be removed.



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