public class DurableStateLog extends StateLog
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DIR |
Constructor and Description |
---|
DurableStateLog(int id,
byte[] initialState,
byte[] initialHash,
boolean isToLog,
boolean syncLog,
boolean syncCkp) |
Modifier and Type | Method and Description |
---|---|
void |
addMessageBatch(byte[][] commands,
MessageContext[] msgCtx,
int round,
int leader,
int consensusId)
Adds a message batch to the log.
|
CSTState |
getState(CSTRequest cstRequest) |
protected CSTState |
loadDurableState() |
void |
newCheckpoint(byte[] state,
byte[] stateHash,
int consensusId)
Sets the state associated with the last checkpoint, and updates the execution ID associated with it
|
void |
setLastEid(int eid,
int checkpointPeriod,
int checkpointPortion) |
void |
transferApplicationState(java.nio.channels.SocketChannel sChannel,
int eid) |
void |
update(CSTState state)
Updates this log, according to the information contained in the
TransferableState object
|
addMessageBatch, getApplicationState, getLastCheckpointEid, getLastCheckpointLeader, getLastCheckpointRound, getLastEid, getMessageBatch, getMessageBatches, getNumBatches, getState, getStateHash, setLastCheckpointEid, setLastCheckpointLeader, setLastCheckpointRound, setLastEid, update
public DurableStateLog(int id, byte[] initialState, byte[] initialHash, boolean isToLog, boolean syncLog, boolean syncCkp)
public void addMessageBatch(byte[][] commands, MessageContext[] msgCtx, int round, int leader, int consensusId)
commands
- The batch of messages to be kept.round
- the round in which the messages were orderedleader
- the leader by the moment the messages were orderedconsensusId
- the consensus id added to the batchpublic void newCheckpoint(byte[] state, byte[] stateHash, int consensusId)
StateLog
newCheckpoint
in class StateLog
state
- State associated with the last checkpointpublic CSTState getState(CSTRequest cstRequest)
public void transferApplicationState(java.nio.channels.SocketChannel sChannel, int eid)
public void setLastEid(int eid, int checkpointPeriod, int checkpointPortion)
public void update(CSTState state)
transState
- TransferableState object containing the information which is
used to updated this logprotected CSTState loadDurableState()