[
https://issues.apache.org/jira/browse/HBASE-17191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15712648#comment-15712648
]
Anoop Sam John commented on HBASE-17191:
----------------------------------------
{code}
ByteBuffer row = ((ByteBufferCell) kv).getRowByteBuffer().duplicate();
2083 row.position(((ByteBufferCell) kv).getRowPosition());
2084 row.limit(((ByteBufferCell) kv).getRowPosition() +
kv.getRowLength());
{code}
Similar code repeating for CF, Q etc. Can we extract it into a private method?
wrap(BB, pos, length).
You can call it with passing rowBB, cfBB etc.
kvbuilder.setRow(wrap(...));
In test can we assert CellComparator.compare (offheapKV, newOffheapKV) == 0?
> Make use of UnsafeByteOperations#unsafeWrap(ByteBuffer buffer) in
> PBUtil#toCell(Cell cell)
> ------------------------------------------------------------------------------------------
>
> Key: HBASE-17191
> URL: https://issues.apache.org/jira/browse/HBASE-17191
> Project: HBase
> Issue Type: Improvement
> Affects Versions: 2.0.0
> Reporter: ramkrishna.s.vasudevan
> Assignee: ramkrishna.s.vasudevan
> Attachments: HBASE-17191.patch
>
>
> Since we now have support for BBs in
> UnsafeByteOperations#unsafeWrap(ByteBuffer) . So for the non - java clients
> while creating the PB result we could avoid the copy to an temp array.
> Since we have a support to write to BB in ByteOutput having a result backed
> by Bytebuffer should be fine.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)