You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mrunit.apache.org by AnilKumar B <ak...@gmail.com> on 2012/11/06 11:51:54 UTC

Reg: MultipleOutputFormat

Hi,

May I know, how to write MRUnit for multipleOutputFormats?

Most of my jobs consists of multipleOutputFormats but I am unable get the
information on how to write unit test for them.

Thanks,
B Anil Kumar.

Re: Reg: MultipleOutputFormat

Posted by AnilKumar B <ak...@gmail.com>.
Thanks Tom.

As of now I am writing one MapMOFormatter, which stores the output into the
local hashmap.

And while in test case, I am configuring this MapMOFormatter as
outputFormatter instead of  MultipleOutputFormatter and the asserting
accordingly.

This will solve my purpose.

Thanks,
B Anil Kumar.

On Tue, Nov 6, 2012 at 8:35 PM, Tom Wheeler <tw...@cloudera.com> wrote:

> Just to follow up, there is a JIRA filed requesting support for
> MultipleOutputs (https://issues.apache.org/jira/browse/MRUNIT-13).
>
> On Tue, Nov 6, 2012 at 7:02 AM, Tom Wheeler <tw...@cloudera.com> wrote:
> > I'm 99% sure that MRUnit does not currently support
> > MultipleOutputFormat.  While I was unable to find a JIRA about this
> > feature specifically, it's mentioned in an unresolved JIRA
> > (https://issues.apache.org/jira/browse/MRUNIT-69) about future changes
> > to the API.
> >
> > In the meantime, I think you could test much of this using JUnit.
> > That is, you could have a test case that instantiates your class, then
> > passes in a key and value to methods like generateActualKey,
> > generateActualValue, generateFileNameForKeyValue, etc. followed by a
> > check to see if they return the value you expect.  If you need to
> > actually test the output itself, you'd probably need to use the
> > MiniDFSCluster and MiniMRCluster classes to simulate a small cluster
> > in a test case.
> >
> > On Tue, Nov 6, 2012 at 2:51 AM, AnilKumar B <ak...@gmail.com>
> wrote:
> >> Hi,
> >>
> >> May I know, how to write MRUnit for multipleOutputFormats?
> >>
> >> Most of my jobs consists of multipleOutputFormats but I am unable get
> the
> >> information on how to write unit test for them.
> >>
> >> Thanks,
> >> B Anil Kumar.
>

Re: Reg: MultipleOutputFormat

Posted by Tom Wheeler <tw...@cloudera.com>.
Just to follow up, there is a JIRA filed requesting support for
MultipleOutputs (https://issues.apache.org/jira/browse/MRUNIT-13).

On Tue, Nov 6, 2012 at 7:02 AM, Tom Wheeler <tw...@cloudera.com> wrote:
> I'm 99% sure that MRUnit does not currently support
> MultipleOutputFormat.  While I was unable to find a JIRA about this
> feature specifically, it's mentioned in an unresolved JIRA
> (https://issues.apache.org/jira/browse/MRUNIT-69) about future changes
> to the API.
>
> In the meantime, I think you could test much of this using JUnit.
> That is, you could have a test case that instantiates your class, then
> passes in a key and value to methods like generateActualKey,
> generateActualValue, generateFileNameForKeyValue, etc. followed by a
> check to see if they return the value you expect.  If you need to
> actually test the output itself, you'd probably need to use the
> MiniDFSCluster and MiniMRCluster classes to simulate a small cluster
> in a test case.
>
> On Tue, Nov 6, 2012 at 2:51 AM, AnilKumar B <ak...@gmail.com> wrote:
>> Hi,
>>
>> May I know, how to write MRUnit for multipleOutputFormats?
>>
>> Most of my jobs consists of multipleOutputFormats but I am unable get the
>> information on how to write unit test for them.
>>
>> Thanks,
>> B Anil Kumar.

Re: Reg: MultipleOutputFormat

Posted by Tom Wheeler <tw...@cloudera.com>.
I'm 99% sure that MRUnit does not currently support
MultipleOutputFormat.  While I was unable to find a JIRA about this
feature specifically, it's mentioned in an unresolved JIRA
(https://issues.apache.org/jira/browse/MRUNIT-69) about future changes
to the API.

In the meantime, I think you could test much of this using JUnit.
That is, you could have a test case that instantiates your class, then
passes in a key and value to methods like generateActualKey,
generateActualValue, generateFileNameForKeyValue, etc. followed by a
check to see if they return the value you expect.  If you need to
actually test the output itself, you'd probably need to use the
MiniDFSCluster and MiniMRCluster classes to simulate a small cluster
in a test case.

On Tue, Nov 6, 2012 at 2:51 AM, AnilKumar B <ak...@gmail.com> wrote:
> Hi,
>
> May I know, how to write MRUnit for multipleOutputFormats?
>
> Most of my jobs consists of multipleOutputFormats but I am unable get the
> information on how to write unit test for them.
>
> Thanks,
> B Anil Kumar.