hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Corgan <mcor...@hotpads.com>
Subject KeyValue equals and compareTo methods
Date Mon, 01 Oct 2012 00:47:34 GMT
Hi everyone,

Working on PrefixTree testing I noticed that KeyValue.KVComparator includes
the memstoreTS when comparing, however the KeyValue.equals() method ignores
the memstoreTS.  I'm wondering how intentional that is?  If unintentional,
I'm thinking that the equals method should probably include the memstoreTS.
 At a minimum, TestColumnSeeking relies on the current behavior, but I
think it could be changed.

On the other hand, KVComparator isn't technically the default comparator so
I wouldn't say it's a bug.

Java 7 sidenote - We ran into this problem internally at HotPads when
moving to Java 7.  The
has always specified that comparator return 0 when equals would return true
and vice versa.  Obeying that rule has been sort of optional in the past,
but Java 7 introduces a new default collection sorting algorithm called Tim
Sort <http://bugs.sun.com/view_bug.do?bug_id=6804124> which relies on that
behavior.  We've been using a VM argument to roll back to the old sorting


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message