Return-Path: X-Original-To: apmail-hadoop-common-user-archive@www.apache.org Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CCDD64CFA for ; Wed, 8 Jun 2011 16:14:05 +0000 (UTC) Received: (qmail 85525 invoked by uid 500); 8 Jun 2011 16:14:03 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 85467 invoked by uid 500); 8 Jun 2011 16:14:02 -0000 Mailing-List: contact common-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-user@hadoop.apache.org Delivered-To: mailing list common-user@hadoop.apache.org Received: (qmail 85458 invoked by uid 99); 8 Jun 2011 16:14:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jun 2011 16:14:02 +0000 X-ASF-Spam-Status: No, hits=3.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of markq2011@gmail.com designates 209.85.220.176 as permitted sender) Received: from [209.85.220.176] (HELO mail-vx0-f176.google.com) (209.85.220.176) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jun 2011 16:13:56 +0000 Received: by vxa37 with SMTP id 37so777206vxa.35 for ; Wed, 08 Jun 2011 09:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=4l0euSGSEaAXQ3KI7xLWmBMpHhJ55bsz/xN7KEIxGfc=; b=OkgqF6V6sUsULwWs5AYCDUOc7QSUsiILc2yT1wpHg7J5ReidqfuAFm6Xmda+hS7a2J 8OpWj07uUogDeOEUYJs7vDhPO8iEDVksn56/HfyvaZfpmrBtbnmmSv4xMIS0pVj2jdjc 3sPXFlLo795VG8uuijv6HEPI0jfvDVa7ijPnY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=jFz8PnYoB2rzTrewN9Xw8nyzAFNZ5BL9c4GddiPlxbYQHcuvuPM/+kILuowXPC+YNx fP00SgSc42H3ycKrKz80ZGTOHFbM5/0B5FsU7YA3emCbZl4lDPSvCRJFETFID1/ccbGw 2QymZSzNPkWZEbmROG67rSOfxVfwhQZmvYGxM= MIME-Version: 1.0 Received: by 10.220.189.131 with SMTP id de3mr1862090vcb.48.1307549615137; Wed, 08 Jun 2011 09:13:35 -0700 (PDT) Received: by 10.220.167.203 with HTTP; Wed, 8 Jun 2011 09:13:35 -0700 (PDT) In-Reply-To: References: Date: Wed, 8 Jun 2011 09:13:35 -0700 Message-ID: Subject: Re: re-reading From: Mark question To: common-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=90e6ba53aa1c56274404a5359e43 X-Virus-Checked: Checked by ClamAV on apache.org --90e6ba53aa1c56274404a5359e43 Content-Type: text/plain; charset=ISO-8859-1 Thanks for the replies, but input doesn't have 'clone' I don't know why ... so I'll have to write my custom inputFormat ... I was hoping for an easier way though. Thank you, Mark On Wed, Jun 8, 2011 at 1:58 AM, Harsh J wrote: > Or if that does not work for any reason (haven't tried it really), try > writing your own InputFormat wrapper where in you can have direct > access to the InputSplit object to do what you want to (open two > record readers, and manage them separately). > > On Wed, Jun 8, 2011 at 1:48 PM, Stefan Wienert wrote: > > Try input.clone()... > > > > 2011/6/8 Mark question : > >> Hi, > >> > >> I'm trying to read the inputSplit over and over using following > function > >> in MapperRunner: > >> > >> @Override > >> public void run(RecordReader input, OutputCollector output, Reporter > >> reporter) throws IOException { > >> > >> RecordReader copyInput = input; > >> > >> //First read > >> while(input.next(key,value)); > >> > >> //Second read > >> while(copyInput.next(key,value)); > >> } > >> > >> It can clearly be seen that this won't work because both RecordReaders > are > >> actually the same. I'm trying to find a way for the second reader to > start > >> reading the split again from beginning ... How can I do that? > >> > >> Thanks, > >> Mark > >> > > > > > > > > -- > > Stefan Wienert > > > > http://www.wienert.cc > > stefan@wienert.cc > > > > Telefon: +495251-2026838 > > Mobil: +49176-40170270 > > > > > > -- > Harsh J > --90e6ba53aa1c56274404a5359e43--