public class CommitRequest extends Message
| Constructor and Description |
|---|
CommitRequest(int clusterId,
String senderId,
String recipientId,
long term,
long txId,
long baseTerm,
long baseIndex,
ByteBuffer readsData,
ByteBuffer mutationData)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
calculateSize()
Calculate an upper bound on the number of bytes required by
writeTo(). |
long |
getBaseIndex() |
long |
getBaseTerm() |
ByteBuffer |
getMutationData()
Get the transaction's mutations.
|
ByteBuffer |
getReadsData() |
long |
getTxId() |
boolean |
isReadOnly()
Determine whether this is a read-only transaction.
|
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 CommitRequest(int clusterId,
String senderId,
String recipientId,
long term,
long txId,
long baseTerm,
long baseIndex,
ByteBuffer readsData,
ByteBuffer mutationData)
clusterId - cluster IDsenderId - identity of senderrecipientId - identity of recipientterm - sender's current termtxId - sender's transaction IDbaseTerm - term of the log entry on which the transaction is basedbaseIndex - index of the log entry on which the transaction is basedreadsData - keys read during the transactionmutationData - transaction mutations, or null for nonepublic long getTxId()
public long getBaseTerm()
public long getBaseIndex()
public ByteBuffer getReadsData()
public boolean isReadOnly()
IllegalStateException - if getMutationData() has already been invokedpublic ByteBuffer getMutationData()
This method may only be invoked once.
IllegalStateException - if this method has already been invokedpublic void visit(MessageSwitch handler)
Messagepublic void writeTo(ByteBuffer dest)
Messageprotected int calculateSize()
MessagewriteTo().calculateSize in class MessageCopyright © 2016. All rights reserved.