hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ChiaPing Tsai (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-16613) Return the unused ByteBuffer to BoundedByteBufferPool when no cell is got from the CellScanner
Date Mon, 12 Sep 2016 07:05:21 GMT
ChiaPing Tsai created HBASE-16613:
-------------------------------------

             Summary: Return the unused ByteBuffer to BoundedByteBufferPool when no cell is
got from the CellScanner
                 Key: HBASE-16613
                 URL: https://issues.apache.org/jira/browse/HBASE-16613
             Project: HBase
          Issue Type: Bug
            Reporter: ChiaPing Tsai
             Fix For: 1.3.0, 1.4.0


The critical code is shown below:
{code:title=IPCUtil.java|borderStyle=solid}
// 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;
}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message