-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GLUTEN-6148][CORE] Simplify JniLibLoader loading mechanism for native libraries #6791
[GLUTEN-6148][CORE] Simplify JniLibLoader loading mechanism for native libraries #6791
Conversation
Thanks for opening a pull request! Could you open an issue for this pull request on Github Issues? https://github.com/apache/incubator-gluten/issues Then could you also rename commit message and pull request title in the following format?
See also: |
Run Gluten Clickhouse CI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a little minors. Thanks.
abort(); | ||
throw new GlutenException(e); | ||
public void loadAndCreateLink(String libName, String linkName, boolean requireUnload) { | ||
sync.lock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this lock as class member? Perhaps we can minimize the lock scope by only making operations on loadedLibraries
atomic. Say synchronized (loadedLibraries) {...}
may be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good catch, updated thanks
@@ -72,7 +62,7 @@ public class JniLibLoader { | |||
private final Set<String> loadedLibraries = new HashSet<>(); | |||
private final Lock sync = new ReentrantLock(); | |||
|
|||
JniLibLoader(String workDir) { | |||
public JniLibLoader(String workDir) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep the ctor package-private? If no other places are calling it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done thanks!
Run Gluten Clickhouse CI |
Run Gluten Clickhouse CI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see there are still some unnecessary synchronizations but should be benign overall. So let's merge this first. Thank you for the effort.
Ah missed the inner ones, I'll remove in a follow up change |
…e libraries (apache#6791) Closes apache#6148
What changes were proposed in this pull request?
JniLibLoader
to maintain simplicity in the change)Fixes: #6148
How was this patch tested?