You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Phantom <gh...@gmail.com> on 2007/07/13 19:50:05 UTC
Initializing Mapper classes
Is there a way to initialize Mapper classes based on some args passed
through the command line ? Ideally I would like to do conf.setMapperClass(
Mapper.class ) which I am assuming ultimately creates an instance of this
class by invoking the default ctor ? But is it possible to initialize some
member variables in the Mapper class ?
Thanks
A
RE: Initializing Mapper classes
Posted by "Mahajan, Neeraj" <ne...@ebay.com>.
You can do conf.set(<param>, <value>) when you create the conf before
submitting the job. In the mapper class' configure() method you can
fetch the params by job.get(<param>). The configure method is called to
initialize a new instance of the mapper/reducer.
~ Neeraj
-----Original Message-----
From: Phantom [mailto:ghostwhoowalks@gmail.com]
Sent: Friday, July 13, 2007 10:50 AM
To: hadoop-user@lucene.apache.org
Subject: Initializing Mapper classes
Is there a way to initialize Mapper classes based on some args passed
through the command line ? Ideally I would like to do
conf.setMapperClass( Mapper.class ) which I am assuming ultimately
creates an instance of this class by invoking the default ctor ? But is
it possible to initialize some member variables in the Mapper class ?
Thanks
A