hadoop-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen O'Malley <omal...@apache.org>
Subject Re: How to write a complex Writable
Date Sat, 22 May 2010 22:12:31 GMT

On May 22, 2010, at 2:09 PM, Oded Rosen wrote:

> *. Override Object's "*equals*": compare all available fields (deep
> compare), check unique fields first, to avoid checking the rest.

You should implement equals, but more important for keys is to define  
a RawComparator for your type. If you don't define one, the framework  
will de-serialize your type a *lot*. Look at one of the writables like  
IntWritable or Text for how to register your comparator.

-- Owen

Mime
View raw message