This is an old revision of the document!
MapReduce Tutorial : Basic reducer
- 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();