jojochuang commented on code in PR #11008:
URL: https://github.com/apache/ozone/pull/11008#discussion_r3864495820


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/common/Checksum.java:
##########
@@ -305,6 +311,7 @@ private List<ByteString> computeChecksumDirect(ChunkBuffer 
data,
     final int checksumCount = dataLength == 0 ? 0 : 1 + (dataLength - 1) / 
bytesPerChecksum;
     final List<ByteString> result = new ArrayList<>(checksumCount);
     int windowRemaining = bytesPerChecksum;
+    long processed = 0;

Review Comment:
   it would be a nice-to-have to refactor this check into a helper method and 
let ChecksumCache to reuse it too.
   
       static void validateReadableChunkBuffer(ChunkBuffer data) {
         final int expected = data.remaining();
         long readable = 0;
         for (ByteBuffer buffer : data.asByteBufferList()) {
           readable += buffer.remaining();
         }
         Preconditions.checkState(readable == expected,
             "ChunkBuffer remaining byte count is %s, but its underlying 
buffers expose %s bytes",
             expected, readable);
       }



-- 
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]

Reply via email to