[
https://issues.apache.org/jira/browse/HBASE-12202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14173756#comment-14173756
]
Anoop Sam John commented on HBASE-12202:
----------------------------------------
No extra overhead. Previously we had wrap() call and then slice. This will
create 2 new objects but no data copy. In patch also same way.
The existing will move the position of the destination buffer and is being used
already. This is different in which both src and destination ops are absolute
and no pos changes. IMO better can have 2 methods. Not many lines of codes..
Than passing a boolean and based on that do op, better 2 APIs
getBufferReadOnly -> the ops will be same as the old way. We want to limit the
new buffer to exclude the checksum bytes.
bq.return a real read only Buffer?
But we need new limit. So no new BB object is needed.
bq.Why is the limit after considering the headerSize()?
We increase the limit here because we have to copy the header data of the next
block. In case of array based copying this was ok. But now it is buffer to
buffer copy. We can not read/write after limit. I just wrote comments above
this code.
> 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
(v6.3.4#6332)