hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: KeyValue equals and compareTo methods
Date Mon, 01 Oct 2012 01:09:55 GMT
w.r.t. the sidenote, we can log a subtask for HBASE-6182 that makes the
return value from comparator consistent with return value from equals()
method.

Thanks

On Sun, Sep 30, 2012 at 5:47 PM, Matt Corgan <mcorgan@hotpads.com> wrote:

> 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
> Comparator<
> http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html>
> interface
> 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
> algorithm.
>
> Matt
>

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