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

jackylee-ch pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new 49ef3fd9d6 [GLUTEN-12394][CORE] Consolidate JniLibLoader.load() as a 
thin delegate of loadAndCreateLink() (#12520)
49ef3fd9d6 is described below

commit 49ef3fd9d694a78de0fcec122ba85f22a50464bd
Author: PerumalsamyR <[email protected]>
AuthorDate: Wed Jul 15 19:49:04 2026 -0700

    [GLUTEN-12394][CORE] Consolidate JniLibLoader.load() as a thin delegate of 
loadAndCreateLink() (#12520)
---
 .../java/org/apache/gluten/jni/JniLibLoader.java     | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/gluten-core/src/main/java/org/apache/gluten/jni/JniLibLoader.java 
b/gluten-core/src/main/java/org/apache/gluten/jni/JniLibLoader.java
index dcb024b006..850dac5816 100644
--- a/gluten-core/src/main/java/org/apache/gluten/jni/JniLibLoader.java
+++ b/gluten-core/src/main/java/org/apache/gluten/jni/JniLibLoader.java
@@ -85,25 +85,19 @@ public class JniLibLoader {
     loadFromPath0(file.getAbsolutePath());
   }
 
+  /**
+   * Extracts the library resource {@code libPath} to {@code workDir} and 
loads it. Returns
+   * immediately if {@code libPath} was already loaded by this instance.
+   */
   public synchronized void load(String libPath) {
-    try {
-      if (loadedLibraries.contains(libPath)) {
-        LOG.debug("Library {} has already been loaded, skipping", libPath);
-        return;
-      }
-      File file = moveToWorkDir(workDir, libPath);
-      loadWithLink(file.getAbsolutePath(), null);
-      loadedLibraries.add(libPath);
-      LOG.info("Successfully loaded library {}", libPath);
-    } catch (IOException e) {
-      throw new GlutenException(e);
-    }
+    loadAndCreateLink(libPath, null);
   }
 
   /**
    * Same contract as {@link #load(String)}, with the addition of creating a 
symbolic link named
    * {@code linkName} in {@code workDir} pointing at the extracted library. 
Returns immediately if
-   * {@code libPath} was already loaded by this instance.
+   * {@code libPath} was already loaded by this instance. Passing a null 
{@code linkName} skips the
+   * link creation.
    */
   public synchronized void loadAndCreateLink(String libPath, String linkName) {
     try {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to