Author: cdouglas
Date: Sat Mar 20 01:42:53 2010
New Revision: 925523
URL: http://svn.apache.org/viewvc?rev=925523&view=rev
Log:
MAPREDUCE-1407. Update javadoc in mapreduce.{Mapper,Reducer} to match
actual usage. Contributed by Benoit Sigoure
Modified:
hadoop/common/branches/branch-0.20/CHANGES.txt
hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapreduce/Mapper.java
hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapreduce/Reducer.java
Modified: hadoop/common/branches/branch-0.20/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/CHANGES.txt?rev=925523&r1=925522&r2=925523&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20/CHANGES.txt Sat Mar 20 01:42:53 2010
@@ -8,6 +8,9 @@ Release 0.20.3 - Unreleased
HADOOP-6382. Add support for publishing Hadoop jars to Apache Maven
repository. (Giridharan Kesavan via cdouglas)
+ MAPREDUCE-1407. Update javadoc in mapreduce.{Mapper,Reducer} to match
+ actual usage. (Benoit Sigoure via cdouglas)
+
Release 0.20.2 - 2010-2-19
NEW FEATURES
Modified:
hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapreduce/Mapper.java
URL:
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapreduce/Mapper.java?rev=925523&r1=925522&r2=925523&view=diff
==============================================================================
---
hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapreduce/Mapper.java
(original)
+++
hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapreduce/Mapper.java
Sat Mar 20 01:42:53 2010
@@ -68,16 +68,16 @@ import org.apache.hadoop.io.compress.Com
* <p>Example:</p>
* <p><blockquote><pre>
* public class TokenCounterMapper
- * extends Mapper<Object, Text, Text, IntWritable>{
+ * extends Mapper<Object, Text, Text, IntWritable>{
*
* 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);
* }
* }
* }
@@ -145,4 +145,4 @@ public class Mapper<KEYIN, VALUEIN, KEYO
}
cleanup(context);
}
-}
\ No newline at end of file
+}
Modified:
hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapreduce/Reducer.java
URL:
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapreduce/Reducer.java?rev=925523&r1=925522&r2=925523&view=diff
==============================================================================
---
hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapreduce/Reducer.java
(original)
+++
hadoop/common/branches/branch-0.20/src/mapred/org/apache/hadoop/mapreduce/Reducer.java
Sat Mar 20 01:42:53 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><key, (collection of values)></code> in
+ * method is called for each <code><key, (collection of
values)></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<Key> extends Reducer<Key,IntWritable,
+ * Key,IntWritable> {
* private IntWritable result = new IntWritable();
*
- * public void reduce(Key key, Iterable<IntWritable> values,
- * Context context) throws IOException {
+ * public void reduce(Key key, Iterable<IntWritable> 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>