From a5cd4b9beeec73996eac95b952e1295bf2eefa9e Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Thu, 18 Jul 2013 03:28:19 +0000 Subject: [PATCH] HDFS-5003. TestNNThroughputBenchmark failed caused by existing directories. Contributed by Xi Fang. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1504352 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../hadoop/hdfs/server/namenode/NNThroughputBenchmark.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 2a71e2096b..f7d4958840 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -679,6 +679,9 @@ Release 2.1.0-beta - 2013-07-02 HDFS-4980. Incorrect logging.properties file for hadoop-httpfs. (Mark Grover via suresh) + HDFS-5003. TestNNThroughputBenchmark failed caused by existing directories. + (Xi Fang via cnauroth) + BREAKDOWN OF HDFS-347 SUBTASKS AND RELATED JIRAS HDFS-4353. Encapsulate connections to peers in Peer and PeerServer classes. diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/NNThroughputBenchmark.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/NNThroughputBenchmark.java index 8059287ffb..77f8560816 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/NNThroughputBenchmark.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/NNThroughputBenchmark.java @@ -121,7 +121,7 @@ public class NNThroughputBenchmark { File excludeFile = new File(config.get(DFSConfigKeys.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();