public class PaxosMessage extends SystemMessage
authenticated
Constructor and Description |
---|
PaxosMessage()
Creates a paxos message.
|
PaxosMessage(int paxosType,
int id,
int round,
int from)
Creates a paxos message.
|
PaxosMessage(int paxosType,
int id,
int round,
int from,
byte[] value)
Creates a paxos message.
|
PaxosMessage(int paxosType,
int id,
int round,
int from,
byte[] value,
java.lang.Object proof)
Creates a paxos message.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getMACVector()
Returns the proof associated with a PROPOSE or COLLECT message
|
int |
getNumber()
Returns the consensus execution ID of this message
|
int |
getPaxosType()
Returns this message type
|
java.lang.String |
getPaxosVerboseType()
Returns this message type as a verbose string
|
int |
getRound()
Retrieves the round number to which this message belongs
|
byte[] |
getValue()
Retrieves the weakly accepted, strongly accepted, decided, or proposed value.
|
void |
readExternal(java.io.ObjectInput in) |
void |
setMACVector(java.lang.Object proof) |
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput out) |
getSender
public PaxosMessage()
public PaxosMessage(int paxosType, int id, int round, int from, byte[] value, java.lang.Object proof)
paxosType
- This should be MessageFactory.COLLECT or MessageFactory.PROPOSEid
- Consensus's execution IDround
- Round numberfrom
- This should be this process IDvalue
- This should be null if its a COLLECT message, or the proposed value if it is a PROPOSE messageproof
- The proof to be sent by the leader for all replicaspublic PaxosMessage(int paxosType, int id, int round, int from, byte[] value)
paxosType
- This should be MessageFactory.WEAK, MessageFactory.STRONG or MessageFactory.DECIDEid
- Consensus's execution IDround
- Round numberfrom
- This should be this process IDvalue
- The value decided, or strongly/weakly acceptedpublic PaxosMessage(int paxosType, int id, int round, int from)
paxosType
- This should be MessageFactory.FREEZEid
- Consensus's execution IDround
- Round numberfrom
- This should be this process IDpublic void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class SystemMessage
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class SystemMessage
java.io.IOException
java.lang.ClassNotFoundException
public int getRound()
public byte[] getValue()
public void setMACVector(java.lang.Object proof)
public java.lang.Object getMACVector()
public int getNumber()
public int getPaxosType()
public java.lang.String getPaxosVerboseType()
public java.lang.String toString()
toString
in class java.lang.Object