public class MessageFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ACCEPT |
static int |
COLLECT |
static int |
PROPOSE |
static int |
WRITE |
Constructor and Description |
---|
MessageFactory(int from)
Creates a message factory
|
Modifier and Type | Method and Description |
---|---|
PaxosMessage |
createAccept(int id,
int round,
byte[] value)
Creates a WRITE message to be sent by this process
|
PaxosMessage |
createPropose(int id,
int round,
byte[] value)
Creates a PROPOSE message to be sent by this process
|
PaxosMessage |
createWrite(int id,
int round,
byte[] value)
Creates a WRITE message to be sent by this process
|
public static final int PROPOSE
public static final int WRITE
public static final int ACCEPT
public static final int COLLECT
public MessageFactory(int from)
from
- Replica ID of the process which sent this messagepublic PaxosMessage createPropose(int id, int round, byte[] value)
id
- Consensus's execution IDround
- Round numbervalue
- Proposed valueproof
- Proofs from other replicaspublic PaxosMessage createWrite(int id, int round, byte[] value)
id
- Consensus's execution IDround
- Round numbervalue
- Write valuepublic PaxosMessage createAccept(int id, int round, byte[] value)
id
- Consensus's execution IDround
- Round numbervalue
- Accepted value