ayushtkn commented on code in PR #4320:
URL: https://github.com/apache/ozone/pull/4320#discussion_r1118738326


##########
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/ECBlockOutputStream.java:
##########
@@ -128,8 +128,13 @@ ContainerCommandResponseProto> executePutBlock(boolean 
close,
       List<ChunkInfo> currentChunks = getContainerBlockData().getChunksList();
       List<ChunkInfo> checksumBlockDataChunks = checksumBlockData.getChunks();
 
-      Preconditions.checkArgument(
-          currentChunks.size() == checksumBlockDataChunks.size());
+      if (currentChunks.size() != checksumBlockDataChunks.size()) {
+        throw new IllegalArgumentException("The chunk list has " +
+            currentChunks.size() +
+            " entries, but the checksum chunks has " +
+            checksumBlockDataChunks.size() +
+            " entries. They should be equal in size.");
+      }

Review Comment:
   Why not just add the message in Preconditions.checkArgument itself,
   ```
         Preconditions.checkArgument(
             currentChunks.size() == checksumBlockDataChunks.size(),
             "The chunk list has " + currentChunks.size()
                 + " entries, but the checksum chunks has "
                 + checksumBlockDataChunks.size()
                 + " entries. They should be equal in size.");
   
   ```



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