This is an automated email from the ASF dual-hosted git repository.

leaves12138 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new e41c77297c [common] Initialize JNI libraries independently by name 
(#10100)
e41c77297c is described below

commit e41c77297ce11c40ffee9dbf6d01b35352cb7fac
Author: YeJunHao <[email protected]>
AuthorDate: Tue Sep 22 18:43:21 2026 +0800

    [common] Initialize JNI libraries independently by name (#10100)
---
 paimon-common/src/main/java/org/apache/paimon/utils/JNIUtils.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/paimon-common/src/main/java/org/apache/paimon/utils/JNIUtils.java 
b/paimon-common/src/main/java/org/apache/paimon/utils/JNIUtils.java
index eff716be3d..9a37d04098 100644
--- a/paimon-common/src/main/java/org/apache/paimon/utils/JNIUtils.java
+++ b/paimon-common/src/main/java/org/apache/paimon/utils/JNIUtils.java
@@ -24,7 +24,9 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.util.HashSet;
 import java.util.Locale;
+import java.util.Set;
 import java.util.logging.Logger;
 
 /**
@@ -35,7 +37,7 @@ public class JNIUtils {
 
     private static final Logger LOG = 
Logger.getLogger(JNIUtils.class.getName());
 
-    private static boolean inited = false;
+    private static final Set<String> INITIALIZED_LIBRARIES = new HashSet<>();
 
     private static String osName() {
         String osName = 
System.getProperty("os.name").toLowerCase(Locale.ROOT).replace(' ', '_');
@@ -84,7 +86,7 @@ public class JNIUtils {
     }
 
     public static synchronized void load(String jniName) {
-        if (!inited) {
+        if (!INITIALIZED_LIBRARIES.contains(jniName)) {
             String jniFileName = resourceName(jniName);
             InputStream jniFileInput = 
JNIUtils.class.getResourceAsStream(jniFileName);
             if (jniFileInput == null) {
@@ -111,7 +113,7 @@ public class JNIUtils {
                             }
 
                             loadLibraryFile(tempFile.getAbsolutePath());
-                            inited = true;
+                            INITIALIZED_LIBRARIES.add(jniName);
                             return;
                         }
 

Reply via email to