sjhajharia commented on code in PR #20348:
URL: https://github.com/apache/kafka/pull/20348#discussion_r2326774624
##########
raft/src/main/java/org/apache/kafka/raft/internals/EpochElection.java:
##########
@@ -27,17 +27,11 @@
/**
* Tracks the votes cast by voters in an election held by a Nominee.
*/
-public class EpochElection {
- private Map<Integer, VoterState> voterStates;
-
+public record EpochElection(Map<Integer, VoterState> voterStates) {
Review Comment:
I removed the toString()
For the other comment on making `voterStates` immutable, I am not sure if
that can be done. The public constructor `EpochElection` is what is used by
multiple classes and it takes `Set<ReplicaKey> voters` and generates the needed
Map with VoterState inner class.
--
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]