hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ramkrishna.s.vasudevan (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-12345) Unsafe based Comparator for BB
Date Tue, 28 Oct 2014 06:36:34 GMT

     [ https://issues.apache.org/jira/browse/HBASE-12345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

ramkrishna.s.vasudevan updated HBASE-12345:
-------------------------------------------
    Attachment: HBASE-12345_1.patch

bq.The above code is using this long taking method only. DirectBuffer#address() returns a
long.
Okie fine then. 
bq.Also the DBB code does an << 0 operation.
I meant in the DBB code of getInt(int), getShort(int).  
bq.I think internally the util should handle it as in the patch.
Ok. Anyway the reader path should be changed to accomodate this. (which will be done).
But do we really need to do 
{code}
return theUnsafe.getInt(((DirectBuffer) buf).address() + offset);
{code}
Instead incase of DBB 
{code}
return buf.getInt(offset);
{code}
that will internally do
{code}
private int getInt(long a) {
        if (unaligned) {
            int x = unsafe.getInt(a);
            return (nativeByteOrder ? x : Bits.swap(x));
        }
        return Bits.getInt(a, bigEndian);
    }
{code}
where the unsafe here is the one part of DBB.  Test cases added yields the same result.
Attaching for ref.

> 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_1.patch
>
>




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

Mime
View raw message