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] [Commented] (HBASE-12202) Support DirectByteBuffer usage in HFileBlock
Date Thu, 16 Oct 2014 12:29:34 GMT

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

ramkrishna.s.vasudevan commented on HBASE-12202:

Had a look at the patch.  
-> Now doing duplicate and a slice, we are doing more operations but they may be minor
I suppose.
-> ByteBufferUtils.copyFromBufferToBuffer() can we reuse the one above the new one. I mean
can we refactor both of them.
-> In HfileBlock.getBufferReadOnly()
-    return ByteBuffer.wrap(buf.array(), buf.arrayOffset(),
-        buf.limit() - totalChecksumBytes()).slice();
+    ByteBuffer dup = this.buf.duplicate();
+    dup.limit(buf.limit() - totalChecksumBytes());
+    return dup.slice();
This will impact the limit and the capacity of the returning array.  Will that be a concern?
When we say a read only will it be better to return a real read only Buffer?  In case of BR
we tried to do achieve that by returning an ImmutableBR unless and otherwise stated to return
a MutableBR.
ByteBuffer inDup = this.buf.duplicate();
+      inDup.limit(inDup.limit() + headerSize());
Why is the limit after considering the headerSize()? 

> Support DirectByteBuffer usage in HFileBlock
> --------------------------------------------
>                 Key: HBASE-12202
>                 URL: https://issues.apache.org/jira/browse/HBASE-12202
>             Project: HBase
>          Issue Type: Sub-task
>          Components: regionserver, Scanners
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>             Fix For: 2.0.0, 0.99.2
>         Attachments: HBASE-12202.patch, HBASE-12202_V2.patch

This message was sent by Atlassian JIRA

View raw message