Examples of RequestVote


Examples of org.robotninjas.barge.api.RequestVote

    Candidate candidate = new Candidate(mockRaftLog, scheduler, 150, mockRaftClient);
    candidate.init(mockRaftStateContext);

    Replica mockCandidate = config.getReplica("other");

    RequestVote request =
      RequestVote.newBuilder()
        .setCandidateId(mockCandidate.toString())
        .setLastLogIndex(1L)
        .setLastLogTerm(1L)
        .setTerm(2L)
View Full Code Here

Examples of org.robotninjas.barge.api.RequestVote

    verify(protocolListener).appendEntries(context, entries);
  }

  @Test
  public void notifiesRequestVoteToRegisteredProtocolListenersWhenReceivingRequestVote() throws Exception {
    RequestVote vote = RequestVote.getDefaultInstance();
   
    context.addRaftProtocolListener(protocolListener);
    context.setState(null, FOLLOWER);
    context.requestVote(vote);
   
View Full Code Here

Examples of org.robotninjas.barge.api.RequestVote

    verify(follower).appendEntries(context, appendEntries);
  }

  @Test
  public void delegateRequestVoteToCurrentState() throws Exception {
    RequestVote requestVote = RequestVote.getDefaultInstance();
    context.setState(null, FOLLOWER);

    context.requestVote(requestVote);

    verify(follower).requestVote(context, requestVote);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.