hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1362729 - in /hadoop/common/trunk/hadoop-common-project/hadoop-common: CHANGES.txt src/test/java/org/apache/hadoop/io/file/tfile/TestTFileByteArrays.java
Date Wed, 18 Jul 2012 00:51:32 GMT
Author: todd
Date: Wed Jul 18 00:51:32 2012
New Revision: 1362729

URL: http://svn.apache.org/viewvc?rev=1362729&view=rev
Log:
HADOOP-8537. Fix TFile tests to pass even when native zlib support is not compiled. Contributed
by Todd Lipcon.

Modified:
    hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
    hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileByteArrays.java

Modified: hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1362729&r1=1362728&r2=1362729&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt Wed Jul 18 00:51:32
2012
@@ -355,6 +355,9 @@ Branch-2 ( Unreleased changes )
     HADOOP-8552. Conflict: Same security.log.file for multiple users. 
     (kkambatl via tucu)
 
+    HADOOP-8537. Fix TFile tests to pass even when native zlib support is not
+    compiled. (todd)
+
   BREAKDOWN OF HDFS-3042 SUBTASKS
 
     HADOOP-8220. ZKFailoverController doesn't handle failure to become active

Modified: hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileByteArrays.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileByteArrays.java?rev=1362729&r1=1362728&r2=1362729&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileByteArrays.java
(original)
+++ hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/file/tfile/TestTFileByteArrays.java
Wed Jul 18 00:51:32 2012
@@ -30,6 +30,7 @@ import org.apache.hadoop.fs.FSDataOutput
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.WritableUtils;
+import org.apache.hadoop.io.compress.zlib.ZlibFactory;
 import org.apache.hadoop.io.file.tfile.TFile.Reader;
 import org.apache.hadoop.io.file.tfile.TFile.Writer;
 import org.apache.hadoop.io.file.tfile.TFile.Reader.Location;
@@ -57,7 +58,7 @@ public class TestTFileByteArrays {
   private static final String VALUE = "value";
 
   private FileSystem fs;
-  private Configuration conf;
+  private Configuration conf = new Configuration();
   private Path path;
   private FSDataOutputStream out;
   private Writer writer;
@@ -71,8 +72,9 @@ public class TestTFileByteArrays {
    * generated key and value strings. This is slightly different based on
    * whether or not the native libs are present.
    */
-  private int records1stBlock = NativeCodeLoader.isNativeCodeLoaded() ? 5674 : 4480;
-  private int records2ndBlock = NativeCodeLoader.isNativeCodeLoaded() ? 5574 : 4263;
+  private boolean usingNative = ZlibFactory.isNativeZlibLoaded(conf);
+  private int records1stBlock = usingNative ? 5674 : 4480;
+  private int records2ndBlock = usingNative ? 5574 : 4263;
 
   public void init(String compression, String comparator, String outputFile,
       int numRecords1stBlock, int numRecords2ndBlock) {
@@ -89,7 +91,6 @@ public class TestTFileByteArrays {
 
   @Before
   public void setUp() throws IOException {
-    conf = new Configuration();
     path = new Path(ROOT, outputFile);
     fs = path.getFileSystem(conf);
     out = fs.create(path);



Mime
View raw message