Return-Path: Delivered-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Received: (qmail 11100 invoked from network); 9 Dec 2009 05:12:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Dec 2009 05:12:10 -0000 Received: (qmail 47653 invoked by uid 500); 9 Dec 2009 05:12:10 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 47531 invoked by uid 500); 9 Dec 2009 05:12:08 -0000 Mailing-List: contact mapreduce-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-user@hadoop.apache.org Delivered-To: mailing list mapreduce-user@hadoop.apache.org Received: (qmail 47520 invoked by uid 99); 9 Dec 2009 05:12:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Dec 2009 05:12:07 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [202.137.237.182] (HELO pro-237-182.rediffmailpro.com) (202.137.237.182) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 09 Dec 2009 05:11:58 +0000 Received: (qmail 28009 invoked from network); 9 Dec 2009 05:07:53 -0000 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: : 0 X-CTCH-RefID: str=0001.0A150201.4B1F3184.001F:SCFSTAT8751892,ss=1,fgs=0 Received: from unknown (HELO ?192.168.2.10?) (220.225.79.193) by mailserver with SMTP; 9 Dec 2009 05:07:53 -0000 Subject: Re: issue using LineRecordReader's nextKeyValue() method From: Kunal Gupta To: mapreduce-user@hadoop.apache.org In-Reply-To: References: <000001ca7355$b9e075b0$2da16110$@com> Content-Type: text/plain Date: Wed, 09 Dec 2009 10:41:31 +0530 Message-Id: <1260335491.2296.0.camel@kunal-f2i3> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Thanks Aaron, Your last point was absolutely correct and i was facing problem because of my lack of understanding of this point. I had later figured out the issue and allocated new memory for each key and value and got the issue resolved. Thanks for the response.. Aaron i was wondering whether i shall post such 'thanks' messages on the mapreduce-user mailing list or to the individual person? what do you suggest? -Kunal On Mon, 2009-12-07 at 15:51 -0800, Aaron Kimball wrote: > getCurrentKey() and getCurrentValue() do just that: they return the > current (k, v) pair i.e. the current line. The notion of the current > line is not changed by calling these methods. > > nextKeyValue()'s contract is to advance the iterator and return true > if more data is now available. > > Note that even if the data held in the current key and value objects > is updated by nextKeyValue(), the LineRR will not create new objects > to hold those key and value pairs -- it recycles objects for > efficiency. > > - Aaron > > > On Wed, Dec 2, 2009 at 5:45 AM, Kunal Gupta > wrote: > I am writing my custom InputFormat to read N number of lines > per map task. > > For this I have extended the FileInputFormat and RecordReader > classes. > > In my RecordReader I am using LineRecordReader object to get > key value pairs. > > If I am calling LineRecordReaderObj.nextKeyValue() method > multiple times while > > handling the same file SPLIT, it goes to the next keyValue but > the following functions > > return same keyValue every time: > > getCurrentKey() / getCurrentValue() > > What may be the possible reason for this behavior? > > > > >