Complete the code to start the shuffle and sort phase in a MapReduce job.
job.setPartitionerClass([1]);The HashPartitioner is used by default to partition keys during shuffle and sort.
Complete the code to set the sort comparator class for the shuffle and sort phase.
job.setSortComparatorClass([1]);The WritableComparator is commonly used to define custom sorting during shuffle and sort.
Fix the error in the code that merges sorted map outputs during shuffle.
MergeManager mergeManager = new MergeManager([1], mapOutputs);The conf variable holds the Hadoop configuration needed by MergeManager.
Fill both blanks to create a map output key-value pair and add it to the context during shuffle.
context.write(new [1](key), new [2](value));
Keys are often Text and values IntWritable in MapReduce shuffle phase.
Fill all three blanks to define a custom comparator for sorting keys in shuffle and sort phase.
public class CustomKeyComparator extends WritableComparator { protected CustomKeyComparator() { super([1].class, true); } @Override public int compare(WritableComparable w1, WritableComparable w2) { [2] key1 = ([3]) w1; [2] key2 = ([3]) w2; return key1.compareTo(key2); } }
The comparator extends WritableComparator for Text keys and casts accordingly.