Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
courses:mapreduce-tutorial:step-24 [2012/01/31 11:29] straka |
courses:mapreduce-tutorial:step-24 [2012/01/31 16:25] (current) dusek |
||
|---|---|---|---|
| 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(" |
| ... | ... | ||
| - | | + | |
| } | } | ||
| } | } | ||
| Line 126: | Line 126: | ||
| ===== Example 2 ===== | ===== Example 2 ===== | ||
| + | |||
| + | Run a Hadoop job on / | ||
| + | |||
| + | wget --no-check-certificate ' | ||
| + | # NOW VIEW THE FILE | ||
| + | # $EDITOR ThreeLetterWords.java | ||
| + | make -f / | ||
| + | rm -rf step-24-out-sol; | ||
| + | less step-24-out-sol/ | ||
| ---- | ---- | ||
