Sfoglia il codice sorgente

svn merge -c 1373581 FIXES: HADOOP-8703. distcpV2: turn CRC checking off for 0 byte size (Dave Thompson via bobby)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1373585 13f79535-47bb-0310-9956-ffa450edef68
Robert Joseph Evans 12 anni fa
parent
commit
00712ab983

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -721,6 +721,9 @@ Release 0.23.3 - UNRELEASED
     HADOOP-8633. Interrupted FsShell copies may leave tmp files (Daryn Sharp
     via tgraves)
 
+    HADOOP-8703. distcpV2: turn CRC checking off for 0 byte size (Dave
+    Thompson via bobby)
+
 Release 0.23.2 - UNRELEASED 
 
   NEW FEATURES

+ 3 - 1
hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/RetriableFileCopyCommand.java

@@ -91,7 +91,9 @@ public class RetriableFileCopyCommand extends RetriableCommand {
                                      context, fileAttributes);
 
       compareFileLengths(sourceFileStatus, tmpTargetPath, configuration, bytesRead);
-      compareCheckSums(sourceFS, sourceFileStatus.getPath(), targetFS, tmpTargetPath);
+      //At this point, src&dest lengths are same. if length==0, we skip checksum
+      if (bytesRead != 0) 
+          compareCheckSums(sourceFS, sourceFileStatus.getPath(), targetFS, tmpTargetPath);
       promoteTmpToTarget(tmpTargetPath, target, targetFS);
       return bytesRead;