浏览代码

HADOOP-3401. Update FileBench to set the new "mapred.work.output.dir"
property to work post-3041. Contributed by Chris Douglas.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@661386 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 17 年之前
父节点
当前提交
5bec74a718
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 3 0
      CHANGES.txt
  2. 4 1
      src/test/org/apache/hadoop/io/FileBench.java

+ 3 - 0
CHANGES.txt

@@ -348,6 +348,9 @@ Trunk (unreleased changes)
     HADOOP-3451. Update libhdfs to use FileSystem::getFileBlockLocations
     HADOOP-3451. Update libhdfs to use FileSystem::getFileBlockLocations
     instead of removed getFileCacheHints. (lohit vijayarenu via cdouglas)
     instead of removed getFileCacheHints. (lohit vijayarenu via cdouglas)
 
 
+    HADOOP-3401. Update FileBench to set the new
+    "mapred.work.output.dir" property to work post-3041. (cdouglas via omalley)
+ 
 Release 0.17.0 - 2008-05-18
 Release 0.17.0 - 2008-05-18
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 4 - 1
src/test/org/apache/hadoop/io/FileBench.java

@@ -108,6 +108,7 @@ public class FileBench extends Configured implements Tool {
 
 
     final String fn = conf.get("test.filebench.name", "");
     final String fn = conf.get("test.filebench.name", "");
     final Path outd = FileOutputFormat.getOutputPath(conf);
     final Path outd = FileOutputFormat.getOutputPath(conf);
+    conf.set("mapred.work.output.dir", outd.toString());
     OutputFormat outf = conf.getOutputFormat();
     OutputFormat outf = conf.getOutputFormat();
     RecordWriter<Text,Text> rw =
     RecordWriter<Text,Text> rw =
       outf.getRecordWriter(outd.getFileSystem(conf), conf, fn,
       outf.getRecordWriter(outd.getFileSystem(conf), conf, fn,
@@ -191,7 +192,9 @@ public class FileBench extends Configured implements Tool {
       }
       }
     }
     }
     if (null == root) {
     if (null == root) {
-      throw new IOException("Missing -dir param");
+      System.out.println("Missing -dir param");
+      printUsage();
+      return -1;
     }
     }
 
 
     fillBlocks(job);
     fillBlocks(job);