Browse Source

MINOR: refactor CandidateState.unrecordedVoters (#9442)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
pull/9119/merge
dengziming 4 years ago committed by GitHub
parent
commit
42ce00fdd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      raft/src/main/java/org/apache/kafka/raft/CandidateState.java

5
raft/src/main/java/org/apache/kafka/raft/CandidateState.java

@ -165,10 +165,7 @@ public class CandidateState implements EpochState { @@ -165,10 +165,7 @@ public class CandidateState implements EpochState {
* @return The set of unrecorded voters
*/
public Set<Integer> unrecordedVoters() {
return voteStates.entrySet().stream()
.filter(entry -> entry.getValue() == State.UNRECORDED)
.map(Map.Entry::getKey)
.collect(Collectors.toSet());
return votersInState(State.UNRECORDED);
}
/**

Loading…
Cancel
Save