[ https://issues.apache.org/jira/browse/HBASE-17877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15967397#comment-15967397 ]
Vikas Vishwakarma edited comment on HBASE-17877 at 4/13/17 12:03 PM: --------------------------------------------------------------------- [~anoop.hbase] will take a look into BBUtils also. [~larsh] one quick doubt. The HBase byte array comparator gives only 3 possible output for any byte array input -1, 0, +1 With Guava and Hadoop comparator the output can be any -integer, 0 , +integer for example , for this input Arrays.fill( ba1_8, (byte) 43 ); Arrays.fill( ba2_8, (byte) 43 ); ba1_8[0] = (byte) 32; ba2_8[0] = (byte) 43; HBase comparator will give output as -1 while Guava & Hadoop comparator will give output as -11 Mostly functions should check comparator output as > < or == , this should be a fair assumption or do we need to map the guava comparator output in the -1, 0, 1 range? was (Author: vik.karma): [~anoop.hbase] will take a look into BBUtils also. [~larsh] one quick doubt. The HBase byte array comparator gives only 3 possible output for any byte array input -1, 0, +1 With Guava and Hadoop comparator the output can be any -integer, 0 , +integer for example , for this input Arrays.fill( ba1_8, (byte) 43 ); Arrays.fill( ba2_8, (byte) 43 ); ba1_8[0] = (byte) 32; ba2_8[0] = (byte) 43; HBase comparator will give output as -1 while Guava & Hadoop comparator will give output as -11 Mostly functions should check comparator output as > < or == , this should be a fair assumption or do we need to do a thorough verification around this? > Replace/improve HBase's byte[] comparator > ----------------------------------------- > > Key: HBASE-17877 > URL: https://issues.apache.org/jira/browse/HBASE-17877 > Project: HBase > Issue Type: Bug > Reporter: Lars Hofhansl > Assignee: Vikas Vishwakarma > Attachments: 17877-1.2.patch, 17877-v2-1.3.patch, > ByteComparatorJiraHBASE-17877.pdf > > > [~vik.karma] did some extensive tests and found that Hadoop's version is > faster - dramatically faster in some cases. > Patch forthcoming. -- This message was sent by Atlassian JIRA (v6.3.15#6346)