Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the successor of mrunit?

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?

like image 924
David Ongaro Avatar asked May 18 '16 00:05

David Ongaro


People also ask

What statements do MRUnit describe?

What statements do MRUnit describe? It allows you to trace and debug code using the JUnit test case as a driver. It allows you to trace and debug code using the JU nit test case as a driver .

What is MR Unit in MapReduce?

MRUnit is a JUnit-based Java library that allows us to unit test Hadoop MapReduce programs. This makes it easy to develop as well as to maintain Hadoop MapReduce code bases. MRUnit supports testing Mappers and Reducers separately as well as testing MapReduce computations as a whole.


2 Answers

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.

like image 184
SriK Avatar answered Oct 23 '22 15:10

SriK


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.

like image 3
Saif Asif Avatar answered Oct 23 '22 14:10

Saif Asif