hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r678577 - in /hadoop/core/trunk: CHANGES.txt src/core/org/apache/hadoop/io/compress/lzo/LzoCompressor.java src/core/org/apache/hadoop/io/compress/lzo/LzoDecompressor.java
Date Mon, 21 Jul 2008 21:30:46 GMT
Author: acmurthy
Date: Mon Jul 21 14:30:46 2008
New Revision: 678577

URL: http://svn.apache.org/viewvc?rev=678577&view=rev
Log:
HADOOP-3771. Ensure that Lzo compressors/decompressors correctly handle the case where native
libraries aren't available. Contributed by Chris Douglas.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/core/org/apache/hadoop/io/compress/lzo/LzoCompressor.java
    hadoop/core/trunk/src/core/org/apache/hadoop/io/compress/lzo/LzoDecompressor.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=678577&r1=678576&r2=678577&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Mon Jul 21 14:30:46 2008
@@ -143,6 +143,9 @@
     HADOOP-3643. Filter out completed tasks when asking for running tasks in
     the JobTracker web/ui. (Amar Kamat via omalley)
 
+    HADOOP-3771. Ensure that Lzo compressors/decompressors correctly handle the
+    case where native libraries aren't available. (Chris Douglas via acmurthy) 
+
 Release 0.18.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/io/compress/lzo/LzoCompressor.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/io/compress/lzo/LzoCompressor.java?rev=678577&r1=678576&r2=678577&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/io/compress/lzo/LzoCompressor.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/io/compress/lzo/LzoCompressor.java Mon Jul
21 14:30:46 2008
@@ -149,15 +149,21 @@
     }
   }; // CompressionStrategy
 
-  private static final boolean nativeLzoLoaded;
+  private static boolean nativeLzoLoaded;
   public static final int LZO_LIBRARY_VERSION;
   
   static {
     if (NativeCodeLoader.isNativeCodeLoaded()) {
       // Initialize the native library
-      initIDs();
-      nativeLzoLoaded = true;
-      LZO_LIBRARY_VERSION = 0xFFFF & getLzoLibraryVersion();
+      try {
+        initIDs();
+        nativeLzoLoaded = true;
+      } catch (Throwable t) {
+        // Ignore failure to load/initialize native-lzo
+        nativeLzoLoaded = false;
+      }
+      LZO_LIBRARY_VERSION = (nativeLzoLoaded) ? 0xFFFF & getLzoLibraryVersion()
+                                              : -1;
     } else {
       LOG.error("Cannot load " + LzoCompressor.class.getName() + 
                 " without native-hadoop library!");

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/io/compress/lzo/LzoDecompressor.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/io/compress/lzo/LzoDecompressor.java?rev=678577&r1=678576&r2=678577&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/io/compress/lzo/LzoDecompressor.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/io/compress/lzo/LzoDecompressor.java Mon
Jul 21 14:30:46 2008
@@ -126,15 +126,21 @@
     }
   }; // CompressionStrategy
   
-  private static final boolean nativeLzoLoaded;
+  private static boolean nativeLzoLoaded;
   public static final int LZO_LIBRARY_VERSION;
   
   static {
     if (NativeCodeLoader.isNativeCodeLoaded()) {
       // Initialize the native library
-      initIDs();
-      nativeLzoLoaded = true;
-      LZO_LIBRARY_VERSION = 0xFFFF & getLzoLibraryVersion();
+      try {
+        initIDs();
+        nativeLzoLoaded = true;
+      } catch (Throwable t) {
+        // Ignore failure to load/initialize native-lzo
+        nativeLzoLoaded = false;
+      }
+      LZO_LIBRARY_VERSION = (nativeLzoLoaded) ? 0xFFFF & getLzoLibraryVersion()
+                                              : -1;
     } else {
       LOG.error("Cannot load " + LzoDecompressor.class.getName() + 
                 " without native-hadoop library!");



Mime
View raw message