public class InstallSnapshot extends Message
| Constructor and Description |
|---|
InstallSnapshot(int clusterId,
String senderId,
String recipientId,
long term,
long snapshotTerm,
long snapshotIndex,
long pairIndex,
Map<String,String> snapshotConfig,
boolean lastChunk,
ByteBuffer data)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
calculateSize()
Calculate an upper bound on the number of bytes required by
writeTo(). |
ByteBuffer |
getData() |
long |
getPairIndex() |
Map<String,String> |
getSnapshotConfig() |
long |
getSnapshotIndex() |
long |
getSnapshotTerm() |
boolean |
isLastChunk() |
boolean |
isLeaderMessage()
Determine whether this message is only sent by leaders.
|
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, putBoolean, putByteBuffer, putReads, putString, putTimestamp, putWritespublic InstallSnapshot(int clusterId,
String senderId,
String recipientId,
long term,
long snapshotTerm,
long snapshotIndex,
long pairIndex,
Map<String,String> snapshotConfig,
boolean lastChunk,
ByteBuffer data)
clusterId - cluster IDsenderId - identity of senderrecipientId - identity of recipientterm - sender's current termsnapshotTerm - term of the last log entry in the snapshotsnapshotIndex - index of the last log entry in the snapshotsnapshotConfig - cluster config of the last log entry in the snapshot (first pairIndex only)pairIndex - index of the first key/value pair in this chunklastChunk - true if this is the last chunk in the snapshotdata - encoded key/value pairspublic long getSnapshotTerm()
public long getSnapshotIndex()
public long getPairIndex()
public boolean isLastChunk()
public ByteBuffer getData()
public boolean isLeaderMessage()
MessageisLeaderMessage in class Messagepublic void visit(MessageSwitch handler)
Messagepublic void writeTo(ByteBuffer dest)
Messageprotected int calculateSize()
MessagewriteTo().calculateSize in class MessageCopyright © 2016. All rights reserved.