org.apache.hadoop.examples
Class SecondarySort.FirstGroupingComparator

java.lang.Object
  extended by org.apache.hadoop.examples.SecondarySort.FirstGroupingComparator
All Implemented Interfaces:
Comparator<SecondarySort.IntPair>, RawComparator<SecondarySort.IntPair>
Enclosing class:
SecondarySort

public static class SecondarySort.FirstGroupingComparator
extends Object
implements RawComparator<SecondarySort.IntPair>

Compare only the first part of the pair, so that reduce is called once for each value of the first part.


Constructor Summary
SecondarySort.FirstGroupingComparator()
           
 
Method Summary
 int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2)
           
 int compare(SecondarySort.IntPair o1, SecondarySort.IntPair o2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

SecondarySort.FirstGroupingComparator

public SecondarySort.FirstGroupingComparator()
Method Detail

compare

public int compare(byte[] b1,
                   int s1,
                   int l1,
                   byte[] b2,
                   int s2,
                   int l2)
Specified by:
compare in interface RawComparator<SecondarySort.IntPair>

compare

public int compare(SecondarySort.IntPair o1,
                   SecondarySort.IntPair o2)
Specified by:
compare in interface Comparator<SecondarySort.IntPair>


Copyright © 2009 The Apache Software Foundation