Преглед на файлове

HADOOP-242. Improved error message when unable to create a local file. Contributed by Owen.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@410399 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting преди 19 години
родител
ревизия
5bdda7743e
променени са 1 файла, в които са добавени 7 реда и са изтрити 1 реда
  1. 7 1
      src/java/org/apache/hadoop/conf/Configuration.java

+ 7 - 1
src/java/org/apache/hadoop/conf/Configuration.java

@@ -286,10 +286,16 @@ public class Configuration {
       int index = (hashCode+i & Integer.MAX_VALUE) % dirs.length;
       Path file = new Path(dirs[index], path);
       Path dir = file.getParent();
-      if (fs.exists(dir) || fs.mkdirs(dir)) {
+      if (fs.mkdirs(dir) || fs.exists(dir)) {
         return file;
       }
     }
+    LOG.warning("Could not make " + path + 
+                " in local directories from " + dirsProp);
+    for(int i=0; i < dirs.length; i++) {
+      int index = (hashCode+i & Integer.MAX_VALUE) % dirs.length;
+      LOG.warning(dirsProp + "[" + index + "]=" + dirs[index]);
+    }
     throw new IOException("No valid local directories in property: "+dirsProp);
   }