hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r620679 - in /hadoop/core/trunk: CHANGES.txt src/test/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java
Date Tue, 12 Feb 2008 00:34:25 GMT
Author: cdouglas
Date: Mon Feb 11 16:34:24 2008
New Revision: 620679

URL: http://svn.apache.org/viewvc?rev=620679&view=rev
Log:
HADOOP-2733. Fix compiler warnings in test code.
Contributed by Tsz Wo (Nicholas), SZE


Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java
    hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=620679&r1=620678&r2=620679&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Mon Feb 11 16:34:24 2008
@@ -57,6 +57,9 @@
     HADOOP-2754. Filter out .crc files from local file system listing.
     (Hairong Kuang via shv)
 
+    HADOOP-2733. Fix compiler warnings in test code.
+    (Tsz Wo (Nicholas), SZE via cdouglas)
+
 Release 0.16.0 - 2008-02-07
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java?rev=620679&r1=620678&r2=620679&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java
(original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestClusterMapReduceTestCase.java
Mon Feb 11 16:34:24 2008
@@ -17,51 +17,14 @@
  */
 package org.apache.hadoop.mapred;
 
-import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.Text;
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableComparable;
 
 import java.io.*;
-import java.util.Iterator;
 import java.util.Properties;
 
 public class TestClusterMapReduceTestCase extends ClusterMapReduceTestCase {
-
-  public static class EchoMap implements Mapper {
-
-    public void configure(JobConf conf) {
-    }
-
-    public void close() {
-    }
-
-    public void map(WritableComparable key, Writable value,
-                    OutputCollector collector, Reporter reporter) throws IOException {
-      collector.collect(key, value);
-    }
-  }
-
-  public static class EchoReduce implements Reducer {
-
-    public void configure(JobConf conf) {
-    }
-
-    public void close() {
-    }
-
-    public void reduce(WritableComparable key, Iterator values,
-                       OutputCollector collector, Reporter reporter) throws IOException {
-      while (values.hasNext()) {
-        Writable value = (Writable) values.next();
-        collector.collect(key, value);
-      }
-    }
-
-  }
-
   public void _testMapReduce(boolean restart) throws Exception {
     OutputStream os = getFileSystem().create(new Path(getInputDir(), "text.txt"));
     Writer wr = new OutputStreamWriter(os);
@@ -88,8 +51,8 @@
     conf.setOutputKeyClass(LongWritable.class);
     conf.setOutputValueClass(Text.class);
 
-    conf.setMapperClass(TestClusterMapReduceTestCase.EchoMap.class);
-    conf.setReducerClass(TestClusterMapReduceTestCase.EchoReduce.class);
+    conf.setMapperClass(org.apache.hadoop.mapred.lib.IdentityMapper.class);
+    conf.setReducerClass(org.apache.hadoop.mapred.lib.IdentityReducer.class);
 
     conf.setInputPath(getInputDir());
 

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java?rev=620679&r1=620678&r2=620679&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/mapred/TestJobStatusPersistency.java Mon
Feb 11 16:34:24 2008
@@ -17,51 +17,14 @@
  */
 package org.apache.hadoop.mapred;
 
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.fs.Path;
 
 import java.io.*;
-import java.util.Iterator;
 import java.util.Properties;
 
 public class TestJobStatusPersistency extends ClusterMapReduceTestCase {
-
-  public static class EchoMap implements Mapper {
-
-    public void configure(JobConf conf) {
-    }
-
-    public void close() {
-    }
-
-    public void map(WritableComparable key, Writable value,
-                    OutputCollector collector, Reporter reporter) throws IOException {
-      collector.collect(key, value);
-    }
-  }
-
-  public static class EchoReduce implements Reducer {
-
-    public void configure(JobConf conf) {
-    }
-
-    public void close() {
-    }
-
-    public void reduce(WritableComparable key, Iterator values,
-                       OutputCollector collector, Reporter reporter) throws IOException {
-      while (values.hasNext()) {
-        Writable value = (Writable) values.next();
-        collector.collect(key, value);
-      }
-    }
-
-  }
-
   private String runJob() throws Exception {
     OutputStream os = getFileSystem().create(new Path(getInputDir(), "text.txt"));
     Writer wr = new OutputStreamWriter(os);
@@ -83,8 +46,8 @@
     conf.setOutputKeyClass(LongWritable.class);
     conf.setOutputValueClass(Text.class);
 
-    conf.setMapperClass(TestJobStatusPersistency.EchoMap.class);
-    conf.setReducerClass(TestJobStatusPersistency.EchoReduce.class);
+    conf.setMapperClass(org.apache.hadoop.mapred.lib.IdentityMapper.class);
+    conf.setReducerClass(org.apache.hadoop.mapred.lib.IdentityReducer.class);
 
     conf.setInputPath(getInputDir());
 



Mime
View raw message