public class DiskStateLog extends StateLog
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DIR |
Constructor and Description |
---|
DiskStateLog(int id,
byte[] initialState,
byte[] initialHash,
boolean isToLog,
boolean syncLog,
boolean syncCkp) |
Modifier and Type | Method and Description |
---|---|
void |
addMessageBatch(byte[][] commands,
int round,
int leader,
int consensusId)
Adds a message batch to the log.
|
DefaultApplicationState |
getApplicationState(int eid,
boolean sendState)
Constructs a TransferableState using this log information
|
protected ApplicationState |
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(DefaultApplicationState transState)
Updates this log, according to the information contained in the
TransferableState object
|
getLastCheckpointEid, getLastCheckpointLeader, getLastCheckpointRound, getLastEid, getMessageBatch, getMessageBatches, getNumBatches, getState, getStateHash, setLastCheckpointEid, setLastCheckpointLeader, setLastCheckpointRound, setLastEid
public DiskStateLog(int id, byte[] initialState, byte[] initialHash, boolean isToLog, boolean syncLog, boolean syncCkp)
public void addMessageBatch(byte[][] commands, int round, int leader, int consensusId)
addMessageBatch
in class StateLog
batch
- The batch of messages to be kept.public void newCheckpoint(byte[] state, byte[] stateHash, int consensusId)
StateLog
newCheckpoint
in class StateLog
state
- State associated with the last checkpointpublic DefaultApplicationState getApplicationState(int eid, boolean sendState)
getApplicationState
in class StateLog
eid
- Execution ID correspondent to desired statepublic void transferApplicationState(java.nio.channels.SocketChannel sChannel, int eid)
public void setLastEid(int eid, int checkpointPeriod, int checkpointPortion)
public void update(DefaultApplicationState transState)
protected ApplicationState loadDurableState()