XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: regionserver, Scanners
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

       Lock lock = locks[i];
            lock.lock();
            try {
              ByteBuffer bb = buffers[i];
              if (i == startBuffer) {
                cnt = bufferSize - startBufferOffset;
                if (cnt > len) cnt = len;
                ByteBuffer dup = bb.duplicate();
                dup.limit(startBufferOffset + cnt).position(startBufferOffset);
                mbb[j] = dup.slice();
      

      In asSubByteBuff, we work on the duplicate BB and set limit and position on that.. The locking is not needed here.

      The locking is added because we set limit and position on the BBs in the array. We can duplicate the BBs and do positioning and limit on them. The locking can be fully avoided.

        Attachments

        1. HBASE-15785_V2.patch
          8 kB
          Anoop Sam John
        2. HBASE-15785_V3.patch
          8 kB
          Anoop Sam John
        3. HBASE-15785.patch
          3 kB
          Anoop Sam John

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: