Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-16541

Avoid unnecessary cell copy in Result#compareResults

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.4.0, 2.0.0
    • None
    • None
    • Reviewed

    Description

      Bar.java
      // 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());
            }
          }
        }
      

      Attachments

        1. HBASE-16541.v2.patch
          2 kB
          Chia-Ping Tsai
        2. HBASE-16541.v1.patch
          2 kB
          Chia-Ping Tsai
        3. HBASE-16541.v1.patch
          2 kB
          Chia-Ping Tsai

        Activity

          People

            chia7712 Chia-Ping Tsai
            chia7712 Chia-Ping Tsai
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: