Return-Path: Delivered-To: apmail-hadoop-mapreduce-issues-archive@minotaur.apache.org Received: (qmail 40204 invoked from network); 9 Sep 2009 10:50:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Sep 2009 10:50:22 -0000 Received: (qmail 3630 invoked by uid 500); 9 Sep 2009 10:50:22 -0000 Delivered-To: apmail-hadoop-mapreduce-issues-archive@hadoop.apache.org Received: (qmail 3571 invoked by uid 500); 9 Sep 2009 10:50:22 -0000 Mailing-List: contact mapreduce-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-issues@hadoop.apache.org Delivered-To: mailing list mapreduce-issues@hadoop.apache.org Received: (qmail 3558 invoked by uid 99); 9 Sep 2009 10:50:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Sep 2009 10:50: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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Sep 2009 10:50:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 721A8234C044 for ; Wed, 9 Sep 2009 03:49:57 -0700 (PDT) Message-ID: <1477317000.1252493397452.JavaMail.jira@brutus> Date: Wed, 9 Sep 2009 03:49:57 -0700 (PDT) From: "Tom White (JIRA)" To: mapreduce-issues@hadoop.apache.org Subject: [jira] Commented: (MAPREDUCE-960) Unnecessary copy in mapreduce.lib.input.KeyValueLineRecordReader In-Reply-To: <92703265.1252370877565.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MAPREDUCE-960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753023#action_12753023 ] Tom White commented on MAPREDUCE-960: ------------------------------------- +1 KeyValueLineRecordReader is tested by TestMRKeyValueTextInputFormat so no new test is needed. > Unnecessary copy in mapreduce.lib.input.KeyValueLineRecordReader > ---------------------------------------------------------------- > > Key: MAPREDUCE-960 > URL: https://issues.apache.org/jira/browse/MAPREDUCE-960 > Project: Hadoop Map/Reduce > Issue Type: Improvement > Affects Versions: 0.21.0 > Reporter: Chris Douglas > Assignee: Chris Douglas > Attachments: M960-0.patch > > > KeyValueLineRecordReader effects the copy from the line to the key/value by creating separate arrays: > {noformat} > int keyLen = pos; > byte[] keyBytes = new byte[keyLen]; > System.arraycopy(line, 0, keyBytes, 0, keyLen); > int valLen = lineLen - keyLen - 1; > byte[] valBytes = new byte[valLen]; > System.arraycopy(line, pos + 1, valBytes, 0, valLen); > key.set(keyBytes); > value.set(valBytes); > {noformat} > Since set triggers another copy and Text has a set taking {{byte[], off, len}}, the intermediate copy can be avoided -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.