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

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

Looks good.
Some minor comments

writeRowExcludingCommonPrefix
Call it writeRowSkippingBytes(out, Cell, int skipBytes)
Same way for writeQualifierExcludingCommonPrefix

writeRow  -> Do we need to pass the rLength when we can get it from Cell? Or 
may be it is already computed in calling place and u want to avoid parsing it 
again?  Same for writeRowExcludingCommonPrefix

{code}
int rkCommonPrefix = 0;
1119        if (c1 instanceof ByteBufferedCell && c2 instanceof 
ByteBufferedCell) {
1120          rkCommonPrefix = 
ByteBufferUtils.findCommonPrefix(((ByteBufferedCell) c1).getRowByteBuffer(),
1121            ((ByteBufferedCell) c1).getRowPosition(), rLen1, 
((ByteBufferedCell) c2).getRowByteBuffer(),
1122            ((ByteBufferedCell) c2).getRowPosition(), rLen2);
1123        } else {
1124          // There cannot be a case where one cell is BBCell and other is 
KeyValue. This flow comes either
1125          // in flush or compactions. In flushes both cells are KV and in 
case of compaction it will be either
1126          // KV or BBCell
1127          rkCommonPrefix = 
ByteBufferUtils.findCommonPrefix(c1.getRowArray(), c1.getRowOffset()
{code}
Can the instance of check be limited in some util place? CellUtil?  

nit:
ByteBufferUtils.toByte(in, offset + i)
Just call toByte() as we are in same class
Same way in new method findCommonPrefix


> Ensure write paths work with ByteBufferedCells in case of compaction
> --------------------------------------------------------------------
>
>                 Key: HBASE-14832
>                 URL: https://issues.apache.org/jira/browse/HBASE-14832
>             Project: HBase
>          Issue Type: Sub-task
>          Components: regionserver, Scanners
>    Affects Versions: 2.0.0
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: HBASE-14832.patch
>
>
> Currently any cell coming out of offheap Bucketcache while compaction does a 
> copy using the getXXXArray() API since write path does not work with BBCells. 
> This JIRA is aimed at changing the write path to support BBCells so that this 
> copy is avoided.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to