[
https://issues.apache.org/jira/browse/HBASE-13977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14611800#comment-14611800
]
ramkrishna.s.vasudevan commented on HBASE-13977:
------------------------------------------------
I went thro the changes once again
bq."Gets the current key in the form of a cell." That there is no value
returned?
Yes. only the key part. Earlier it was a BB view of the key - now it is a Cell.
bq.In getKeyAsCell, why bother with a ByteBuffer when all you are doing is
passing an array?
Ya, you are right. I changed that to just use the System.arrayCopy in
BufferedDataEncoder.getKeyAsCell.
bq.getKeyAsCell is defined in multiple Interfaces? Can we avoid that?
For the DBE cases I think we cannot do it now because the entire seeker is now
the BuffereddataEncoder. So we need some API in the DatablockEncoder to be
used. May be another JIRA if it is possible?
bq.if (getComparator().compare(splitCell, getKeyAsCell()) <= 0) {
Valid point. But previously for creating a BB we were creating a BB object but
now we are creating a cell every time. But thinking in terms of
BufferedBackedCell it would be better if it had been a cell. The current code
is trying to do
{code}
- ByteBuffer bb = getKey();
- if (getComparator().compare(splitCell, bb.array(), bb.arrayOffset(),
- bb.limit()) <= 0) {
{code}
After BufferedBackedcells come - we cannot have it the above way as array() and
arrayOffset() are not expected to be used. Hence making it as cell would be
encapsulate us of this inner detail.
I thought of using the instance level keyOnlyKv in the HFileScannerImpl - but
since the HalfStorefileReader is trying to cache the firstKey we cannot use
that instance level variable in HFileScanner and use that to just set the
byte[] every time.
> Convert getKey and related APIs to Cell
> ---------------------------------------
>
> Key: HBASE-13977
> URL: https://issues.apache.org/jira/browse/HBASE-13977
> Project: HBase
> Issue Type: Sub-task
> Reporter: ramkrishna.s.vasudevan
> Assignee: ramkrishna.s.vasudevan
> Attachments: HBASE-13977.patch, HBASE-13977_1.patch,
> HBASE-13977_2.patch, HBASE-13977_3.patch
>
>
> During the course of changes for HBASE-11425 felt that more APIs can be
> converted to return Cell instead of BB like getKey, getLastKey.
> We can also rename the getKeyValue to getCell.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)