Search in sources :

Example 1 with RequestVoteRequestProto

use of org.apache.ratis.shaded.proto.RaftProtos.RequestVoteRequestProto in project incubator-ratis by apache.

the class LeaderElection method submitRequests.

private int submitRequests(final long electionTerm, final TermIndex lastEntry) {
    int submitted = 0;
    for (final RaftPeer peer : others) {
        final RequestVoteRequestProto r = server.createRequestVoteRequest(peer.getId(), electionTerm, lastEntry);
        service.submit(() -> server.getServerRpc().requestVote(r));
        submitted++;
    }
    return submitted;
}
Also used : RequestVoteRequestProto(org.apache.ratis.shaded.proto.RaftProtos.RequestVoteRequestProto) RaftPeer(org.apache.ratis.protocol.RaftPeer)

Aggregations

RaftPeer (org.apache.ratis.protocol.RaftPeer)1 RequestVoteRequestProto (org.apache.ratis.shaded.proto.RaftProtos.RequestVoteRequestProto)1