reuvenlax commented on code in PR #41806:
URL: https://github.com/apache/beam/pull/41806#discussion_r4764527867
##########
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:
done, though I'm not sure having SimpleParDoFn read the constants out of
DataflowOutputCounter is cleaner. Added a comment to cleanup. Also it does seem
like this is a workaround to a hotspot bug that will be fully fixed by JDK 24,
so we might be able to remove entirely then.
--
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]