[ 
https://issues.apache.org/jira/browse/MRUNIT-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13509810#comment-13509810
 ] 

Yoni Ben-Meshulam commented on MRUNIT-165:
------------------------------------------

Awesome. Thanks Dave.
                
> MapReduceDriver calls Mapper#cleanup for each input instead of once
> -------------------------------------------------------------------
>
>                 Key: MRUNIT-165
>                 URL: https://issues.apache.org/jira/browse/MRUNIT-165
>             Project: MRUnit
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Yoni Ben-Meshulam
>            Assignee: Dave Beech
>             Fix For: 1.0.0
>
>         Attachments: reproduce_MRUNIT-165.patch
>
>
> MapReduceDriver calls the Mapper#run method for each input, causing the 
> Mapper#cleanup method to be called multiple times. 
> I believe this is a bug, since the contract in MapReduce is that, for a 
> single Mapper instance, the Mapper#cleanup method is only called once after 
> all inputs to that mapper have been processed. I might be mistaken in my 
> assumption here.
> This would not be an issue, were it not for the fact that MapReduceDriver has 
> only a single instance of Mapper.
> One solution might be to pass the Mapper _class_ into the MapReduceDriver and 
> create a new instance for each input. Another solution might be to call the 
> MapDriver with multiple inputs (which AFAIK is not possible).
> See attached patch for an example of a stateful mapper and a test which fails 
> due to the bug.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to