aloknnikhil commented on a change in pull request #9916:
URL: https://github.com/apache/kafka/pull/9916#discussion_r560612621
##########
File path: core/src/main/scala/kafka/server/KafkaConfig.scala
##########
@@ -1258,6 +1276,15 @@ object KafkaConfig {
.define(PasswordEncoderCipherAlgorithmProp, STRING,
Defaults.PasswordEncoderCipherAlgorithm, LOW, PasswordEncoderCipherAlgorithmDoc)
.define(PasswordEncoderKeyLengthProp, INT,
Defaults.PasswordEncoderKeyLength, atLeast(8), LOW, PasswordEncoderKeyLengthDoc)
.define(PasswordEncoderIterationsProp, INT,
Defaults.PasswordEncoderIterations, atLeast(1024), LOW,
PasswordEncoderIterationsDoc)
+
+ /** ********* Raft Quorum Configuration *********/
+ .defineInternal(QuorumVotersProp, STRING, Defaults.QuorumVoters, HIGH)
Review comment:
With the validation being moved to KafkaConfig, I don't see any reason
not to make it a LIST. Will change it back
##########
File path: raft/src/main/java/org/apache/kafka/raft/RaftConfig.java
##########
@@ -138,31 +75,35 @@ public String toString() {
private final int appendLingerMs;
private final Map<Integer, InetSocketAddress> voterConnections;
- public RaftConfig(Map<?, ?> props) {
- this(props, true);
- }
-
- protected RaftConfig(Map<?, ?> props, boolean doLog) {
- super(CONFIG, props, doLog);
- requestTimeoutMs = getInt(QUORUM_REQUEST_TIMEOUT_MS_CONFIG);
- retryBackoffMs = getInt(QUORUM_RETRY_BACKOFF_MS_CONFIG);
- electionTimeoutMs = getInt(QUORUM_ELECTION_TIMEOUT_MS_CONFIG);
- electionBackoffMaxMs = getInt(QUORUM_ELECTION_BACKOFF_MAX_MS_CONFIG);
- fetchTimeoutMs = getInt(QUORUM_FETCH_TIMEOUT_MS_CONFIG);
- appendLingerMs = getInt(QUORUM_LINGER_MS_CONFIG);
- voterConnections =
parseVoterConnections(getList(QUORUM_VOTERS_CONFIG));
- }
-
- public static Set<String> configNames() {
- return CONFIG.names();
- }
-
- public static ConfigDef configDef() {
- return new ConfigDef(CONFIG);
- }
-
- public static void main(String[] args) {
- System.out.println(CONFIG.toHtml());
+ public RaftConfig(AbstractConfig abstractConfig) {
+ this(abstractConfig.getInt(QUORUM_REQUEST_TIMEOUT_MS_CONFIG),
+ abstractConfig.getInt(QUORUM_RETRY_BACKOFF_MS_CONFIG),
+ abstractConfig.getInt(QUORUM_ELECTION_TIMEOUT_MS_CONFIG),
+ abstractConfig.getInt(QUORUM_ELECTION_BACKOFF_MAX_MS_CONFIG),
+ abstractConfig.getInt(QUORUM_FETCH_TIMEOUT_MS_CONFIG),
+ abstractConfig.getInt(QUORUM_LINGER_MS_CONFIG),
+ abstractConfig.getString(QUORUM_VOTERS_CONFIG));
+ }
+
+ public RaftConfig(
+ int requestTimeoutMs,
+ int retryBackoffMs,
+ int electionTimeoutMs,
+ int electionBackoffMaxMs,
+ int fetchTimeoutMs,
+ int appendLingerMs,
+ String votersConnectString
Review comment:
Ack.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]