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

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0, 1.2.4
    • None
    • None
    • 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.v0.patch
          1 kB
          Chia-Ping Tsai
        2. HBASE-16613.branch-1.v1.patch
          2 kB
          Chia-Ping Tsai
        3. HBASE-16613.branch-1.v1.patch
          2 kB
          Michael Stack

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: