mrunit-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Wheeler <>
Subject Re: How to set number of reduce tasks in MRUnit's mocked context object
Date Wed, 28 Nov 2012 23:32:27 GMT
Hi Dipesh,

I haven't looked at that part of the code, but based on my
understanding of MRUnit, it doesn't (generally) make sense to have
multiple reduce tasks in a unit test.  If your goal is to test a
custom partitioner, then I know that's not yet supported (MRUNIT-128).

You could maybe make the case that in a unit test you should be able
to set an arbitrary value in the configuration object and then be able
to to retrieve that using the corresponding get method.  Maybe you
could clarify what you want to accomplish by setting the number of
reduce tasks.

Tom Wheeler

On Wed, Nov 28, 2012 at 5:11 PM, Dipesh Khakhkhar
<> wrote:
> When I am running a reducer test - then this method should return 1 without
> requiring any further mocking. Correct? Same is true for Mapper (I have not
> tried it though).
> Will it require an enhancement in the framework or it can be done
> externally.
> Thanks.
> On Wed, Nov 28, 2012 at 2:59 PM, Dipesh Khakhkhar <>
> wrote:
>> I'm calling getNumReduceTasks() method in my reducer and in my MRUnit
>> test, framework has created a mock context object but when I call
>> getNumReduceTasks it is returning 0.
>> I have tried setting it to Configuration object too but it didn't help.
>> How can i set getNumReduceTasks() to return a desired number here?
>> Thanks.

View raw message