Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
courses:mapreduce-tutorial:step-24 [2012/01/31 11:29] straka |
courses:mapreduce-tutorial:step-24 [2012/01/31 11:39] straka |
||
---|---|---|---|
Line 105: | Line 105: | ||
===== Counters ===== | ===== Counters ===== | ||
- | As in the Perl API, a mapper or a reducer can increment various counters by using '' | + | As in the Perl API, a mapper |
<code java> | <code java> | ||
public void map(Text key, Text value, Context context) throws IOException, | public void map(Text key, Text value, Context context) throws IOException, | ||
Line 115: | Line 115: | ||
The '' | The '' | ||
<code java> | <code java> | ||
- | public void reduce(Text key, Iterable< | + | public void map(Text key, Text value, Context context) throws IOException, |
... | ... | ||
- | Counter | + | Counter |
- | for (IntWritable value : values) { | + | for (String word : value.toString().split(" |
... | ... | ||
- | | + | |
} | } | ||
} | } |