com.datasalt.pangool.tuplemr.mapred
Class SerializerComparator

java.lang.Object
  extended by com.datasalt.pangool.tuplemr.mapred.SerializerComparator
All Implemented Interfaces:
Serializable, Comparator<Object>, org.apache.hadoop.conf.Configurable

public class SerializerComparator
extends Object
implements Comparator<Object>, Serializable, org.apache.hadoop.conf.Configurable

A simple RawComparator and Serializable that compares in binary. It also implements Comparatorcompare(Object, Object) by serializing the objects using HadoopSerialization, and then comparing the bytes. That is useful for testing purposes.
This class needs to receive a configuration via setConf(Configuration) before being ready to use the compare(Object, Object) method.

See Also:
Serialized Form

Field Summary
protected  org.apache.hadoop.conf.Configuration conf
           
protected  HadoopSerialization hadoopSer
           
 
Constructor Summary
SerializerComparator()
           
 
Method Summary
 int compare(Object o1, Object o2)
           
 int compare(Object o1, org.apache.hadoop.io.serializer.Serializer ser1, Object o2, org.apache.hadoop.io.serializer.Serializer ser2)
           
 org.apache.hadoop.conf.Configuration getConf()
           
 void setConf(org.apache.hadoop.conf.Configuration conf)
           
 
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

conf

protected transient org.apache.hadoop.conf.Configuration conf

hadoopSer

protected transient HadoopSerialization hadoopSer
Constructor Detail

SerializerComparator

public SerializerComparator()
Method Detail

compare

public int compare(Object o1,
                   org.apache.hadoop.io.serializer.Serializer ser1,
                   Object o2,
                   org.apache.hadoop.io.serializer.Serializer ser2)

compare

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

setConf

public void setConf(org.apache.hadoop.conf.Configuration conf)
Specified by:
setConf in interface org.apache.hadoop.conf.Configurable

getConf

public org.apache.hadoop.conf.Configuration getConf()
Specified by:
getConf in interface org.apache.hadoop.conf.Configurable


Copyright © –2014 Datasalt Systems S.L.. All rights reserved.