Uploaded image for project: 'Crunch (Retired)'
  1. Crunch (Retired)
  2. CRUNCH-546

Avoid CellUtil.cloneXXX in HFileUtils and HFileInputFormat

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.13.0
    • None
    • None

    Description

      HFileUtils and HFileInputFormat currently make use of the CellUtil.cloneXXX in a number of places when comparing row, family, and qualifier values with a constant.

      The clone methods are relatively costly, as they require allocating a new byte array and copying all data over into the new array on every call.

      Bytes.equals, Bytes.compareTo, and ByteBuffer.wrap also accept a byte array and offset and length parameters, which allows accessing portions of KeyValues without copying them out into a separate byte array when using them for comparison. We should replace the uses of CellUtil.cloneXXX with the alternate calls to the above methods where possible.

      Attachments

        1. CRUNCH-546.patch
          3 kB
          Gabriel Reid

        Activity

          People

            gabriel.reid Gabriel Reid
            gabriel.reid Gabriel Reid
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: