Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1EC1A61E1 for ; Wed, 22 Jun 2011 17:13:09 +0000 (UTC) Received: (qmail 3068 invoked by uid 500); 22 Jun 2011 17:13:09 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 2919 invoked by uid 500); 22 Jun 2011 17:13:08 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 2900 invoked by uid 99); 22 Jun 2011 17:13:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2011 17:13:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2011 17:13:07 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 889D1429BC8 for ; Wed, 22 Jun 2011 17:12:47 +0000 (UTC) Date: Wed, 22 Jun 2011 17:12:47 +0000 (UTC) From: "Aaron T. Myers (JIRA)" To: common-issues@hadoop.apache.org Message-ID: <748340618.29869.1308762767556.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HADOOP-310) Additional constructor requested in BytesWritable 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/HADOOP-310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053344#comment-13053344 ] Aaron T. Myers commented on HADOOP-310: --------------------------------------- Hey Brock, thanks a lot for reviving this issue (after 5 years!) I have a few small concerns about this patch: # The constructor which only takes a {{byte[]}} can now be implemented in terms of this new constructor you've introduced. # We now have {{set(byte[] bytes, int length)}} and {{set(byte[] bytes, int offset, int length)}}, which differ not only in signature, but in their semantics with respect to copying of the input data. This seems like it might lead to confusion. Perhaps we should name the new method something like {{setDirect(...)}}? Or perhaps we should amend the existing {{set(...)}} method to not do a copy? The latter is obviously a trickier and backward-incompatible change, but probably clearer. > Additional constructor requested in BytesWritable > ------------------------------------------------- > > Key: HADOOP-310 > URL: https://issues.apache.org/jira/browse/HADOOP-310 > Project: Hadoop Common > Issue Type: Improvement > Components: io > Reporter: p sutter > Assignee: Owen O'Malley > Priority: Minor > Attachments: bytes-writable-zero-copy-interface-0.patch, bytes-writable-zero-copy-interface-1.patch > > > It would be grand if BytesWritable.java had an additional constructor as below. This allows me to use the BytesWritable class without doing a buffer copy, since we have a less-than-fully-utilized byte array holding our key. > Thanks! > > /** > * Create a BytesWritable using the byte array as the initial value. > * @param bytes This array becomes the backing storage for the object. > */ > public BytesWritable(byte[] bytes, int size) { > this.bytes = bytes; > this.size = size; > } > -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira