Return-Path: Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: (qmail 52838 invoked from network); 13 Dec 2010 21:22:23 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Dec 2010 21:22:23 -0000 Received: (qmail 82811 invoked by uid 500); 13 Dec 2010 21:22:23 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 82758 invoked by uid 500); 13 Dec 2010 21:22:22 -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 82750 invoked by uid 99); 13 Dec 2010 21:22:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Dec 2010 21:22:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Dec 2010 21:22:22 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oBDLM1e7004998 for ; Mon, 13 Dec 2010 21:22:02 GMT Message-ID: <7868517.100221292275321931.JavaMail.jira@thor> Date: Mon, 13 Dec 2010 16:22:01 -0500 (EST) From: "Tom White (JIRA)" To: common-issues@hadoop.apache.org Subject: [jira] Commented: (HADOOP-6298) BytesWritable#getBytes is a bad name that leads to programming mistakes 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-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971040#action_12971040 ] Tom White commented on HADOOP-6298: ----------------------------------- How about adding {{getBytesNonPadded()}} which creates a copy in a non-padded byte array? By naming it like this, this name would appear next to {{getBytes()}} in IDE autocompletion lists, which hopefully would alert users to the difference between the two methods. > BytesWritable#getBytes is a bad name that leads to programming mistakes > ----------------------------------------------------------------------- > > Key: HADOOP-6298 > URL: https://issues.apache.org/jira/browse/HADOOP-6298 > Project: Hadoop Common > Issue Type: Improvement > Affects Versions: 0.20.1 > Reporter: Nathan Marz > > Pretty much everyone at Rapleaf who has worked with Hadoop has misused BytesWritable#getBytes at some point, not expecting the byte array to be padded. I think we can completely alleviate these programming mistakes by deprecating and renaming this method (again) to be more descriptive. I propose "getPaddedBytes()" or "getPaddedValue()". It would also be helpful to have a helper method "getNonPaddedValue()" that makes a copy into a non-padded byte array. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.