[
https://issues.apache.org/jira/browse/CASSANDRA-1998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982834#action_12982834
]
Sylvain Lebresne commented on CASSANDRA-1998:
---------------------------------------------
bq. As much as I hate the BB api i think it will be more confusing to mix
theirs (there are a LOT of get calls outside of BBU) with our own, than to
conform to the official API.
For the sake of discussion, the point of this is to not mix things, but to keep
only our own. I don't think after this
patch has been applied that there remain any call to a ByteBuffer.get() that is
not a ByteBufferUtil.get() (or it's
a bug). Provided this, I do believe that saying once and for all "don't use the
ByteBuffer api (at least not the get's)
unless you know what you do" is not that confusing.
But since "will it be more or less confusing to do that or that" can't
completely be resolved by technical argument,
I won't insist too much on this if people don't like it. I wrote the patch to
see how it look like and I personally like
the result.
> Make offsets in ByteBufferUtil.* methods relatif to the ByteBuffer position()
> -----------------------------------------------------------------------------
>
> Key: CASSANDRA-1998
> URL: https://issues.apache.org/jira/browse/CASSANDRA-1998
> Project: Cassandra
> Issue Type: Improvement
> Components: Core
> Affects Versions: 0.8
> Reporter: Sylvain Lebresne
> Assignee: Sylvain Lebresne
> Priority: Minor
> Fix For: 0.8
>
> Attachments: 0001-0.7-Make-BB-offset-relative-to-position.patch,
> 0001-Make-BB-offset-relative-to-position.patch,
> 0002-0.7-Move-EMPTY_BYTE_BUFFER-to-ByteBufferUtil.patch,
> 0002-Move-EMPTY_BYTE_BUFFER-to-ByteBufferUtil.patch
>
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> A few methods in ByteBufferUtil take as parameter an offset inside a
> ByteBuffer. When we use them, we always want this offset to be relative to
> ByteBuffer.position(), but it is not, it is relative to the ByteBuffer 0
> position. I argue this is not inline with the way we use ByteBuffers and as a
> consequence, is ugly and error-prone.
> This ticket proposes to make the offset of the ByteBufferUtil.* methods
> relatif to the ByteBuffer position.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.