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

Make our unsafe based ops more safe

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0, 1.3.0, 1.0.3, 1.1.3, 0.98.17, 2.0.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Thanks for the nice findings Hiroshi Ikeda

      This jira solves 3 issues with Unsafe operations and ByteBufferUtils
      1. We can do sun unsafe based reads and writes iff unsafe package is available and underlying platform is having unaligned-access capability. But we were missing the second check
      2. Java NIO is doing a chunk based copy while doing Unsafe copyMemory. The max chunk size is 1 MB. This is done for "A limit is imposed to allow for safepoint polling during a large copy" as mentioned in comments in Bits.java. We are also going to do same way
      3. In ByteBufferUtils, when Unsafe is not available and ByteBuffers are off heap, we were doing byte by byte operation (read/copy). We can avoid this and do better way.

        Attachments

        1. HBASE-14940_addendum_0.98.patch
          0.7 kB
          Anoop Sam John
        2. HBASE-14940_branch-1.patch
          8 kB
          Anoop Sam John
        3. HBASE-14940_branch-1.patch
          6 kB
          stack
        4. HBASE-14940_branch-1.patch
          6 kB
          stack
        5. HBASE-14940_branch-1.patch
          6 kB
          Anoop Sam John
        6. HBASE-14940_v2.patch
          15 kB
          Anoop Sam John
        7. HBASE-14940.patch
          15 kB
          Anoop Sam John

          Issue Links

            Activity

              People

              • Assignee:
                anoop.hbase Anoop Sam John
                Reporter:
                anoop.hbase Anoop Sam John
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: