[
https://issues.apache.org/jira/browse/HBASE-13387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14487867#comment-14487867
]
ramkrishna.s.vasudevan commented on HBASE-13387:
------------------------------------------------
Adding one more cell and allowing the user to to manipulate the cell using
instance of check - so it becomes mandatory that he uses this instance of check
or use the CellUtil. Another thing is it becomes user's prudency to use the
correct Offset API like use getXXXOffset for getXXXArray and use the
getBBPosition() for the getXXXBuffer.
This problem was already there in terms of using hasArray without which he
would get an UnSupportedException but did not have the problem of the API
confusion.
Now this new APIs is now enforcing proper API usage to know the offset and
length. (length may be common anyway).
Anyway even now an offheap Backed Buffer cell if we call getXXXArray would do
the copy of the BB and the array position is anyway going to be 0.
This again goes back to the mail discussion as which one is better here. If we
don't want Exceptions to be thrown then this is the only way. 'instanceOf' and
'typecast' would become mandatory because in our previous patches we had this
way and later reverted this as things look ugly particularly because the number
of times we call different comparators is huge.
One more thing, I think in these implementations it is very much mandatory that
we cache these new offsets and lengths ? Am i right? Because if we want only
compare APIS that accept only cells then every time we should use getXXXOFfset
or getBBOffset inside the methods. If we don't cache them then it is going to
be costly. If not we should create explicity APIs accepting Cell followed by
array offset and another one accepting buffer offset.
Overall in this discussion here I would go with what ever majority agrees.
> Add ServerCell an extension to Cell
> -----------------------------------
>
> Key: HBASE-13387
> URL: https://issues.apache.org/jira/browse/HBASE-13387
> Project: HBase
> Issue Type: Sub-task
> Components: regionserver, Scanners
> Reporter: Anoop Sam John
> Assignee: Anoop Sam John
> Attachments: WIP_HBASE-13387_V2.patch, WIP_ServerCell.patch
>
>
> This came in btw the discussion abt the parent Jira and recently Stack added
> as a comment on the E2E patch on the parent Jira.
> The idea is to add a new Interface 'ServerCell' in which we can add new
> buffer based getter APIs, hasArray API etc. We will keep this interface
> @InterfaceAudience.Private
> Also we have to change the timestamp and seqId on Cells in server side. We
> have added new interfaces SettableSequenceId, SettableTimestamp for this. Now
> if we can add a ServerCell we can add the setter APIs there.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)