hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From juber patel <juberpa...@gmail.com>
Subject Re: Reading File in constructor of Mapper
Date Mon, 26 Jul 2010 10:04:40 GMT
Wouldn't the configure() method of Mapper be the place to do this kind
of setup? There you have access to JobConf, through which you can pass
the file path, instead of entire data.

In the new API, this method is called setup()


Juber


On Sun, Jul 25, 2010 at 1:40 PM, Benjamin Hiller
<Benjamin.Hiller@urz.uni-heidelberg.de> wrote:
> Nevermind, I passed only the path, without the actual file to the reader...
>
> Ben
>
> ----- Original Message ----- From: "Benjamin Hiller"
> <Benjamin.Hiller@urz.uni-heidelberg.de>
> To: <mapreduce-user@hadoop.apache.org>
> Sent: Sunday, July 25, 2010 7:31 PM
> Subject: Re: Reading File in constructor of Mapper
>
>
>> Thanks for the quick reply!
>> It seems to work, although I get an
>> java.io.FileNotFoundException: J:\OSMMap\Graphoutput (Zugriff verweigert)
>>
>> which means "Access denied", when Job2 is trying to read the file Job1
>> created. This is probably unrelated to hadoop and some problem with Windows,
>> but nevertheless, any thoughts on that? (Job1 is done at that moment.)
>> Anyway, thanks for your help!
>>
>> Ben
>>
>> ----- Original Message ----- From: "Owen O'Malley" <omalley@apache.org>
>> To: <mapreduce-user@hadoop.apache.org>
>> Sent: Sunday, July 25, 2010 5:47 PM
>> Subject: Re: Reading File in constructor of Mapper
>>
>>
>>> Usually, you'd do that kind of processing in the setConf method of the
>>> Mapper (assuming you mark it Configurable). That will let you get the
>>> configuration which can contain the location of the file to read.
>>>
>>> -- Owen
>>>
>>
>>
>
>

Mime
View raw message