2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.cluster.raft.messages;
12 * Invoked by candidates to gather votes (§5.2).
14 public class RequestVote extends AbstractRaftRPC{
16 // candidate requesting vote
17 private final String candidateId;
19 // index of candidate’s last log entry (§5.4)
20 private final long lastLogIndex;
22 // term of candidate’s last log entry (§5.4)
23 private final long lastLogTerm;
25 public RequestVote(long term, String candidateId, long lastLogIndex,
28 this.candidateId = candidateId;
29 this.lastLogIndex = lastLogIndex;
30 this.lastLogTerm = lastLogTerm;
33 public long getTerm() {
37 public String getCandidateId() {
41 public long getLastLogIndex() {
45 public long getLastLogTerm() {