[
https://issues.apache.org/jira/browse/HBASE-10771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13955007#comment-13955007
]
Andrew Purtell commented on HBASE-10771:
----------------------------------------
The problems with ByteBuffer as I see it are threefold:
1. Locking and slicing on account of the 'limit' and 'position' fields can be
expensive as [~mcorgan] says.
2. The get* and put* methods have bounds checking which add overhead that I
think is unnecessary
3. BB methods don't inline well, partially on account of #2.
I would not like to see ByteRange be as unsatisfying to use as ByteBuffer. So
for me the test as to whether we are doing the right things with ByteRange is
that none of the above three points are true for ByteRange.
bq. IMO, we're better off making use of an upstream project's types than
reinventing our own. We'll enjoy better compatibility with ecosystem tools.
Trouble is, ByteBuffer is inflexible and we haven't a concensus on adopting
Netty.
[~ndimiduk]: Here you repeat my rationale for looking at Netty 4's ByteBuf but
I will note that only you seemed to raise an objection to using the Netty 4
ByteBuf classes. This was sufficient to de-prioritize any work on that and so I
haven't touched it since our last discussion. I think your suggestion to use
reflection will fail to address my point #3 above, as well as be expensive
simply due to the use of reflection.
> Primitive type put/get APIs in ByteRange
> -----------------------------------------
>
> Key: HBASE-10771
> URL: https://issues.apache.org/jira/browse/HBASE-10771
> Project: HBase
> Issue Type: Improvement
> Reporter: Anoop Sam John
> Assignee: Anoop Sam John
> Fix For: 0.99.0
>
> Attachments: HBASE-10771.patch, HBASE-10771_V2.patch
>
>
> While doing HBASE-10713 I came across the need to write int/long (and read
> also) from a ByteRange. CellBlocks are backed by ByteRange. So we can add
> such APIs.
> Also as per HBASE-10750 we return a ByteRange from MSLAB and also discussion
> under HBASE-10191 suggest we can have BR backed HFileBlocks etc.
--
This message was sent by Atlassian JIRA
(v6.2#6252)