Sfoglia il codice sorgente

HDFS-5003. TestNNThroughputBenchmark failed caused by existing directories. Contributed by Xi Fang.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1504356 13f79535-47bb-0310-9956-ffa450edef68
Chris Nauroth 12 anni fa
parent
commit
f8f6206e4a

+ 3 - 0
CHANGES.txt

@@ -83,6 +83,9 @@ Release 1.3.0 - unreleased
     HDFS-4521.  Invalid Network Topologies should not be cached.
     (Backported by Junping Du, reviewed by Colin Patrick McCabe.)
 
+    HDFS-5003. TestNNThroughputBenchmark failed caused by existing directories.
+    (Xi Fang via cnauroth)
+
 Release 1.2.1 - 2013.07.06
 
   INCOMPATIBLE CHANGES

+ 1 - 1
src/test/org/apache/hadoop/hdfs/server/namenode/NNThroughputBenchmark.java

@@ -102,7 +102,7 @@ public class NNThroughputBenchmark {
     config.set("dfs.hosts.exclude", "${hadoop.tmp.dir}/dfs/hosts/exclude");
     File excludeFile = new File(config.get("dfs.hosts.exclude", "exclude"));
     if(! excludeFile.exists()) {
-      if(!excludeFile.getParentFile().mkdirs())
+      if(!excludeFile.getParentFile().exists() && !excludeFile.getParentFile().mkdirs())
         throw new IOException("NNThroughputBenchmark: cannot mkdir " + excludeFile);
     }
     new FileOutputStream(excludeFile).close();