You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ac...@apache.org on 2008/06/05 06:06:14 UTC

svn commit: r663440 [3/3] - in /hadoop/core/trunk: ./ conf/ src/java/org/apache/hadoop/io/ src/java/org/apache/hadoop/io/compress/ src/java/org/apache/hadoop/io/compress/zlib/ src/java/org/apache/hadoop/mapred/ src/java/org/apache/hadoop/util/ src/test...

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMapRed.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMapRed.java?rev=663440&r1=663439&r2=663440&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMapRed.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestMapRed.java Wed Jun  4 21:06:13 2008
@@ -329,9 +329,8 @@
     // partition too low
     conf.setBoolean("test.testmapred.badpartition", true);
     boolean pass = true;
-    RunningJob rj = null;
     try {
-      rj = JobClient.runJob(conf);
+      JobClient.runJob(conf);
     } catch (IOException e) {
       pass = false;
     }
@@ -341,14 +340,14 @@
     conf.setBoolean("test.testmapred.badpartition", false);
     pass = true;
     try {
-      rj = JobClient.runJob(conf);
+      JobClient.runJob(conf);
     } catch (IOException e) {
       pass = false;
     }
     assertFalse("should fail for partition >= numPartitions", pass);
   }
     
-  private void checkCompression(CompressionType mapCompression,
+  private void checkCompression(boolean compressMapOutputs,
                                 CompressionType redCompression,
                                 boolean includeCombine
                                 ) throws Exception {
@@ -368,8 +367,7 @@
     if (includeCombine) {
       conf.setCombinerClass(IdentityReducer.class);
     }
-    conf.setMapOutputCompressionType(mapCompression);
-    conf.setCompressMapOutput(mapCompression != CompressionType.NONE);
+    conf.setCompressMapOutput(compressMapOutputs);
     SequenceFileOutputFormat.setOutputCompressionType(conf, redCompression);
     try {
       if (!fs.mkdirs(testdir)) {
@@ -404,12 +402,10 @@
   public void testCompression() throws Exception {
     EnumSet<SequenceFile.CompressionType> seq =
       EnumSet.allOf(SequenceFile.CompressionType.class);
-    for (CompressionType mapCompression : seq) {
-      for (CompressionType redCompression : seq) {
-        for(int combine=0; combine < 2; ++combine) {
-          checkCompression(mapCompression, redCompression,
-                           combine == 1);
-        }
+    for (CompressionType redCompression : seq) {
+      for(int combine=0; combine < 2; ++combine) {
+        checkCompression(false, redCompression, combine == 1);
+        checkCompression(true, redCompression, combine == 1);
       }
     }
   }

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestReduceTask.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestReduceTask.java?rev=663440&r1=663439&r2=663440&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestReduceTask.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestReduceTask.java Wed Jun  4 21:06:13 2008
@@ -76,17 +76,18 @@
                                Configuration conf) throws IOException {
     FileSystem fs = tmpDir.getFileSystem(conf);
     Path path = new Path(tmpDir, "data.in");
-    SequenceFile.Writer writer = new SequenceFile.Writer(fs, conf, path,
-                                                         Text.class, 
-                                                         Text.class);
+    IFile.Writer<Text, Text> writer = 
+      new IFile.Writer<Text, Text>(conf, fs, path, Text.class, Text.class, null);
     for(Pair p: vals) {
       writer.append(new Text(p.key), new Text(p.value));
     }
     writer.close();
-    SequenceFile.Sorter sorter = new SequenceFile.Sorter(fs, Text.class, 
-                                                         Text.class, conf);
-    SequenceFile.Sorter.RawKeyValueIterator rawItr = 
-      sorter.merge(new Path[]{path}, false, tmpDir);
+    
+    @SuppressWarnings("unchecked")
+    RawKeyValueIterator rawItr = 
+      Merger.merge(conf, fs, Text.class, Text.class, null, new Path[]{path}, 
+                   false, conf.getInt("io.sort.factor", 100), tmpDir, 
+                   new Text.Comparator(), new NullProgress());
     @SuppressWarnings("unchecked") // WritableComparators are not generic
     ReduceTask.ValuesIterator valItr = 
       new ReduceTask.ValuesIterator<Text,Text>(rawItr,