hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anoop Sam John (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-12345) Unsafe based Comparator for BB
Date Tue, 23 Jun 2015 08:32:00 GMT

    [ https://issues.apache.org/jira/browse/HBASE-12345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14597340#comment-14597340
] 

Anoop Sam John commented on HBASE-12345:
----------------------------------------

We use UnsafeAccess APIs to read long/int/short which handle the endian.
{code}
public static long toLong(byte[] bytes, int offset) {
    if (littleEndian) {
      return Long.reverseBytes(theUnsafe.getLong(bytes, offset + BYTE_ARRAY_BASE_OFFSET));
    } else {
      return theUnsafe.getLong(bytes, offset + BYTE_ARRAY_BASE_OFFSET);
    }
  }
{code}

> Unsafe based Comparator for BB 
> -------------------------------
>
>                 Key: HBASE-12345
>                 URL: https://issues.apache.org/jira/browse/HBASE-12345
>             Project: HBase
>          Issue Type: Sub-task
>          Components: regionserver, Scanners
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>         Attachments: HBASE-12345.patch, HBASE-12345_V2.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message