hadoop/hadoop-jni-library-loading.patch

33 lines
1.4 KiB
Diff
Raw Normal View History

2013-08-20 20:06:04 +00:00
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/NativeCodeLoader.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/NativeCodeLoader.java
index 4fe81da..f2503e4 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/NativeCodeLoader.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/NativeCodeLoader.java
@@ -46,15 +46,20 @@
LOG.debug("Trying to load the custom-built native-hadoop library...");
}
try {
- System.loadLibrary("hadoop");
+ System.load("/usr/lib64/hadoop/libhadoop.so");
LOG.debug("Loaded the native-hadoop library");
nativeCodeLoaded = true;
- } catch (Throwable t) {
- // Ignore failure to load
- if(LOG.isDebugEnabled()) {
- LOG.debug("Failed to load native-hadoop with error: " + t);
- LOG.debug("java.library.path=" +
- System.getProperty("java.library.path"));
+ } catch (Throwable t64) {
+ LOG.debug("Failed to load 64-bit native-hadoop with error: " + t64);
+ try {
+ System.load("/usr/lib/hadoop/libhadoop.so");
+ LOG.debug("Loaded the native-hadoop library");
+ nativeCodeLoaded = true;
+ } catch (Throwable t32) {
+ // Ignore failure to load
+ if(LOG.isDebugEnabled()) {
+ LOG.debug("Failed to load 32-bit native-hadoop with error: " + t32);
+ }
}
}