You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ha...@apache.org on 2016/04/21 14:24:00 UTC
hadoop git commit: MAPREDUCE-2398. MRBench: setting the baseDir
parameter has no effect. Contributed by Michael Noll and Wilfred
Spiegelenburg.
Repository: hadoop
Updated Branches:
refs/heads/trunk 170c4fd4c -> 7da5847cf
MAPREDUCE-2398. MRBench: setting the baseDir parameter has no effect. Contributed by Michael Noll and Wilfred Spiegelenburg.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7da5847c
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7da5847c
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7da5847c
Branch: refs/heads/trunk
Commit: 7da5847cf10bc61f2131d578f16ee37cb32c4639
Parents: 170c4fd
Author: Harsh J <ha...@cloudera.com>
Authored: Thu Apr 21 17:33:22 2016 +0530
Committer: Harsh J <ha...@cloudera.com>
Committed: Thu Apr 21 17:53:51 2016 +0530
----------------------------------------------------------------------
.../java/org/apache/hadoop/mapred/MRBench.java | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/7da5847c/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MRBench.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MRBench.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MRBench.java
index 20d27fb..079fad7 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MRBench.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/MRBench.java
@@ -41,10 +41,13 @@ import org.apache.hadoop.util.ToolRunner;
public class MRBench extends Configured implements Tool{
private static final Log LOG = LogFactory.getLog(MRBench.class);
+ private static final String DEFAULT_INPUT_SUB = "mr_input";
+ private static final String DEFAULT_OUTPUT_SUB = "mr_output";
+
private static Path BASE_DIR =
new Path(System.getProperty("test.build.data","/benchmarks/MRBench"));
- private static Path INPUT_DIR = new Path(BASE_DIR, "mr_input");
- private static Path OUTPUT_DIR = new Path(BASE_DIR, "mr_output");
+ private static Path INPUT_DIR = new Path(BASE_DIR, DEFAULT_INPUT_SUB);
+ private static Path OUTPUT_DIR = new Path(BASE_DIR, DEFAULT_OUTPUT_SUB);
public static enum Order {RANDOM, ASCENDING, DESCENDING};
@@ -243,6 +246,8 @@ public class MRBench extends Configured implements Tool{
numRuns = Integer.parseInt(args[++i]);
} else if (args[i].equals("-baseDir")) {
BASE_DIR = new Path(args[++i]);
+ INPUT_DIR = new Path(BASE_DIR, DEFAULT_INPUT_SUB);
+ OUTPUT_DIR = new Path(BASE_DIR, DEFAULT_OUTPUT_SUB);
} else if (args[i].equals("-maps")) {
numMaps = Integer.parseInt(args[++i]);
} else if (args[i].equals("-reduces")) {
@@ -283,14 +288,15 @@ public class MRBench extends Configured implements Tool{
Path inputFile = new Path(INPUT_DIR, "input_" + (new Random()).nextInt() + ".txt");
generateTextFile(fs, inputFile, inputLines, inputSortOrder);
- // setup test output directory
- fs.mkdirs(BASE_DIR);
ArrayList<Long> execTimes = new ArrayList<Long>();
try {
execTimes = runJobInSequence(jobConf, numRuns);
} finally {
- // delete output -- should we really do this?
- fs.delete(BASE_DIR, true);
+ // delete all generated data -- should we really do this?
+ // we don't know how much of the path was created for the run but this
+ // cleans up as much as we can
+ fs.delete(OUTPUT_DIR, true);
+ fs.delete(INPUT_DIR, true);
}
if (verbose) {