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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]