mrunit的继任者是什么? [英] What's the successor of mrunit?
问题描述
今天我发现ASF退役的mrunit(请参阅 https://blogs.apache.org/foundation/entry/ the_apache_news_round_up85 和 https://issues.apache.org/jira/browse/HADOOP-3733和主页)。除了闲置之外,没有理由给出,所以我想应该有一个替代方案?
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?
应该用什么来代替mrunit来在未来对mapreduce作业进行单元测试?
What's supposed to be used instead of mrunit to unit test mapreduce jobs in the future?
推荐答案
我相信退休的原因是Mockito已经可以处理你需要的单元测试你的mapper / redurs。您只需要模拟Context,Counter和HBase KeyValue,然后您可以将一行(以Result对象的形式)传递给映射器,并检查发射的键/值是否正确。
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.
仅供参考 - 实际上,我没有使用MRUnit和PowerMock提供的任何帮助,使用此方法可以完美地完成MR单元测试。
FYI - I actually got my MR unit tests working perfectly using this approach without any assistance from MRUnit and PowerMock.
这篇关于mrunit的继任者是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!