[
https://issues.apache.org/jira/browse/HBASE-12358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14214823#comment-14214823
]
Anoop Sam John commented on HBASE-12358:
----------------------------------------
{quote}
You mean a getFamilyArray would have a companion getFamilyBuffer, and so on?
What would the getFamilyBuffer return?
Doing comparisons when the bytes are off heap, how would that work?
{quote}
For comparison we will always use getxxxBuffer() APIs. We can compare two BBs.
(on heap or offheap) using ByteBufferUtils. Pls see patch in HBASE-12345 which
even having the Unsafe optimization. Ya we change BB to BR in APIs, we can have
similar util API.
In Read path Cells can come from HFiles and/or Memstore. HFile cells can be
backed by buffer (BR wrap we can make out) as the file data is actually in
buffer (Either we read from HDFS or in cache). In case of Memstore the Cells
are backed by byte[]. getxxxBuffer() APIs need create new object every time.
These are short lived objects any way. We discussed abt one way to solve this
(in most cases). By default MSLAB is ON. The API in MSLAB returns a BR already.
A new Cell impl can back this with out much of overhead on heap size. So
getxxxbuffer() API , no need to create new Objects.
{quote}
bq.As Anoop already pointed out for all the filters and exposed APIs the user
might need to use Cell.hasArray() to determine whether to use getXXXArray() or
getXXXBuffer().
We'd have to do this even if Cell was BR backed?
{quote}
BR will be either backed by array or buffer. The buffer can be offheap also
where there is no backing array. In such case getxxxArray() might throw
UnsupportedOpException. So hasArray() will be needed.
> Create ByteBuffer backed Cell
> -----------------------------
>
> Key: HBASE-12358
> URL: https://issues.apache.org/jira/browse/HBASE-12358
> Project: HBase
> Issue Type: Sub-task
> Components: regionserver, Scanners
> Reporter: ramkrishna.s.vasudevan
> Assignee: ramkrishna.s.vasudevan
> Attachments: HBASE-12358.patch, HBASE-12358_1.patch,
> HBASE-12358_2.patch
>
>
> As part of HBASE-12224 and HBASE-12282 we wanted a Cell that is backed by BB.
> Changing the core Cell impl would not be needed as it is used in server
> only. So we will create a BB backed Cell and use it in the Server side read
> path. This JIRA just creates an interface that extends Cell and adds the
> needed API.
> The getTimeStamp and getTypebyte() can still refer to the original Cell API
> only. The getXXxOffset() and getXXXLength() can also refer to the original
> Cell only.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)