hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r538679 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/util/CopyFiles.java
Date Wed, 16 May 2007 18:40:16 GMT
Author: cutting
Date: Wed May 16 11:40:15 2007
New Revision: 538679

URL: http://svn.apache.org/viewvc?view=rev&rev=538679
Log:
HADOOP-1357.  Fix CopyFiles to correctly avoid removing /.  Contributed by Arun.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=538679&r1=538678&r2=538679
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Wed May 16 11:40:15 2007
@@ -21,6 +21,9 @@
   6. HADOOP-1355.  Fix null pointer dereference in 
      TaskLogAppender.append(LoggingEvent).  (Arun C Murthy via tomwhite.)
 
+  7. HADOOP-1357.  Fix CopyFiles to correctly avoid removing "/".
+     (Arun C Murthy via cutting)
+
 
 Branch 0.13 (unreleased changes)
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java?view=diff&rev=538679&r1=538678&r2=538679
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/util/CopyFiles.java Wed May 16 11:40:15
2007
@@ -40,6 +40,7 @@
 import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.FileUtil;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.SequenceFile;
 import org.apache.hadoop.io.Text;
@@ -366,8 +367,8 @@
       Path jobDirectory = new Path(jobConf.get("distcp.job.dir", "/"));
       FileSystem fs = FileSystem.get(jobConf);
       
-      if (!jobDirectory.equals("/")) {
-        fs.delete(jobDirectory);
+      if (!jobDirectory.equals(new Path("/"))) {
+        FileUtil.fullyDelete(fs, jobDirectory);
       }
     }
     
@@ -505,8 +506,8 @@
       Path jobDirectory = new Path(jobConf.get("distcp.job.dir", "/"));
       FileSystem fs = FileSystem.get(jobConf);
       
-      if (!jobDirectory.equals("/")) {
-        fs.delete(jobDirectory);
+      if (!jobDirectory.equals(new Path("/"))) {
+        FileUtil.fullyDelete(fs, jobDirectory);
       }
     }
     



Mime
View raw message