What's the successor of mrunit?

谁都会走 提交于 2019-12-03 03:51:41

问题


Today I found out that the ASF retired mrunit (see https://blogs.apache.org/foundation/entry/the_apache_news_round_up85 and https://issues.apache.org/jira/browse/HADOOP-3733 and the homepage itself). Other than "inactivity" there was no reason given, so I guess there has to be an alternative?

What's supposed to be used instead of mrunit to unit test mapreduce jobs in the future?


回答1:


I believe the reason for this retirement is the realization that Mockito already can handle what you need to unit test your mapper/reducers. All you need is to mock your Context, Counter and HBase KeyValue and you can then pass in a row (in the form of the Result object) to a mapper and check if the key/value emitted is correct.

FYI - I actually got my MR unit tests working perfectly using this approach without any assistance from MRUnit and PowerMock.




回答2:


Not exactly a successor, but I tried and tested a work-around with a bit of research. It is actually based on the Minicluster module of hadoop.

To find out how to use it, details can be found in this link here. And a github demo project exists here.



来源:https://stackoverflow.com/questions/37288176/whats-the-successor-of-mrunit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!