hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TKDD <myt...@gmail.com>
Subject Re: how to implement RecordReader.createValue()
Date Sun, 29 Oct 2006 10:16:03 GMT
Thank you, my friends,

it really helps


- TKDD


Owen O'Malley wrote:
>
> 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