Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 69A1F17F8B for ; Wed, 25 Nov 2015 06:10:11 +0000 (UTC) Received: (qmail 12750 invoked by uid 500); 25 Nov 2015 06:10:11 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 12644 invoked by uid 500); 25 Nov 2015 06:10:11 -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 12601 invoked by uid 99); 25 Nov 2015 06:10:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Nov 2015 06:10:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 037252C1F57 for ; Wed, 25 Nov 2015 06:10:11 +0000 (UTC) Date: Wed, 25 Nov 2015 06:10:11 +0000 (UTC) From: "ramkrishna.s.vasudevan (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-14873) Problems around BoundedByteBufferPool providing direct buffers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-14873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15026268#comment-15026268 ] ramkrishna.s.vasudevan commented on HBASE-14873: ------------------------------------------------ Ya. I can see this happen. Are you going to work on this [~ikeda]? > Problems around BoundedByteBufferPool providing direct buffers > -------------------------------------------------------------- > > Key: HBASE-14873 > URL: https://issues.apache.org/jira/browse/HBASE-14873 > Project: HBase > Issue Type: Bug > Reporter: Hiroshi Ikeda > > HBASE-13819 made BoundedByteBufferPool provide direct buffers. > See RpcServer.java: > {code} > ... > class Call implements RpcCallContext { > protected synchronized void setResponse(...) { > ... > this.cellBlock = ipcUtil.buildCellBlock(..., reservoir); > ... > bc = new BufferChain(..., this.cellBlock); > if (connection.useWrap) { > bc = wrapWithSasl(bc); > } > ... > private BufferChain wrapWithSasl(BufferChain bc) throws IOException { > ... > byte[] responseBytes = bc.getBytes(); > ... > {code} > {{cellBlock}} is expected to be a direct buffer retrieved from {{reservoir}} (but not always), and {{bc}} may be composed of both direct and non-direct buffers. > And then, see BufferChain.java: > {code} > byte [] getBytes() { > ... > for (ByteBuffer bb: this.buffers) { > System.arraycopy(bb.array(), ...); > {code} > A direct buffer doesn't give its array, and will throw UnsupportedOperationException. > Another problem; {{cellBlock}} is allowed to be a non-direct buffer, and after use it will be put to {{reservoir}}, mixing direct and non-direct buffers in the pool. -- This message was sent by Atlassian JIRA (v6.3.4#6332)