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

Return the unused ByteBuffer to BoundedByteBufferPool when no cell is retrieved from the CellScanner

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0, 1.2.4
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      The critical code is shown below:

      IPCUtil.java
      // We should put the ByteBuffer into pool before return null
        public ByteBuffer buildCellBlock(final Codec codec, final CompressionCodec compressor,
          final CellScanner cellScanner, final BoundedByteBufferPool pool) {
        ...
        if (pool != null) {
            ByteBuffer bb = pool.getBuffer();
            bufferSize = bb.capacity();
            baos = new ByteBufferOutputStream(bb);
        }
        ...
            int count = 0;
            while (cellScanner.advance()) {
              encoder.write(cellScanner.current());
              count++;
            }
            encoder.flush();
            if (count == 0) return null;
      }
      

        Attachments

        1. HBASE-16613.branch-1.v1.patch
          2 kB
          Chia-Ping Tsai
        2. HBASE-16613.branch-1.v1.patch
          2 kB
          Michael Stack
        3. HBASE-16613.branch-1.v0.patch
          1 kB
          Chia-Ping Tsai

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: