[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
courses:mapreduce-tutorial:step-4 [2012/01/24 21:10]
straka
courses:mapreduce-tutorial:step-4 [2012/01/24 21:29]
straka
Line 1: Line 1:
 ====== MapReduce Tutorial : Counters ====== ====== MapReduce Tutorial : Counters ======
  
-Sometimes it is useful to +Sometimes it is useful to count events differently than outputting them (key, value) pairs. For that reason Hadoop offers simple counter framework. 
 + 
 +<code perl> 
 +sub map { 
 +  my ($self, $key, $value, $context) = @_; 
 +  
 +  $context->counter($group, $name, $increment); 
 +
 +</code> 
 + 
 +===== Exercise ===== 
 + 
 +Run a MR job on /home/straka/wiki/cs-text, which uses counters to count the number of articles according to their first letter (ignoring the case and possible diacritics). 
 + 
 +{{.:step-4-solution.txt|Solution.pl}}
  
-{{.:step-3:exercise.txt|Reseni.pl}} 
-{{filelist>:snippets:dokuwiki:plugin-*.tar.gz&style=table&tableheader=1&tableshowdate=1&tableshowsize=1}} 

[ Back to the navigation ] [ Back to the content ]