hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Kimball <aa...@cloudera.com>
Subject Re: mrunit question
Date Thu, 12 Aug 2010 00:14:45 GMT

Since you are directly instantiating the Mapper and Reducer (not using
ReflectionUtils), you are free to call setConf() yourself before you run the

If you're using the old API (o.a.h.mrunit):

Mapper m = new Mapper();
MapDriver d = new MapDriver(m);
Configuration conf = new Configuration();
conf.set("foo", "bar");
d.withInput(k, v).withOutput(k2, v2).runTest();

If you're using the new API, there already is setConfiguration() and
withConfiguration(), which will set the Configuration being passed into
Context sent to your Mapper/Reducer's run() method.
See https://issues.apache.org/jira/browse/mapreduce-1569 where this was

- Aaron

On Tue, Aug 10, 2010 at 7:44 PM, David Rosenstrauch <darose@darose.net>wrote:

> On 08/10/2010 04:54 PM, David Rosenstrauch wrote:
>> On 08/10/2010 04:24 PM, David Rosenstrauch wrote:
>>> What I'm looking for is a way to initialize the reducer using a
>>> particular Configuration object, which contains the parms/properties
>>> that the reducer needs. I looked at the ReduceDriver class, however, and
>>> there doesn't seem to be any way to do that.
>> Obvious way to solve thi issue would be an enhancement to ReduceDriver
>> to add setConfiguration/withConfiguration methods. (Along with a similar
>> enhancement to the other drivers.) This sound useful to anyone else?
>> Thanks,
>> DR
> FYI - I've filed a bug report on this:
> https://issues.apache.org/jira/browse/MAPREDUCE-2002
> Thanks,
> DR

View raw message