hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen O'Malley <o...@yahoo-inc.com>
Subject Re: how to implement RecordReader.createValue()
Date Sat, 28 Oct 2006 16:30:05 GMT

On Oct 28, 2006, at 8:55 AM, Grant Ingersoll wrote:

> My understanding is that you just construct a new instance of the  
> Writable that you want as the value, which later gets passed to the  
> next method.  For instance, just construct, a new Text() object or  
> something.

Yes, the intent is to have the RecordReader to create an instance of  
the value type that it wants to read into. Look at the  
SequenceFileRecordReader. Basically the framework is going to do:

WrtiableComparable key = recordReader.createKey();
Writable value = recordReader.createValue();
while (recordReader.next(key, value)) {
   mapper.map(key, value, collector, reporter);
}

look at MapRunner.java.

-- Owen

Mime
View raw message