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 {
17 private final long term;
19 // candidate requesting vote
20 private final String candidateId;
22 // index of candidate’s last log entry (§5.4)
23 private final long lastLogIndex;
25 // term of candidate’s last log entry (§5.4)
26 private final long lastLogTerm;
28 public RequestVote(long term, String candidateId, long lastLogIndex,
31 this.candidateId = candidateId;
32 this.lastLogIndex = lastLogIndex;
33 this.lastLogTerm = lastLogTerm;
36 public long getTerm() {
40 public String getCandidateId() {
44 public long getLastLogIndex() {
48 public long getLastLogTerm() {