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-25 [2012/01/28 00:12] straka |
courses:mapreduce-tutorial:step-25 [2012/01/31 15:12] (current) majlis Fixed code for sorting execution. |
||
---|---|---|---|
Line 75: | Line 75: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | wget --no-check-certificate ' | ||
+ | make -f / | ||
+ | rm -rf step-25-out-ex1; | ||
+ | less step-25-out-ex1/ | ||
+ | |||
==== Remarks ==== | ==== Remarks ==== | ||
Line 95: | Line 101: | ||
* '' | * '' | ||
The solution is a bit clumsy. If the mapper could output (key, value, partition) instead of just (key, value), we would not have to use the '' | The solution is a bit clumsy. If the mapper could output (key, value, partition) instead of just (key, value), we would not have to use the '' | ||
+ | |||
+ | **Remark:** If the type of keys or values which the mapper outputs //is different// than the type of keys and values the reducer outputs, then [[http:// | ||
<file java ArticlesAndWords.java> | <file java ArticlesAndWords.java> | ||
Line 159: | Line 167: | ||
job.setOutputKeyClass(Text.class); | job.setOutputKeyClass(Text.class); | ||
job.setOutputValueClass(NullWritable.class); | job.setOutputValueClass(NullWritable.class); | ||
+ | job.setMapOutputValueClass(IntWritable.class); | ||
job.setInputFormatClass(KeyValueTextInputFormat.class); | job.setInputFormatClass(KeyValueTextInputFormat.class); | ||
Line 175: | Line 184: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | wget --no-check-certificate ' | ||
+ | make -f / | ||
+ | rm -rf step-25-out-ex2; | ||
+ | less step-25-out-ex2/ | ||
+ | |||
+ | ===== Exercise ===== | ||
+ | |||
+ | Implement the [[.: | ||
+ | |||
+ | **Remark:** Values of type '' | ||
+ | |||
+ | You can download the {{: | ||
+ | |||
+ | wget --no-check-certificate ' | ||
+ | # NOW VIEW THE FILE | ||
+ | # $EDITOR SortingUniform.java | ||
+ | make -f / | ||
+ | rm -rf step-25-out-uniform; | ||
+ | less step-25-out-uniform/ | ||
+ | |||
+ | wget --no-check-certificate ' | ||
+ | # NOW VIEW THE FILE | ||
+ | # $EDITOR SortingUniform.java | ||
+ | make -f / | ||
+ | rm -rf step-25-out-nonuniform; | ||
+ | less step-25-out-nonuniform/ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | < | ||
+ | <table style=" | ||
+ | <tr> | ||
+ | <td style=" | ||
+ | <td style=" | ||
+ | <td style=" | ||
+ | </tr> | ||
+ | </ | ||
+ | </ | ||