Re: [PR] MINOR: remove redundant check in appendLegacyRecord [kafka]

2024-04-05 Thread via GitHub


chia7712 merged PR #15638:
URL: https://github.com/apache/kafka/pull/15638


-- 
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: jira-unsubscr...@kafka.apache.org

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



Re: [PR] MINOR: remove redundant check in appendLegacyRecord [kafka]

2024-04-01 Thread via GitHub


mcmmining commented on PR #15638:
URL: https://github.com/apache/kafka/pull/15638#issuecomment-2029995791

   > ## Context
   > In `MemoeyRecordsBuilder.appendLegacyRecord`, there are two similar checks 
currently
   > 
   > 1.  
   > ```
   > if (compressionType == CompressionType.NONE && timestampType == 
TimestampType.LOG_APPEND_TIME)
   > ```
   > 
   > 2. 
   > ```
   > if (timestampType == TimestampType.LOG_APPEND_TIME)
   > ```
   > 
   > The first check verify the timestamp type and compression type, the second 
check verify the timestamp type again.
   > However, if it's LOG_APPEND_TIME, we should choose the `logAppendTime` no 
matter whether it's compressed or not.
   > The `logAppendTime` is init in LogValidator 203L. 
   > 
   > ## Solution 
   > Remove the redundant check.
   > 
   > ## Test
   > run 
   > ` ./gradlew clean client:test --tests 
org.apache.kafka.common.record.MemoryRecordsBuilderTest
   > `
   > and it passed
   > 
   > ### Committer Checklist (excluded from commit message)
   > - [ ] Verify design and implementation 
   > - [ ] Verify test coverage and CI build status
   > - [ ] Verify documentation (including upgrade notes)
   > 
   
   b77722b477734e69e156a909e44a45573bec5c5a


-- 
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: jira-unsubscr...@kafka.apache.org

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



Re: [PR] MINOR: remove redundant check in appendLegacyRecord [kafka]

2024-04-01 Thread via GitHub


mcmmining commented on PR #15638:
URL: https://github.com/apache/kafka/pull/15638#issuecomment-2029995320

   b77722b477734e69e156a909e44a45573bec5c5a


-- 
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: jira-unsubscr...@kafka.apache.org

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



Re: [PR] MINOR: remove redundant check in appendLegacyRecord [kafka]

2024-04-01 Thread via GitHub


mcmmining commented on PR #15638:
URL: https://github.com/apache/kafka/pull/15638#issuecomment-2029994647

   > ## Context
   > In `MemoeyRecordsBuilder.appendLegacyRecord`, there are two similar checks 
currently
   > 
   > 1.  
   > ```
   > if (compressionType == CompressionType.NONE && timestampType == 
TimestampType.LOG_APPEND_TIME)
   > ```
   > 
   > 2. 
   > ```
   > if (timestampType == TimestampType.LOG_APPEND_TIME)
   > ```
   > 
   > The first check verify the timestamp type and compression type, the second 
check verify the timestamp type again.
   > However, if it's LOG_APPEND_TIME, we should choose the `logAppendTime` no 
matter whether it's compressed or not.
   > The `logAppendTime` is init in LogValidator 203L. 
   > 
   > ## Solution 
   > Remove the redundant check.
   > 
   > ## Test
   > run 
   > ` ./gradlew clean client:test --tests 
org.apache.kafka.common.record.MemoryRecordsBuilderTest
   > `
   > and it passed
   > 
   > ### Committer Checklist (excluded from commit message)
   > - [ ] Verify design and implementation 
   > - [ ] Verify test coverage and CI build status
   > - [ ] Verify documentation (including upgrade notes)
   > 
   
   b77722b477734e69e156a909e44a45573bec5c5a


-- 
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: jira-unsubscr...@kafka.apache.org

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