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

UnsafeAccess.unsafeCopy should not copy more than UNSAFE_COPY_THRESHOLD on each iteration

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0, 2.2.0, 1.4.10, 2.0.6, 1.3.5, 2.1.6
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      In UnsafeAccess.unsafeCopy, we calculate a size _ to be read, no greater than UNSAFE_COPY_THRESHOLD, if total _len is larger than UNSAFE_COPY_THRESHOLD:

      long size = (len > UNSAFE_COPY_THRESHOLD) ? UNSAFE_COPY_THRESHOLD : len;
      

      But then we simply read the whole len anyway:

      theUnsafe.copyMemory(src, srcAddr, dst, destAddr, len);
      

      I believe the real intention here is to copy chunks of size bytes, the current code is already copying everything on the first iteration, then performing additional chunked copies.

        Attachments

        1. HBASE-22496.master.001.patch
          1 kB
          Wellington Chevreuil

          Activity

            People

            • Assignee:
              wchevreuil Wellington Chevreuil
              Reporter:
              wchevreuil Wellington Chevreuil
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: