use of org.apache.ratis.proto.RaftProtos.RequestVoteRequestProto in project incubator-ratis by apache.
the class LeaderElection method submitRequests.
private int submitRequests(Phase phase, long electionTerm, TermIndex lastEntry, Collection<RaftPeer> others, Executor voteExecutor) {
int submitted = 0;
for (final RaftPeer peer : others) {
final RequestVoteRequestProto r = ServerProtoUtils.toRequestVoteRequestProto(server.getMemberId(), peer.getId(), electionTerm, lastEntry, phase == Phase.PRE_VOTE);
voteExecutor.submit(() -> server.getServerRpc().requestVote(r));
submitted++;
}
return submitted;
}
Aggregations