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-26 [2012/01/30 15:41] majlis |
courses:mapreduce-tutorial:step-26 [2012/01/31 14:41] (current) straka |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== MapReduce Tutorial : Counters, compression | + | ====== MapReduce Tutorial : Compression |
| - | ===== Counters ===== | ||
| - | As in the Perl API, a mapper or a reducer can increment various counters by using '' | ||
| - | <code java> | ||
| - | public void map(Text key, Text value, Context context) throws IOException, | ||
| - | ... | ||
| - | context.getCounter(" | ||
| - | ... | ||
| - | } | ||
| - | </ | ||
| - | The '' | ||
| - | <code java> | ||
| - | public void reduce(Text key, Iterable< | ||
| - | ... | ||
| - | Counter values = context.getCounter(" | ||
| - | for (IntWritable value : values) { | ||
| - | ... | ||
| - | values.increment(1); | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| ===== Compression ===== | ===== Compression ===== | ||
| Line 64: | Line 44: | ||
| <td style=" | <td style=" | ||
| <td style=" | <td style=" | ||
| - | <td style=" | + | <td style=" |
| </tr> | </tr> | ||
| </ | </ | ||
| </ | </ | ||
