hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1125879 - in /hadoop/hdfs/trunk: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java src/java/org/apache/hadoop/hdfs/server/namenode/NameNodeResourceChecker.java
Date Sun, 22 May 2011 08:16:38 GMT
Author: eli
Date: Sun May 22 08:16:38 2011
New Revision: 1125879

URL: http://svn.apache.org/viewvc?rev=1125879&view=rev
Log:
HDFS-1959. Better error message for missing namenode directory. Contributed by Eli Collins

Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NameNodeResourceChecker.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=1125879&r1=1125878&r2=1125879&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Sun May 22 08:16:38 2011
@@ -448,6 +448,8 @@ Trunk (unreleased changes)
     HDFS-1877.  Add a new test for concurrent read and write.  (CW Chung
     via szetszwo)
 
+    HDFS-1959. Better error message for missing namenode directory. (eli)
+
   OPTIMIZATIONS
 
     HDFS-1458. Improve checkpoint performance by avoiding unnecessary image

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java?rev=1125879&r1=1125878&r2=1125879&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java Sun
May 22 08:16:38 2011
@@ -595,7 +595,9 @@ public class FSNamesystem implements FSC
           lmthread.interrupt();
           lmthread.join(3000);
         }
-        dir.close();
+        if (dir != null) {
+          dir.close();
+        }
       } catch (InterruptedException ie) {
       } catch (IOException ie) {
         LOG.error("Error closing FSDirectory", ie);

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NameNodeResourceChecker.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NameNodeResourceChecker.java?rev=1125879&r1=1125878&r2=1125879&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NameNodeResourceChecker.java
(original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NameNodeResourceChecker.java
Sun May 22 08:16:38 2011
@@ -81,7 +81,11 @@ public class NameNodeResourceChecker {
   private void addDirsToCheck(Collection<URI> directoriesToCheck)
       throws IOException {
     for (URI directoryUri : directoriesToCheck) {
-      DF df = new DF(new File(directoryUri.getPath()), conf);
+      File dir = new File(directoryUri.getPath());
+      if (!dir.exists()) {
+        throw new IOException("Missing directory "+dir.getAbsolutePath());
+      }
+      DF df = new DF(dir, conf);
       volumes.put(df.getFilesystem(), df);
     }
   }



Mime
View raw message