jsancio commented on code in PR #15859: URL: https://github.com/apache/kafka/pull/15859#discussion_r1595578267
########## raft/src/main/java/org/apache/kafka/raft/ElectionState.java: ########## @@ -16,46 +16,44 @@ */ package org.apache.kafka.raft; +import java.util.List; +import java.util.Objects; +import java.util.Optional; import java.util.OptionalInt; import java.util.Set; +import java.util.stream.Collectors; +import org.apache.kafka.common.Uuid; +import org.apache.kafka.raft.generated.QuorumStateData; +import org.apache.kafka.raft.internals.ReplicaKey; /** * Encapsulate election state stored on disk after every state change. */ -public class ElectionState { - public final int epoch; - public final OptionalInt leaderIdOpt; - public final OptionalInt votedIdOpt; +final public class ElectionState { + private static int unknownLeaderId = -1; Review Comment: Yeah, I had this using capital letters and underscore but our style guide complained about the name pattern. E.g. ``` [ant:checkstyle] [ERROR] kafka/raft/src/main/java/org/apache/kafka/raft/ElectionState.java:33:24: Name 'UNKNOWN_LEADER_ID' must match pattern '^[a-z][a-zA-Z0-9]*$'. [StaticVariableName] ``` I suspect that the style guideline is different if the field is `private`. I haven't investigated this in detail. Do you mind if I address this in a different PR? -- 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org