Source:
<code>public static void compareFileLengthsAndChecksums( FileSystem sourceFS, Path source, FileChecksum sourceChecksum, FileSystem targetFS, Path target, boolean skipCrc) throws IOException { long srcLen = sourceFS.getFileStatus(source).getLen(); long tgtLen = targetFS.getFileStatus(target).getLen(); if (srcLen != tgtLen) { throw new IOException( "Mismatch in length of source:" + source + " (" + srcLen + ") and target:" + target + " (" + tgtLen + ")"); } if ((srcLen != 0) && (!skipCrc)) { if (!checksumsAreEqual(sourceFS, source, sourceChecksum, targetFS, target)) { StringBuilder errorMessage = new StringBuilder("Checksum mismatch between ") .append(source).append(" and ").append(target).append("."); boolean addSkipHint = false; String srcScheme = sourceFS.getScheme(); String targetScheme = targetFS.getScheme(); if (!srcScheme.equals(targetScheme) <START> && !(srcScheme.contains("hdfs") && targetScheme.contains("hdfs"))) { <END> errorMessage.append("Source and destination filesystems are of" + " different types\n") .append("Their checksum algorithms may be incompatible"); addSkipHint = true; } else if (sourceFS.getFileStatus(source).getBlockSize() != targetFS.getFileStatus(target).getBlockSize()) { errorMessage.append(" Source and target differ in block-size.\n") .append(" Use -pb to preserve block-sizes during copy."); addSkipHint = true; } if (addSkipHint) { errorMessage.append(" You can skip checksum-checks altogether " + " with -skipcrccheck.\n") .append(" (NOTE: By skipping checksums, one runs the risk of " + "masking data-corruption during file-transfer.)\n"); } throw new IOException(errorMessage.toString()); } } }</code><technical_language>is this line redundant? want log error file system different. matter if src is hdfs not</technical_language>

Target:
public static void compareFileLengthsAndChecksums( FileSystem sourceFS, Path source, FileChecksum sourceChecksum, FileSystem targetFS, Path target, boolean skipCrc) throws IOException { long srcLen = sourceFS.getFileStatus(source).getLen(); long tgtLen = targetFS.getFileStatus(target).getLen(); if (srcLen != tgtLen) { throw new IOException( "Mismatch in length of source:" + source + " (" + srcLen + ") and target:" + target + " (" + tgtLen + ")"); } if ((srcLen != 0) && (!skipCrc)) { if (!checksumsAreEqual(sourceFS, source, sourceChecksum, targetFS, target)) { StringBuilder errorMessage = new StringBuilder("Checksum mismatch between ") .append(source).append(" and ").append(target).append("."); boolean addSkipHint = false; String srcScheme = sourceFS.getScheme(); String targetScheme = targetFS.getScheme(); if (!srcScheme.equals(targetScheme)) { errorMessage.append("Source and destination filesystems are of" + " different types\n") .append("Their checksum algorithms may be incompatible"); addSkipHint = true; } else if (sourceFS.getFileStatus(source).getBlockSize() != targetFS.getFileStatus(target).getBlockSize()) { errorMessage.append(" Source and target differ in block-size.\n") .append(" Use -pb to preserve block-sizes during copy."); addSkipHint = true; } if (addSkipHint) { errorMessage .append(" You can choose file-level checksum validation via " + "-Ddfs.checksum.combine.mode=COMPOSITE_CRC when block-sizes" + " or filesystems are different.") .append(" Or you can skip checksum-checks altogether " + " with -skipcrccheck.\n") .append(" (NOTE: By skipping checksums, one runs the risk of " + "masking data-corruption during file-transfer.)\n"); } throw new IOException(errorMessage.toString()); } } }