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/06/18 16:30:05 UTC
[PR] [WIP]KAFKA-16908: Refactor QuorumConfig with AbstractConfig [kafka]
johnnychhsu opened a new pull request, #16388:
URL: https://github.com/apache/kafka/pull/16388
Jira: https://issues.apache.org/jira/browse/KAFKA-16908
### 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] KAFKA-16908: Refactor QuorumConfig with AbstractConfig [kafka]
Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #16388:
URL: https://github.com/apache/kafka/pull/16388#discussion_r1678393481
##########
raft/src/test/java/org/apache/kafka/raft/RaftEventSimulationTest.java:
##########
@@ -762,14 +763,14 @@ void start(int nodeId) {
.stream()
.collect(Collectors.toMap(Node::id, Cluster::nodeAddress));
- QuorumConfig quorumConfig = new QuorumConfig(
- REQUEST_TIMEOUT_MS,
- RETRY_BACKOFF_MS,
- ELECTION_TIMEOUT_MS,
- ELECTION_JITTER_MS,
- FETCH_TIMEOUT_MS,
- LINGER_MS
- );
+ Properties props = new Properties();
+ props.put(QuorumConfig.QUORUM_REQUEST_TIMEOUT_MS_CONFIG, REQUEST_TIMEOUT_MS);
+ props.put(QuorumConfig.QUORUM_RETRY_BACKOFF_MS_CONFIG, RETRY_BACKOFF_MS);
+ props.put(QuorumConfig.QUORUM_ELECTION_TIMEOUT_MS_CONFIG, ELECTION_TIMEOUT_MS);
+ props.put(QuorumConfig.QUORUM_ELECTION_BACKOFF_MAX_MS_CONFIG, ELECTION_JITTER_MS);
+ props.put(QuorumConfig.QUORUM_FETCH_TIMEOUT_MS_CONFIG, FETCH_TIMEOUT_MS);
+ props.put(QuorumConfig.QUORUM_LINGER_MS_CONFIG, LINGER_MS);
+ QuorumConfig quorumConfig = new QuorumConfig(props);
Review Comment:
please fix compile error
##########
raft/src/test/java/org/apache/kafka/raft/RaftClientTestContext.java:
##########
@@ -79,6 +79,7 @@
import java.util.Optional;
import java.util.OptionalInt;
import java.util.OptionalLong;
+import java.util.Properties;
Review Comment:
please remove unnecessary change
##########
raft/src/main/java/org/apache/kafka/raft/QuorumConfig.java:
##########
@@ -99,7 +99,14 @@ public class QuorumConfig {
public static final String QUORUM_RETRY_BACKOFF_MS_DOC = CommonClientConfigs.RETRY_BACKOFF_MS_DOC;
public static final int DEFAULT_QUORUM_RETRY_BACKOFF_MS = 20;
- public static final ConfigDef CONFIG_DEF = new ConfigDef()
+ private final AbstractConfig config;
+
+ public QuorumConfig(AbstractConfig config) {
+ this.config = config;
+ }
+
+ public static ConfigDef configDef() {
Review Comment:
Why we need this change?
--
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