void sendRequestVote() throws Exception { if (clock.now() >= requestVoteTs) { // Clear the prevotes before sending prevote peers.forEach(p -> p.prevoteGranted = false); sendRequestVoteRequest(true); } }
/** * Forces this member to become the leader. */ public void forceLeader() throws GondolaException { if (!isLeader()) { sendRequestVoteRequest(false); } }
/** * Forces this member to become the leader. */ public void forceLeader() throws Exception { if (!isLeader()) { sendRequestVoteRequest(false); } }
/** * Sends a prevote if it's time to send one. */ void sendPrevote() throws GondolaException { if (clock.now() >= prevoteTs) { // Clear the prevotes before sending prevote peers.forEach((id, p) -> p.prevoteGranted = false); slaves.forEach(p -> p.prevoteGranted = false); sendRequestVoteRequest(true); } }
gondola.getHostId(), memberId, prevotes, currentTerm + 1); sendRequestVoteRequest(false);
gondola.getHostId(), memberId, prevotes, currentTerm + 1); sendRequestVoteRequest(false);