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

stack commented on HBASE-4691:
------------------------------

+1

There were a few howlers in there.  E.g:

{code}
-    if (kv == null || kv.getValue().length != Bytes.SIZEOF_LONG)
+    if (kv == null || kv.getValueLength() != Bytes.SIZEOF_LONG)
{code}

Create a byte array just to get the length.

And this one:

{code}
           byte[] lastKey = kvs.get(0).getRow();
-          Put put = new Put(kvs.get(0).getRow(),
-              kvs.get(0).getTimestamp());
{code}

Good stuff Lars.
                
> Remove more unnecessary byte[] copies from KeyValues
> ----------------------------------------------------
>
>                 Key: HBASE-4691
>                 URL: https://issues.apache.org/jira/browse/HBASE-4691
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Lars Hofhansl
>            Assignee: Lars Hofhansl
>            Priority: Minor
>             Fix For: 0.94.0
>
>         Attachments: 4691.txt
>
>
> Just looking through the code I found some more spots where we unnecessarily 
> copy byte[] rather than just passing offset and length around.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to