lidavidm commented on code in PR #883:
URL: https://github.com/apache/arrow-java/pull/883#discussion_r2425072859
##########
c/src/main/java/org/apache/arrow/c/jni/JniLoader.java:
##########
@@ -75,8 +75,24 @@ private synchronized void loadRemaining() {
}
private void load(String name) {
+ String libraryName = System.mapLibraryName(name);
+
+ // If 'arrow.cdata.library.path' is defined, try to load the native
library from there
+ String libraryPath = System.getProperty("arrow.cdata.library.path");
+ if (libraryPath != null) {
+ try {
+ File libraryFile = new File(libraryPath, libraryName);
+ if (libraryFile.isFile()) {
+ System.load(libraryFile.getAbsolutePath());
+ return;
+ }
+ } catch (UnsatisfiedLinkError e) {
+ // Ignore this error and fall back to extracting from the JAR file
Review Comment:
Actually, would it be better to error if the property is provided but the
file doesn't exist? That way you don't unexpectedly/silently fall back when you
intended to load from somewhere else.
--
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]