hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r925518 - in /hadoop/mapreduce/trunk: CHANGES.txt src/java/org/apache/hadoop/mapreduce/Mapper.java src/java/org/apache/hadoop/mapreduce/Reducer.java
Date Sat, 20 Mar 2010 01:42:04 GMT
Author: cdouglas
Date: Sat Mar 20 01:42:04 2010
New Revision: 925518

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

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Mapper.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Reducer.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=925518&r1=925517&r2=925518&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Sat Mar 20 01:42:04 2010
@@ -1397,3 +1397,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/trunk/src/java/org/apache/hadoop/mapreduce/Mapper.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Mapper.java?rev=925518&r1=925517&r2=925518&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Mapper.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Mapper.java Sat Mar 20 01:42:04
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/trunk/src/java/org/apache/hadoop/mapreduce/Reducer.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Reducer.java?rev=925518&r1=925517&r2=925518&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Reducer.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/Reducer.java Sat Mar 20 01:42:04
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>



Mime
View raw message