kafka
kafka copied to clipboard
MINOR: Change config. compressionType to be an enum type instead
Currently, LogConfig.compressionType
is a string so UnifiedLog.append
has to convert string into enum all the time which seems to waste a lot of CPU time for something that is rarely changed.
This change makes LogConfig.compressionType to be the parsed enum so that the caller can use it directly without parsing enum every time.
A crude benchmark seems to be improved by 3-5%
Committer Checklist (excluded from commit message)
- [X] Verify design and implementation
- [X] Verify test coverage and CI build status
- [X] Verify documentation (including upgrade notes)
The build is failing because we need to modify a few other tests to use enum instead of string. Please tag me here again for review once we have a green build.
Hey @testn Tests in the CI seem to be failing due to this change such as https://ci-builds.apache.org/job/Kafka/job/kafka-pr/job/PR-15403/6/testReport/junit/kafka.server/DynamicConfigChangeTest/Build___JDK_11_and_Scala_2_13___testMessageFormatVersionChange_String__quorum_zk/
You can verify them by running ./gradlew test
locally. Please check and fix them.
This PR is being marked as stale since it has not had any activity in 90 days. If you would like to keep this PR alive, please ask a committer for review. If the PR has merge conflicts, please update it with the latest from trunk (or appropriate release branch)
If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.
I think a similar change has been done via https://github.com/apache/kafka/commit/affe8da54c96d4038481c3807d059134961445a3. Closing.