org.apache.hadoop.examples
Class SecondarySort

java.lang.Object
  extended by org.apache.hadoop.examples.SecondarySort

public class SecondarySort
extends Object

This is an example Hadoop Map/Reduce application. It reads the text input files that must contain two integers per a line. The output is sorted by the first and second number and grouped on the first number. To run: bin/hadoop jar build/hadoop-examples.jar secondarysort in-dir out-dir


Nested Class Summary
static class SecondarySort.FirstGroupingComparator
          Compare only the first part of the pair, so that reduce is called once for each value of the first part.
static class SecondarySort.FirstPartitioner
          Partition based on the first part of the pair.
static class SecondarySort.IntPair
          Define a pair of integers that are writable.
static class SecondarySort.MapClass
          Read two integers from each line and generate a key, value pair as ((left, right), right).
static class SecondarySort.Reduce
          A reducer class that just emits the sum of the input values.
 
Constructor Summary
SecondarySort()
           
 
Method Summary
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecondarySort

public SecondarySort()
Method Detail

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2009 The Apache Software Foundation