chia7712 commented on a change in pull request #9906:
URL: https://github.com/apache/kafka/pull/9906#discussion_r563469378



##########
File path: 
clients/src/test/java/org/apache/kafka/common/record/MemoryRecordsBuilderTest.java
##########
@@ -455,20 +460,19 @@ public void buildUsingCreateTime(Args args) {
     @ParameterizedTest
     @ArgumentsSource(MemoryRecordsBuilderArgumentsProvider.class)
     public void testAppendedChecksumConsistency(Args args) {
-        assumeAtLeastV2OrNotZstd(RecordBatch.MAGIC_VALUE_V0, 
args.compressionType);
-        assumeAtLeastV2OrNotZstd(RecordBatch.MAGIC_VALUE_V1, 
args.compressionType);
-
         ByteBuffer buffer = ByteBuffer.allocate(512);
         for (byte magic : Arrays.asList(RecordBatch.MAGIC_VALUE_V0, 
RecordBatch.MAGIC_VALUE_V1, RecordBatch.MAGIC_VALUE_V2)) {

Review comment:
       Could we add a local variable to includes the "valid" magic code. For 
example:
   ```java
   List<Byte> magicCodes = args.compressionType == CompressionType.ZSTD
     ? Collections.singletonList(RecordBatch.MAGIC_VALUE_V2)
     : Arrays.asList(RecordBatch.MAGIC_VALUE_V0, RecordBatch.MAGIC_VALUE_V1, 
RecordBatch.MAGIC_VALUE_V2)
     for (byte magic : magicCodes) {
       // ...
     }
   
   ```
   
   It seems to me that is more readable. WDYT?




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to