HADOOP-14405. Fix performance regression due to incorrect use of DataChecksum. Contributed by LiXin Ge.
This commit is contained in:
parent
ab2bb93a2a
commit
06ffeb8d4d
|
@ -300,8 +300,16 @@ public class DataChecksum implements Checksum {
|
|||
if (data.hasArray() && checksums.hasArray()) {
|
||||
final int dataOffset = data.arrayOffset() + data.position();
|
||||
final int crcsOffset = checksums.arrayOffset() + checksums.position();
|
||||
|
||||
if (NativeCrc32.isAvailable()) {
|
||||
NativeCrc32.verifyChunkedSumsByteArray(bytesPerChecksum, type.id,
|
||||
checksums.array(), crcsOffset, data.array(), dataOffset,
|
||||
data.remaining(), fileName, basePos);
|
||||
} else {
|
||||
verifyChunked(type, summer, data.array(), dataOffset, data.remaining(),
|
||||
bytesPerChecksum, checksums.array(), crcsOffset, fileName, basePos);
|
||||
bytesPerChecksum, checksums.array(), crcsOffset, fileName,
|
||||
basePos);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (NativeCrc32.isAvailable() && data.isDirect()) {
|
||||
|
|
Loading…
Reference in New Issue