From notifications-return-13596-apmail-accumulo-notifications-archive=accumulo.apache.org@accumulo.apache.org Mon Dec 16 18:53:10 2013 Return-Path: X-Original-To: apmail-accumulo-notifications-archive@minotaur.apache.org Delivered-To: apmail-accumulo-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7F9DE1063F for ; Mon, 16 Dec 2013 18:53:10 +0000 (UTC) Received: (qmail 28748 invoked by uid 500); 16 Dec 2013 18:53:10 -0000 Delivered-To: apmail-accumulo-notifications-archive@accumulo.apache.org Received: (qmail 28698 invoked by uid 500); 16 Dec 2013 18:53:10 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 28629 invoked by uid 99); 16 Dec 2013 18:53:10 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Dec 2013 18:53:10 +0000 Date: Mon, 16 Dec 2013 18:53:10 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: notifications@accumulo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ACCUMULO-1959) Value constructors taking ByteBuffers need refinement 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/ACCUMULO-1959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13849588#comment-13849588 ] ASF subversion and git services commented on ACCUMULO-1959: ----------------------------------------------------------- Commit 37c9a76017eac42577fbbc4c217f2af76ea84779 in branch refs/heads/master from [~vines] [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=37c9a76 ] ACCUMULO-1959 - supressing deprecation warning > Value constructors taking ByteBuffers need refinement > ----------------------------------------------------- > > Key: ACCUMULO-1959 > URL: https://issues.apache.org/jira/browse/ACCUMULO-1959 > Project: Accumulo > Issue Type: Bug > Affects Versions: 1.4.0 > Reporter: Bill Havanki > Assignee: Bill Havanki > Priority: Minor > Fix For: 1.6.0 > > Attachments: ACCUMULO-1959.patch > > > This ticket pertains to the following Value constructors. > {noformat} > public Value(ByteBuffer bytes) > public Value(ByteBuffer bytes, boolean copy) > {noformat} > Their appearance suggests that the second one can either copy bytes from the buffer or reference them directly, and the first one works similarly but has some default copying behavior. > However, both constructors use {{ByteBufferUtil.toBytes()}} on the ByteBuffer object, which always performs a copy. Therefore, it doesn't make sense (to me at least) to support a copy flag in the second constructor. In the current implementation, the bytes are copied twice if the copy flag is true. > The implementation should be reworked to avoid unnecessary copies, and perhaps simplify the API. -- This message was sent by Atlassian JIRA (v6.1.4#6159)