Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0AE1A200B8C for ; Mon, 12 Sep 2016 09:09:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 09676160AD7; Mon, 12 Sep 2016 07:09:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 76E0B160AB8 for ; Mon, 12 Sep 2016 09:09:21 +0200 (CEST) Received: (qmail 67785 invoked by uid 500); 12 Sep 2016 07:09:20 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 67771 invoked by uid 99); 12 Sep 2016 07:09:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Sep 2016 07:09:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7B94A2C1B75 for ; Mon, 12 Sep 2016 07:09:20 +0000 (UTC) Date: Mon, 12 Sep 2016 07:09:20 +0000 (UTC) From: "ChiaPing Tsai (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (HBASE-16613) Return the unused ByteBuffer to BoundedByteBufferPool when no cell is got from the CellScanner MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 12 Sep 2016 07:09:22 -0000 [ https://issues.apache.org/jira/browse/HBASE-16613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ChiaPing Tsai reassigned HBASE-16613: ------------------------------------- Assignee: ChiaPing Tsai > 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 > Assignee: ChiaPing Tsai > Fix For: 1.3.0, 1.4.0 > > Attachments: HBASE-16613.branch-1.v0.patch > > > 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)