ashokkumar-allu commented on code in PR #18585:
URL: https://github.com/apache/hudi/pull/18585#discussion_r3286190712


##########
hudi-common/src/main/java/org/apache/hudi/common/engine/HoodieLocalEngineContext.java:
##########
@@ -63,6 +69,69 @@
  */
 public final class HoodieLocalEngineContext extends HoodieEngineContext {
 
+  private static final Logger LOG = 
LoggerFactory.getLogger(HoodieLocalEngineContext.class);
+
+  // When running in Java 11+, the common ForkJoinPool's workers don't inherit 
the application
+  // classloader, causing ClassNotFoundExceptions. We use a custom pool whose 
thread factory
+  // explicitly sets the correct classloader.
+  // See: 
https://stackoverflow.com/questions/66240365/java-11-upgrade-from-8-parallel-streams-throws-classnotfoundexception
+  private static final ForkJoinPool FORK_JOIN_POOL = initForkJoinPool();
+
+  private static ForkJoinPool initForkJoinPool() {
+    int javaVersion = 0;
+    try {
+      String specVersion = System.getProperty("java.specification.version");
+      // Pre-Java 9: "1.X" format; Java 9+: "11", "17", "21", etc.
+      javaVersion = specVersion.startsWith("1.")

Review Comment:
   Updated it.



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