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

ramkrishna.s.vasudevan commented on HBASE-13387:
------------------------------------------------

{code}
public static Cell createFirstOnRowCol(final Cell cell, byte[] qArray, int 
qoffest, int qlength) {
public static Cell createFirstOnRowCol(Cell cell, long ts) {
{code}
the name of the second API can be changed ?  createFirstOnRowColTS or something 
like that?
So for now you are passing the array part alone to the Fake keys? and not the 
BB based API?  The Fake Cells does not override the Bufferedcell?  Later 
improvement?  This fake key changes decide on what we will do with the blooms 
and the hashes.
{code}
    if (left instanceof ByteBufferedCell) {
+      return ByteBufferUtils.compareTo(((ByteBufferedCell) 
left).getRowByteBuffer(),
+          ((ByteBufferedCell) left).getRowPositionInByteBuffer(), 
left.getRowLength(),
+          right.getRowArray(), right.getRowOffset(), right.getRowLength());
+    }
+    if (right instanceof ByteBufferedCell) {
+      return -(ByteBufferUtils.compareTo(((ByteBufferedCell) 
right).getRowByteBuffer(),
+          ((ByteBufferedCell) right).getRowPositionInByteBuffer(), 
right.getRowLength(),
+          left.getRowArray(), left.getRowOffset(), left.getRowLength()));
+    }
{code}
Any specfic reason for negating?  Use left.getXXxArray and right.getXXXBuffer 
would also work right and there is no need for negating?
Rest looks good to me. +1. The abstract and interface diff in jmh is very 
interesting and I tried that out too. Nice work in that. Something to learn and 
somethings are puzzling too. 

> Add ByteBufferedCell an extension to Cell
> -----------------------------------------
>
>                 Key: HBASE-13387
>                 URL: https://issues.apache.org/jira/browse/HBASE-13387
>             Project: HBase
>          Issue Type: Sub-task
>          Components: regionserver, Scanners
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>             Fix For: 2.0.0
>
>         Attachments: ByteBufferedCell.docx, HBASE-13387_v1.patch, 
> HBASE-13387_v2.patch, WIP_HBASE-13387_V2.patch, WIP_ServerCell.patch, 
> benchmark.zip
>
>
> This came in btw the discussion abt the parent Jira and recently Stack added 
> as a comment on the E2E patch on the parent Jira.
> The idea is to add a new Interface 'ByteBufferedCell'  in which we can add 
> new buffer based getter APIs and getters for position in components in BB.  
> We will keep this interface @InterfaceAudience.Private.   When the Cell is 
> backed by a DBB, we can create an Object implementing this new interface.
> The Comparators has to be aware abt this new Cell extension and has to use 
> the BB based APIs rather than getXXXArray().  Also give util APIs in CellUtil 
> to abstract the checks for new Cell type.  (Like matchingXXX APIs, 
> getValueAs<type> APIs etc)



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

Reply via email to