hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anoop Sam John (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-16541) Avoid unnecessary cell copy in Result.compareResults
Date Sun, 04 Sep 2016 08:09:20 GMT

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

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

+1
[~tedyu] U will commit this?

> Avoid unnecessary cell copy in Result.compareResults
> ----------------------------------------------------
>
>                 Key: HBASE-16541
>                 URL: https://issues.apache.org/jira/browse/HBASE-16541
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: ChiaPing Tsai
>            Assignee: ChiaPing Tsai
>         Attachments: HBASE-16541.v1.patch, HBASE-16541.v1.patch, HBASE-16541.v2.patch
>
>
> {code:title=Bar.java|borderStyle=solid}
> // Bytes.equals(a, b) should be replaced by Bytes.equals(a, off, len, b, off len);
>   public static void compareResults(Result res1, Result res2)
>       throws Exception {
>     ...
>     Cell[] ourKVs = res1.rawCells();
>     Cell[] replicatedKVs = res2.rawCells();
>     for (int i = 0; i < res1.size(); i++) {
>       if (!ourKVs[i].equals(replicatedKVs[i]) ||
>           !Bytes.equals(CellUtil.cloneValue(ourKVs[i]), CellUtil.cloneValue(replicatedKVs[i])))
{
>         throw new Exception("This result was different: "
>             + res1.toString() + " compared to " + res2.toString());
>       }
>     }
>   }
> {code}



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

Mime
View raw message