HADOOP-13496. Include file lengths in Mismatch in length error for distcp. Contributed by Ted Yu
(cherry picked from commit 77401bd5fc
)
This commit is contained in:
parent
c6c29d0080
commit
b2704702f9
|
@ -189,9 +189,10 @@ public class RetriableFileCopyCommand extends RetriableCommand {
|
||||||
throws IOException {
|
throws IOException {
|
||||||
final Path sourcePath = sourceFileStatus.getPath();
|
final Path sourcePath = sourceFileStatus.getPath();
|
||||||
FileSystem fs = sourcePath.getFileSystem(configuration);
|
FileSystem fs = sourcePath.getFileSystem(configuration);
|
||||||
if (fs.getFileStatus(sourcePath).getLen() != targetLen)
|
long srcLen = fs.getFileStatus(sourcePath).getLen();
|
||||||
throw new IOException("Mismatch in length of source:" + sourcePath
|
if (srcLen != targetLen)
|
||||||
+ " and target:" + target);
|
throw new IOException("Mismatch in length of source:" + sourcePath + " (" + srcLen +
|
||||||
|
") and target:" + target + " (" + targetLen + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void compareCheckSums(FileSystem sourceFS, Path source,
|
private void compareCheckSums(FileSystem sourceFS, Path source,
|
||||||
|
|
Loading…
Reference in New Issue