You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "johnnychhsu (via GitHub)" <gi...@apache.org> on 2024/04/01 12:55:48 UTC
[PR] remove redundant check [kafka]
johnnychhsu opened a new pull request, #15638:
URL: https://github.com/apache/kafka/pull/15638
## 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.
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: remove redundant check in appendLegacyRecord [kafka]
Posted by "mcmmining (via GitHub)" <gi...@apache.org>.
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: remove redundant check in appendLegacyRecord [kafka]
Posted by "mcmmining (via GitHub)" <gi...@apache.org>.
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: remove redundant check in appendLegacyRecord [kafka]
Posted by "mcmmining (via GitHub)" <gi...@apache.org>.
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: remove redundant check in appendLegacyRecord [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org