chiacyu commented on code in PR #7611:
URL: https://github.com/apache/ozone/pull/7611#discussion_r1900385953
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/checksum/BaseFileChecksumHelper.java:
##########
@@ -167,6 +165,39 @@ protected ByteBuffer
getBlockChecksumFromChunkChecksums(AbstractBlockChecksumCom
return blockChecksumComputer.getOutByteBuffer();
}
+ /**
+ * Parses out the raw blockChecksum bytes from {@code checksumData} byte
+ * buffer according to the blockChecksumType and populates the cumulative
+ * blockChecksumBuf with it.
+ *
+ * @return a debug-string representation of the parsed checksum if
+ * debug is enabled, otherwise null.
+ */
+
+ protected String populateBlockChecksumBuf(ByteBuffer
blockChecksumByteBuffer) throws IOException {
+ String blockChecksumForDebug = null;
+ switch (getCombineMode()) {
+ case MD5MD5CRC:
+ final MD5Hash md5 = new MD5Hash(blockChecksumByteBuffer.array());
+ md5.write(getBlockChecksumBuf());
+ if (LOG.isDebugEnabled()) {
+ blockChecksumForDebug = md5.toString();
+ }
+ break;
+ case COMPOSITE_CRC:
+ byte[] crcBytes = blockChecksumByteBuffer.array();
+ if (LOG.isDebugEnabled()) {
+ blockChecksumForDebug = CrcUtil.toSingleCrcString(crcBytes);
Review Comment:
applied, thanks for the reminder, almost miss that one.
--
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]