[ 
https://issues.apache.org/jira/browse/HBASE-13977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14608612#comment-14608612
 ] 

Anoop Sam John commented on HBASE-13977:
----------------------------------------

{code}
@Override
    public byte[] getValueArray() {
      throw new IllegalArgumentException("KeyOnlyKeyValue does not work with 
values.");
    }
{code}
Do we need to change it now? If we miss below kind of checks in some places we 
will land in issues
bq.if (!(cell instanceof KeyValue.KeyOnlyKeyValue)) {

BufferedDataBlockEncoder
{code}
public Cell getKeyAsCell() {
  ByteBuffer keyBuffer = ByteBuffer.allocate(current.keyLength);
  keyBuffer.put(current.keyBuffer, 0, current.keyLength);
  keyBuffer.rewind();
  return new KeyValue.KeyOnlyKeyValue(keyBuffer.array());
}
{code}
No need to go with BB create now..  Directly make the Cell out of 
current.keyBuffer?  Do we need to clone that (if so also byte[] copy and create 
KV)?

Cell getLastKey -> to be named as getLastKeyAsCell?
I am ok to continue with old name also.. But then we have to have uniform 
naming... Some other APIs we have changed name

{code}
KeyValue kv = KeyValueUtil.ensureKeyValue(scanner.getCell());
halfWriter.append(kv);
{code}
We can avoid the call to ensureKeyValue()

bq.firstOnRow = new KeyValue(CellUtil.cloneRow(lastKV), 
HConstants.LATEST_TIMESTAMP);
Instead of cloneRow can pass lastKV.getRowArray, offset and length and make KV?

Same here also
bq.firstOnRow = new KeyValue(CellUtil.cloneRow(kv), 
HConstants.LATEST_TIMESTAMP);


> Convert getKey and related APIs to Cell
> ---------------------------------------
>
>                 Key: HBASE-13977
>                 URL: https://issues.apache.org/jira/browse/HBASE-13977
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>         Attachments: HBASE-13977.patch, HBASE-13977_1.patch, 
> HBASE-13977_2.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)

Reply via email to