[GLUTEN-12394][CORE] Consolidate JniLibLoader.load() as a thin delegate of loadAndCreateLink()#12520
Open
PerumalsamyR wants to merge 2 commits into
Open
[GLUTEN-12394][CORE] Consolidate JniLibLoader.load() as a thin delegate of loadAndCreateLink()#12520PerumalsamyR wants to merge 2 commits into
PerumalsamyR wants to merge 2 commits into
Conversation
…te of loadAndCreateLink() After apache#12393, load(libPath) and loadAndCreateLink(libPath, null) are behaviorally identical: same dedup check, same extraction to workDir, same load call, same logging. Keep one copy of that sequence by making load() delegate to loadAndCreateLink() with a null link name. Fixes apache#12394
|
Run Gluten Clickhouse CI on x86 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces duplication in JniLibLoader by making load(String libPath) delegate directly to loadAndCreateLink(libPath, null), consolidating the native library extraction/load sequence in one place and aligning the Javadocs with the new structure.
Changes:
- Refactor
JniLibLoader.load()into a one-line delegate toloadAndCreateLink(..., null). - Update Javadoc for
load()andloadAndCreateLink()to reflect the shared contract and clarifynullbehavior forlinkName.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jackylee-ch
reviewed
Jul 15, 2026
| /** | ||
| * 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. |
Contributor
There was a problem hiding this comment.
This should not be deleted.
Author
There was a problem hiding this comment.
Thanks for the review! Restored the sentence in a4d75c4.
Contributor
|
@PerumalsamyR Thanks for your first PR. Basically looks good to me, Thanks. I left a comment, PTAL. |
|
Run Gluten Clickhouse CI on x86 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are proposed in this pull request?
After #12393,
JniLibLoader.load(libPath)andJniLibLoader.loadAndCreateLink(libPath, null)are behaviorally identical: same already-loaded dedup check, same extraction to the work dir, same load call, same logging, same exception wrapping. The only difference is thelinkNameargument, andloadWithLinkalready skips the symlink branch whenlinkName == null.This PR removes the duplication by making
load()a one-line delegate ofloadAndCreateLink(libPath, null), so there is a single copy of the loading sequence to evolve, and updates the Javadoc of both methods accordingly.No behavior change.
Fixes #12394
How was this patch tested?
Existing
JniLibLoaderTestpasses (mvn test -pl gluten-core -Pspark-3.5 -Dtest=JniLibLoaderTest).Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code