You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-commits@hadoop.apache.org by cd...@apache.org on 2010/03/20 02:42:13 UTC

svn commit: r925520 - in /hadoop/mapreduce/branches/branch-0.21: CHANGES.txt src/java/org/apache/hadoop/mapreduce/Mapper.java src/java/org/apache/hadoop/mapreduce/Reducer.java

Author: cdouglas
Date: Sat Mar 20 01:42:12 2010
New Revision: 925520

URL: http://svn.apache.org/viewvc?rev=925520&view=rev
Log:
MAPREDUCE-1407. Update javadoc in mapreduce.{Mapper,Reducer} to match
actual usage. Contributed by Benoit Sigoure

Modified:
    hadoop/mapreduce/branches/branch-0.21/CHANGES.txt
    hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/Mapper.java
    hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/Reducer.java

Modified: hadoop/mapreduce/branches/branch-0.21/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/CHANGES.txt?rev=925520&r1=925519&r2=925520&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/CHANGES.txt (original)
+++ hadoop/mapreduce/branches/branch-0.21/CHANGES.txt Sat Mar 20 01:42:12 2010
@@ -948,3 +948,6 @@ Release 0.21.0 - Unreleased
 
     MAPREDUCE-1522. FileInputFormat may use the default FileSystem for the
     input path. (Tsz Wo (Nicholas), SZE via cdouglas)
+
+    MAPREDUCE-1407. Update javadoc in mapreduce.{Mapper,Reducer} to match
+    actual usage. (Benoit Sigoure via cdouglas)

Modified: hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/Mapper.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/Mapper.java?rev=925520&r1=925519&r2=925520&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/Mapper.java (original)
+++ hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/Mapper.java Sat Mar 20 01:42:12 2010
@@ -69,16 +69,16 @@ import org.apache.hadoop.mapreduce.task.
  * <p>Example:</p>
  * <p><blockquote><pre>
  * public class TokenCounterMapper 
- *     extends Mapper<Object, Text, Text, IntWritable>{
+ *     extends Mapper&lt;Object, Text, Text, IntWritable&gt;{
  *    
  *   private final static IntWritable one = new IntWritable(1);
  *   private Text word = new Text();
  *   
- *   public void map(Object key, Text value, Context context) throws IOException {
+ *   public void map(Object key, Text value, Context context) throws IOException, InterruptedException {
  *     StringTokenizer itr = new StringTokenizer(value.toString());
  *     while (itr.hasMoreTokens()) {
  *       word.set(itr.nextToken());
- *       context.collect(word, one);
+ *       context.write(word, one);
  *     }
  *   }
  * }
@@ -141,4 +141,4 @@ public class Mapper<KEYIN, VALUEIN, KEYO
     }
     cleanup(context);
   }
-}
\ No newline at end of file
+}

Modified: hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/Reducer.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/Reducer.java?rev=925520&r1=925519&r2=925520&view=diff
==============================================================================
--- hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/Reducer.java (original)
+++ hadoop/mapreduce/branches/branch-0.21/src/java/org/apache/hadoop/mapreduce/Reducer.java Sat Mar 20 01:42:12 2010
@@ -84,7 +84,7 @@ import org.apache.hadoop.mapred.RawKeyVa
  *   
  *   <p>In this phase the 
  *   {@link #reduce(Object, Iterable, Context)}
- *   method is called for each <code>&lt;key, (collection of values)></code> in
+ *   method is called for each <code>&lt;key, (collection of values)&gt;</code> in
  *   the sorted inputs.</p>
  *   <p>The output of the reduce task is typically written to a 
  *   {@link RecordWriter} via 
@@ -96,18 +96,18 @@ import org.apache.hadoop.mapred.RawKeyVa
  * 
  * <p>Example:</p>
  * <p><blockquote><pre>
- * public class IntSumReducer<Key> extends Reducer<Key,IntWritable,
- *                                                 Key,IntWritable> {
+ * public class IntSumReducer&lt;Key&gt; extends Reducer&lt;Key,IntWritable,
+ *                                                 Key,IntWritable&gt; {
  *   private IntWritable result = new IntWritable();
  * 
- *   public void reduce(Key key, Iterable<IntWritable> values, 
- *                      Context context) throws IOException {
+ *   public void reduce(Key key, Iterable&lt;IntWritable&gt; values,
+ *                      Context context) throws IOException, InterruptedException {
  *     int sum = 0;
  *     for (IntWritable val : values) {
  *       sum += val.get();
  *     }
  *     result.set(sum);
- *     context.collect(key, result);
+ *     context.write(key, result);
  *   }
  * }
  * </pre></blockquote></p>