hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1291126 - in /hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs: CHANGES.HDFS-1623.txt src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
Date Mon, 20 Feb 2012 04:12:02 GMT
Author: atm
Date: Mon Feb 20 04:12:01 2012
New Revision: 1291126

URL: http://svn.apache.org/viewvc?rev=1291126&view=rev
Log:
HDFS-2974. MiniDFSCluster does not delete standby NN name dirs during format. Contributed
by Aaron T. Myers.

Modified:
    hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
    hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java
    hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java

Modified: hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt?rev=1291126&r1=1291125&r2=1291126&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
Mon Feb 20 04:12:01 2012
@@ -218,3 +218,5 @@ HDFS-2937. TestDFSHAAdmin needs tests wi
 HDFS-2586. Add protobuf service and implementation for HAServiceProtocol. (suresh via atm)
 
 HDFS-2952. NN should not start with upgrade option or with a pending an unfinalized upgrade.
(atm)
+
+HDFS-2974. MiniDFSCluster does not delete standby NN name dirs during format. (atm)

Modified: hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java?rev=1291126&r1=1291125&r2=1291126&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java
Mon Feb 20 04:12:01 2012
@@ -626,6 +626,15 @@ public class MiniDFSCluster {
       for (NNConf nn : nameservice.getNNs()) {
         initNameNodeConf(conf, nsId, nn.getNnId(), manageNameDfsDirs,
             nnCounterForFormat);
+        Collection<URI> namespaceDirs = FSNamesystem.getNamespaceDirs(conf);
+        if (format) {
+          for (URI nameDirUri : namespaceDirs) {
+            File nameDir = new File(nameDirUri);
+            if (nameDir.exists() && !FileUtil.fullyDelete(nameDir)) {
+              throw new IOException("Could not fully delete " + nameDir);
+            }
+          }
+        }
         
         boolean formatThisOne = format;
         if (format && i++ > 0) {
@@ -635,14 +644,14 @@ public class MiniDFSCluster {
           // from the first one.
           formatThisOne = false;
           assert (null != prevNNDirs);
-          copyNameDirs(prevNNDirs, FSNamesystem.getNamespaceDirs(conf), conf);
+          copyNameDirs(prevNNDirs, namespaceDirs, conf);
         }
         
         nnCounterForFormat++;
         if (formatThisOne) {
           DFSTestUtil.formatNameNode(conf);
         }
-        prevNNDirs = FSNamesystem.getNamespaceDirs(conf);
+        prevNNDirs = namespaceDirs;
       }
 
       // Start all Namenodes

Modified: hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java?rev=1291126&r1=1291125&r2=1291126&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
Mon Feb 20 04:12:01 2012
@@ -655,6 +655,7 @@ public class TestCheckpoint extends Test
     sdToLock.lock();
     try {      
       MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf)
+        .format(false)
         .manageNameDfsDirs(false)
         .numDataNodes(0)
         .build();



Mime
View raw message