public class RequestVote extends Message
| Constructor and Description |
|---|
RequestVote(int clusterId,
String senderId,
String recipientId,
long term,
long lastLogTerm,
long lastLogIndex)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
calculateSize()
Calculate an upper bound on the number of bytes required by
writeTo(). |
long |
getLastLogIndex() |
long |
getLastLogTerm() |
String |
toString() |
void |
visit(MessageSwitch handler)
Apply the visitor pattern based on this instance's type.
|
void |
writeTo(ByteBuffer dest)
Serialize this instance into the given buffer.
|
calculateSize, calculateSize, calculateSize, decode, encode, getBoolean, getByteBuffer, getClusterId, getReads, getRecipientId, getSenderId, getString, getTerm, getTimestamp, getWrites, isLeaderMessage, putBoolean, putByteBuffer, putReads, putString, putTimestamp, putWritespublic RequestVote(int clusterId,
String senderId,
String recipientId,
long term,
long lastLogTerm,
long lastLogIndex)
clusterId - cluster IDsenderId - identity of senderrecipientId - identity of recipientterm - sender's current termlastLogTerm - term of the sender's last log entrylastLogIndex - index of the sender's last log entrypublic long getLastLogTerm()
public long getLastLogIndex()
public void visit(MessageSwitch handler)
Messagepublic void writeTo(ByteBuffer dest)
Messageprotected int calculateSize()
MessagewriteTo().calculateSize in class MessageCopyright © 2016. All rights reserved.