Skip to content

Commit d23f13b

Browse files
committed
HADOOP-18596. javadocs and correct return
1 parent ee9a856 commit d23f13b

File tree

1 file changed

+3
-2
lines changed
  • hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred

1 file changed

+3
-2
lines changed

hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/CopyMapper.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,9 @@ private boolean canSkip(FileSystem sourceFS, CopyListingFileStatus source,
357357
boolean sameLength = target.getLen() == source.getLen();
358358
boolean sameBlockSize = source.getBlockSize() == target.getBlockSize()
359359
|| !preserve.contains(FileAttribute.BLOCKSIZE);
360-
if (source.getLen() == 0) {
361-
return false;
360+
// Skip the copy if a 0 size file is being copied.
361+
if (sameLength && source.getLen() == 0) {
362+
return true;
362363
}
363364
// if both the source and target have the same length, then check if the
364365
// config to use modification time is set to true, then use the

0 commit comments

Comments
 (0)