hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1204119 - in /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
Date Sun, 20 Nov 2011 03:38:51 GMT
Author: eli
Date: Sun Nov 20 03:38:51 2011
New Revision: 1204119

URL: http://svn.apache.org/viewvc?rev=1204119&view=rev
Log:
HDFS-208. name node should warn if only one dir is listed in dfs.name.dir. Contributed by
Uma Maheswara Rao G

Modified:
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1204119&r1=1204118&r2=1204119&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Sun Nov 20 03:38:51 2011
@@ -121,6 +121,9 @@ Release 0.23.1 - UNRELEASED
 
     HDFS-2563. Some cleanup in BPOfferService. (todd)
 
+    HDFS-208. name node should warn if only one dir is listed in dfs.name.dir.
+    (Uma Maheswara Rao G via eli)
+
   OPTIMIZATIONS
 
     HDFS-2130. Switch default checksum to CRC32C. (todd)

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java?rev=1204119&r1=1204118&r2=1204119&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
Sun Nov 20 03:38:51 2011
@@ -306,7 +306,20 @@ public class FSNamesystem implements Nam
    * @throws IOException if loading fails
    */
   public static FSNamesystem loadFromDisk(Configuration conf) throws IOException {
-    FSImage fsImage = new FSImage(conf);
+    Collection<URI> namespaceDirs = FSNamesystem.getNamespaceDirs(conf);
+    Collection<URI> namespaceEditsDirs = 
+      FSNamesystem.getNamespaceEditsDirs(conf);
+
+    if (namespaceDirs.size() == 1) {
+      LOG.warn("Only one " + DFS_NAMENODE_NAME_DIR_KEY
+          + " directory configured , beware data loss!");
+    }
+    if (namespaceEditsDirs.size() == 1) {
+      LOG.warn("Only one " + DFS_NAMENODE_EDITS_DIR_KEY
+          + " directory configured , beware data loss!");
+    }
+
+    FSImage fsImage = new FSImage(conf, namespaceDirs, namespaceEditsDirs);
     FSNamesystem namesystem = new FSNamesystem(conf, fsImage);
 
     long loadStart = now();



Mime
View raw message