hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: Redundant (?) lengths in SequenceFile
Date Mon, 19 Jun 2006 17:56:16 GMT
Paul Sutter wrote:
> How can I define a comparator that can compare raw binary data? (our keys
> are raw binary data)

Implement the following method:

http://lucene.apache.org/hadoop/docs/api/org/apache/hadoop/io/WritableComparator.html#compare(byte[],%20int,%20int,%20byte[],%20int,%20int)

To make a comparator the default for a class, call:

http://lucene.apache.org/hadoop/docs/api/org/apache/hadoop/io/WritableComparator.html#define(java.lang.Class,%20org.apache.hadoop.io.WritableComparator)

This is already done for most WritableComparable implementations.  The 
the bottom of, e.g., IntWritable.java for an example of the idiom.

http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/io/IntWritable.java?view=markup

Doug

Mime
View raw message