hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r767645 - in /hadoop/core/branches/branch-0.19: CHANGES.txt src/tools/org/apache/hadoop/tools/DistCp.java
Date Wed, 22 Apr 2009 20:08:05 GMT
Author: cdouglas
Date: Wed Apr 22 20:08:05 2009
New Revision: 767645

URL: http://svn.apache.org/viewvc?rev=767645&view=rev
Log:
HADOOP-5671. Fix FNF exceptions when copying from old versions of HftpFileSystem. Contributed
by Tsz Wo (Nicholas), SZE

Modified:
    hadoop/core/branches/branch-0.19/CHANGES.txt
    hadoop/core/branches/branch-0.19/src/tools/org/apache/hadoop/tools/DistCp.java

Modified: hadoop/core/branches/branch-0.19/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/CHANGES.txt?rev=767645&r1=767644&r2=767645&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.19/CHANGES.txt Wed Apr 22 20:08:05 2009
@@ -101,6 +101,9 @@
     HADOOP-5551. Prevent directory destruction on file create.
     (Brian Bockelman via shv)
 
+    HADOOP-5671. Fix FNF exceptions when copying from old versions of
+    HftpFileSystem. (Tsz Wo (Nicholas), SZE via cdouglas)
+
 Release 0.19.1 - 2009-02-23 
 
     HADOOP-5225. Workaround for tmp file handling in HDFS. sync() is 

Modified: hadoop/core/branches/branch-0.19/src/tools/org/apache/hadoop/tools/DistCp.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/src/tools/org/apache/hadoop/tools/DistCp.java?rev=767645&r1=767644&r2=767645&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/src/tools/org/apache/hadoop/tools/DistCp.java (original)
+++ hadoop/core/branches/branch-0.19/src/tools/org/apache/hadoop/tools/DistCp.java Wed Apr
22 20:08:05 2009
@@ -1161,9 +1161,25 @@
       return false;
     }
 
+    //get src checksum
+    final FileChecksum srccs;
+    try {
+      srccs = srcfs.getFileChecksum(srcstatus.getPath());
+    } catch(FileNotFoundException fnfe) {
+      /*
+       * Two possible cases:
+       * (1) src existed once but was deleted between the time period that
+       *     srcstatus was obtained and the try block above.
+       * (2) srcfs does not support file checksum and (incorrectly) throws
+       *     FNFE, e.g. some previous versions of HftpFileSystem.
+       * For case (1), it is okay to return true since src was already deleted.
+       * For case (2), true should be returned.  
+       */
+      return true;
+    }
+
     //compare checksums
     try {
-      final FileChecksum srccs = srcfs.getFileChecksum(srcstatus.getPath());
       final FileChecksum dstcs = dstfs.getFileChecksum(dststatus.getPath());
       //return true if checksum is not supported
       //(i.e. some of the checksums is null)



Mime
View raw message