rakeshadr commented on a change in pull request #2937:
URL: https://github.com/apache/ozone/pull/2937#discussion_r825578929
##########
File path:
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/checksum/BaseFileChecksumHelper.java
##########
@@ -186,6 +207,35 @@ private FileChecksum makeMd5CrcResult() {
crcPerBlock, fileMD5);
}
+ FileChecksum makeCompositeCrcResult() throws IOException {
+ long blockSizeHint = 0;
+ if (keyLocationInfos.size() > 0) {
+ blockSizeHint = keyLocationInfos.get(0).getLength();
+ }
+ CrcComposer crcComposer =
+ CrcComposer.newCrcComposer(DataChecksum.Type.CRC32, blockSizeHint);
+ byte[] blockChecksumBytes = blockChecksumBuf.getData();
+
+ long sumBlockLengths = 0;
+ for (int i = 0; i < keyLocationInfos.size(); ++i) {
+ OmKeyLocationInfo block = keyLocationInfos.get(i);
+ // For every LocatedBlock, we expect getBlockSize()
+ // to accurately reflect the number of file bytes digested in the block
+ // checksum.
+ sumBlockLengths += block.getLength();
Review comment:
@jojochuang `sumBlockLengths` is unused, in hdfs its being used for
consumedLastBlockLength calculation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]