You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/01/14 06:11:33 UTC

[GitHub] [kafka] ijuma commented on a change in pull request #9871: KAFKA-12161; Support raft observers with optional id

ijuma commented on a change in pull request #9871:
URL: https://github.com/apache/kafka/pull/9871#discussion_r557064057



##########
File path: raft/src/main/java/org/apache/kafka/raft/QuorumState.java
##########
@@ -196,7 +203,15 @@ public void initialize(OffsetAndEpoch logEndOffsetAndEpoch) throws IOException,
     }
 
     public Set<Integer> remoteVoters() {
-        return voters.stream().filter(voterId -> voterId != localId).collect(Collectors.toSet());
+        return voters.stream().filter(voterId -> voterId != localIdOrNil()).collect(Collectors.toSet());
+    }
+
+    public int localIdOrNil() {

Review comment:
       `localIdOrSentinel` would be more accurate, I think.




----------------------------------------------------------------
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:
users@infra.apache.org