hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r390498 - in /lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs: FSDirectory.java NameNode.java
Date Fri, 31 Mar 2006 20:54:24 GMT
Author: cutting
Date: Fri Mar 31 12:54:20 2006
New Revision: 390498

URL: http://svn.apache.org/viewcvs?rev=390498&view=rev
Log:
DFS re-format should fully delete old namenode data.

Modified:
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDirectory.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDirectory.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDirectory.java?rev=390498&r1=390497&r2=390498&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDirectory.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/FSDirectory.java Fri Mar 31 12:54:20
2006
@@ -20,6 +20,9 @@
 import java.io.*;
 import java.util.*;
 
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileUtil;
+
 /*************************************************
  * FSDirectory stores the filesystem directory state.
  * It handles writing/loading values to disk, and logging
@@ -265,13 +268,15 @@
 
     /** Create a new dfs name directory.  Caution: this destroys all files
      * in this filesystem. */
-    public static void format(File dir) throws IOException {
+    public static void format(File dir, Configuration conf)
+      throws IOException {
         File image = new File(dir, "image");
         File edits = new File(dir, "edits");
 
-        if (!((!image.exists() || image.delete()) &&
+        if (!((!image.exists() || FileUtil.fullyDelete(image, conf)) &&
               (!edits.exists() || edits.delete()) &&
               image.mkdirs())) {
+          
           throw new IOException("Unable to format: "+dir);
         }
     }

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java?rev=390498&r1=390497&r2=390498&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/NameNode.java Fri Mar 31 12:54:20 2006
@@ -68,7 +68,7 @@
     /** Format a new filesystem.  Destroys any filesystem that may already
      * exist at this location.  **/
     public static void format(Configuration conf) throws IOException {
-      FSDirectory.format(getDir(conf));
+      FSDirectory.format(getDir(conf), conf);
     }
 
     /**



Mime
View raw message