org.apache.pig
Class ComparisonFunc

java.lang.Object
  extended by org.apache.hadoop.io.WritableComparator
      extended by org.apache.pig.ComparisonFunc
All Implemented Interfaces:
Comparator, org.apache.hadoop.io.RawComparator

Deprecated.

@InterfaceAudience.Public
@InterfaceStability.Stable
@Deprecated
public abstract class ComparisonFunc
extends org.apache.hadoop.io.WritableComparator

An interface for custom order by comparator function.


Field Summary
protected  PigProgressable reporter
          Deprecated.  
 
Constructor Summary
ComparisonFunc()
          Deprecated.  
 
Method Summary
abstract  int compare(Tuple t1, Tuple t2)
          Deprecated. This callback method must be implemented by all subclasses.
 int compare(org.apache.hadoop.io.WritableComparable a, org.apache.hadoop.io.WritableComparable b)
          Deprecated. Compare two tuples.
 void setReporter(PigProgressable reporter)
          Deprecated. Set the reporter.
 
Methods inherited from class org.apache.hadoop.io.WritableComparator
compare, compare, compareBytes, define, get, getKeyClass, hashBytes, hashBytes, newKey, readDouble, readFloat, readInt, readLong, readUnsignedShort, readVInt, readVLong
 
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
 

Field Detail

reporter

protected PigProgressable reporter
Deprecated. 
Constructor Detail

ComparisonFunc

public ComparisonFunc()
Deprecated. 
Method Detail

compare

public int compare(org.apache.hadoop.io.WritableComparable a,
                   org.apache.hadoop.io.WritableComparable b)
Deprecated. 
Compare two tuples. Note that even though both args are given type of WritableComparable to match the WritableComparable interface, they must both be tuples.

Overrides:
compare in class org.apache.hadoop.io.WritableComparator
Parameters:
a - first tuple
b - tuple to compare a to
Returns:
-1 if a < b, 1 if a > b, 0 if a = b

compare

public abstract int compare(Tuple t1,
                            Tuple t2)
Deprecated. 
This callback method must be implemented by all subclasses. Compares its two arguments for order. The order of elements of the tuples correspond to the fields specified in the order by clause. Same semantics as Comparator.

Parameters:
t1 - the first Tuple to be compared.
t2 - the second Tuple to be compared.
Returns:
Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
Throws:
IOException
See Also:
Comparator

setReporter

public void setReporter(PigProgressable reporter)
Deprecated. 
Set the reporter. If the comparison takes a long time the reporter should be called occasionally to avoid Hadoop timing out underneath. The default Hadoop timeout is 600 seconds.

Parameters:
reporter - Progress reporter


Copyright © 2007-2012 The Apache Software Foundation