[ 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

Next revision Both sides next revision
courses:mapreduce-tutorial:step-5 [2012/01/24 19:04]
straka vytvořeno
courses:mapreduce-tutorial:step-5 [2012/01/24 22:08]
straka
Line 1: Line 1:
-====== MapReduce Tutorial : ======+====== MapReduce Tutorial : Basic reducer ====== 
 + 
 +<file perl reducer.pl> 
 +#!/usr/bin/perl 
 +  
 +package Mapper; 
 +use Moose; 
 +with 'Hadoop::Mapper'; 
 +  
 +sub map { 
 +  my ($self, $key, $value, $context) = @_; 
 +  
 +  $context->write($key, $value); 
 +
 +  
 +package Main; 
 +use Hadoop::Runner; 
 +  
 +my $runner = Hadoop::Runner->new( 
 +  mapper => Mapper->new(), 
 +  input_format => 'TextInputFormat', 
 +  output_format => 'TextOutputFormat', 
 +  output_compression => 0); 
 +  
 +$runner->run(); 
 +</file> 

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