MAPREDUCE-5899. Support incremental data copy in DistCp. Contributed by Jing Zhao.
@@ -1691,6 +1691,10 @@ public MD5MD5CRC32FileChecksum getFileChecksum(String src, long length)
}
LocatedBlock lb = locatedblocks.get(i);
final ExtendedBlock block = lb.getBlock();
+ if (remaining < block.getNumBytes()) {
+ block.setNumBytes(remaining);
+ }
+ remaining -= block.getNumBytes();
final DatanodeInfo[] datanodes = lb.getLocations();
if (remaining < block.getNumBytes()) {
block.setNumBytes(remaining);
