where is hadoop-test.jar in Hadoop2?

2019-09-06 08:40发布

问题:

I want to use testmapredsort for benchmarking sort in Hadoop. I am NOT using TeraSort now.

hadoop-*test*.jar is supposed to contain the testmapredsort class. But I do not see hadoop-*test*.jar in Hadoop2.

hadoop jar hadoop/share/hadoop/common/hadoop-common-2.2.0-tests.jar testmapredsort /data/unsorted-data -sortOutput /data/sorted-data

回答1:

In Hadoop 1, testmapredsort is launched from AllTestDriver.java, which was indeed in e.g. hadoop-test-1.2.1.jar. In Hadoop 2, it's now in MapredTestDriver.java, which can be found inside of hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.2.0-tests.jar

hadoop jar hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.2.0-tests.jar testmapredsort -sortInput /data/unsorted-data -sortOutput /data/sorted-data