MINOR: Avoid using strings directly for the auto.offset.reset configuration of ConsumerConfig#12077
Conversation
… cpu and traffic on the broker side increase sharply JIRA link : https://issues.apache.org/jira/browse/KAFKA-13310 Author: RivenSun2 <riven.sun@zoom.us> Reviewers: Luke Chen <showuon@gmail.com>
…sets method JIRA link : https://issues.apache.org/jira/browse/KAFKA-13310 Author: RivenSun2 <riven.sun@zoom.us> Reviewers: Luke Chen <showuon@gmail.com>
2. Optimize the import of package Author: RivenSun2 <riven.sun@zoom.us> Reviewers: Luke Chen <showuon@gmail.com>
Author: RivenSun2 <riven.sun@zoom.us> Reviewers: Luke Chen <showuon@gmail.com>
Author: RivenSun2 <riven.sun@zoom.us> Reviewers: Luke Chen <showuon@gmail.com>
Author: RivenSun2 <riven.sun@zoom.us> Reviewers: Luke Chen <showuon@gmail.com>
Author: RivenSun2 <riven.sun@zoom.us> Reviewers: Luke Chen <showuon@gmail.com>
add test Method "testForceMetadataDeleteForPatternSubscriptionDuringRebalance()" Author: RivenSun2 <riven.sun@zoom.us> Reviewers: Luke Chen <showuon@gmail.com>
Author: RivenSun2 <riven.sun@zoom.us> Reviewers: Luke Chen <showuon@gmail.com>
Author: RivenSun2 riven.sun@zoom.us
� Conflicts: � clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java
…ration of ConsumerConfig
|
Hi @showuon |
|
Hi @showuon @guozhangwang |
|
Hi @showuon @guozhangwang |
|
|
||
| @Override | ||
| public String toString() { | ||
| return super.toString().toLowerCase(Locale.ROOT); |
There was a problem hiding this comment.
I am wondering if this could have an impact when using non-english locale, e.g. there may be places in the code which perform a comparison of the enum with string "latest" but in a different locale this comparison may fail.
There was a problem hiding this comment.
Quoting the comment above Locale.ROOT
This is regarded as the base locale of all locales, and is used as the language/country neutral locale for the locale sensitive operations.
I think this is better than if we use toLowerCase(Locale.ENGLISH)
At the same time, the same method is used for isolation.level in ConsumerConfig.
.define(ISOLATION_LEVEL_CONFIG,
Type.STRING,
DEFAULT_ISOLATION_LEVEL,
in(IsolationLevel.READ_COMMITTED.toString().toLowerCase(Locale.ROOT), IsolationLevel.READ_UNCOMMITTED.toString().toLowerCase(Locale.ROOT)),
Importance.MEDIUM,
ISOLATION_LEVEL_DOC)
showuon
left a comment
There was a problem hiding this comment.
LGTM! Thanks.
Failed tests:
Build / JDK 17 and Scala 2.13 / kafka.admin.LeaderElectionCommandTest.[1] Type=Raft, Name=testElectionResultOutput, Security=PLAINTEXT
Build / JDK 17 and Scala 2.13 / kafka.admin.TopicCommandIntegrationTest.testDescribeUnderMinIsrPartitionsMixed(String).quorum=zk
Build / JDK 11 and Scala 2.13 / org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationSSLTest.testReplication()
Build / JDK 11 and Scala 2.13 / org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationTest.testOneWayReplicationWithAutoOffsetSync()
Build / JDK 11 and Scala 2.13 / org.apache.kafka.connect.integration.BlockingConnectorTest.testWorkerRestartWithBlockInConnectorStart
Build / JDK 11 and Scala 2.13 / org.apache.kafka.connect.integration.BlockingConnectorTest.testBlockInSourceTaskStop
Build / JDK 11 and Scala 2.13 / org.apache.kafka.connect.integration.ConnectWorkerIntegrationTest.testTaskStatuses
Build / JDK 8 and Scala 2.12 / org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationTest.testReplicationWithEmptyPartition()
Build / JDK 8 and Scala 2.12 / kafka.api.PlaintextConsumerTest.testCoordinatorFailover()
Build / JDK 8 and Scala 2.12 / kafka.server.KRaftClusterTest.testSetLog4jConfigurations()
Build / JDK 8 and Scala 2.12 / kafka.server.KRaftClusterTest.testLegacyAlterConfigs()
Build / JDK 8 and Scala 2.12 / kafka.server.KRaftClusterTest.testCreateClusterAndPerformReassignment()
Triggering another build to make sure they are flaky: https://ci-builds.apache.org/job/Kafka/job/kafka-pr/job/PR-12077/2/
|
@showuon testCase shoud be ok now. |
|
Failed tests are not related: |
Avoid using strings directly for the auto.offset.reset configuration of ConsumerConfig
Committer Checklist (excluded from commit message)