ahuang98 commented on code in PR #16637:
URL: https://github.com/apache/kafka/pull/16637#discussion_r1687056368
##########
raft/src/main/java/org/apache/kafka/raft/LeaderState.java:
##########
@@ -607,20 +565,27 @@ private void updateVoterAndObserverStates(VoterSet
lastVoterSet) {
// Move any of the remaining old voters to observerStates
for (ReplicaState replicaStateEntry : oldVoterStates.values()) {
+ replicaStateEntry.listeners = Optional.empty();
observerStates.putIfAbsent(replicaStateEntry.replicaKey,
replicaStateEntry);
}
}
- private static class ReplicaState implements Comparable<ReplicaState> {
+ static class ReplicaState implements Comparable<ReplicaState> {
ReplicaKey replicaKey;
+ Optional<Endpoints> listeners;
Optional<LogOffsetMetadata> endOffset;
long lastFetchTimestamp;
long lastFetchLeaderLogEndOffset;
long lastCaughtUpTimestamp;
boolean hasAcknowledgedLeader;
public ReplicaState(ReplicaKey replicaKey, boolean
hasAcknowledgedLeader) {
+ this(replicaKey, hasAcknowledgedLeader, Optional.empty());
+ }
+
+ public ReplicaState(ReplicaKey replicaKey, boolean
hasAcknowledgedLeader, Optional<Endpoints> listeners) {
Review Comment:
I see, I missed that we will always expect `Endpoints` to be instantiated
(can be empty, but not null)
--
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]