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-5 [2012/01/29 23:42] majlis |
courses:mapreduce-tutorial:step-5 [2012/01/31 15:56] (current) straka |
||
---|---|---|---|
Line 6: | Line 6: | ||
<file perl> | <file perl> | ||
- | package Mapper; | + | package |
use Moose; | use Moose; | ||
with ' | with ' | ||
Line 16: | Line 16: | ||
} | } | ||
- | package Reducer; | + | package |
use Moose; | use Moose; | ||
with ' | with ' | ||
Line 28: | Line 28: | ||
} | } | ||
- | package | + | package |
use Hadoop:: | use Hadoop:: | ||
my $runner = Hadoop:: | my $runner = Hadoop:: | ||
- | mapper => Mapper-> | + | mapper => My::Mapper-> |
- | reducer => Reducer-> | + | reducer => My::Reducer-> |
$runner-> | $runner-> | ||
Line 42: | Line 42: | ||
===== Types of keys and values ===== | ===== Types of keys and values ===== | ||
- | Currently in the Perl API, the keys and values are both strings, which are stored and loaded using UTF-8 format. If you need more complex structures, you have to serialize and deserialize them by yourselves. | + | Currently in the Perl API, the keys and values are both strings, which are stored and loaded using UTF-8 format |
The Java API offers a wide range of types, including user-defined types, to be used for keys and values. | The Java API offers a wide range of types, including user-defined types, to be used for keys and values. | ||
Line 52: | Line 52: | ||
# NOW EDIT THE FILE | # NOW EDIT THE FILE | ||
# $EDITOR step-5-exercise1.pl | # $EDITOR step-5-exercise1.pl | ||
- | rm -rf step-5-out-ex1; | + | rm -rf step-5-out-ex1; |
less step-5-out-ex1/ | less step-5-out-ex1/ | ||
Line 58: | Line 58: | ||
You can also download the solution {{: | You can also download the solution {{: | ||
wget --no-check-certificate ' | wget --no-check-certificate ' | ||
- | rm -rf step-5-out-sol1; | + | |
+ | # $EDITOR step-5-solution1.pl | ||
+ | | ||
less step-5-out-sol1/ | less step-5-out-sol1/ | ||
Line 68: | Line 70: | ||
# NOW EDIT THE FILE | # NOW EDIT THE FILE | ||
# $EDITOR step-5-exercise2.pl | # $EDITOR step-5-exercise2.pl | ||
- | rm -rf step-5-out-ex2; | + | rm -rf step-5-out-ex2; |
less step-5-out-ex2/ | less step-5-out-ex2/ | ||
Line 74: | Line 76: | ||
You can also download the solution {{: | You can also download the solution {{: | ||
wget --no-check-certificate ' | wget --no-check-certificate ' | ||
- | rm -rf step-5-out-sol2; | + | |
+ | # $EDITOR step-5-solution2.pl | ||
+ | | ||
less step-5-out-sol2/ | less step-5-out-sol2/ | ||