public class DefaultApplicationState extends java.lang.Object implements ApplicationState
| Constructor and Description |
|---|
DefaultApplicationState()
Constructs a TansferableState
This constructor should be used when there isn't a valid state to construct the object with
|
DefaultApplicationState(CommandsInfo[] messageBatches,
byte[] logHash,
int lastCheckpointEid,
int lastCheckpointRound,
int lastCheckpointLeader,
int lastEid,
byte[] state,
byte[] stateHash) |
DefaultApplicationState(CommandsInfo[] messageBatches,
int lastCheckpointEid,
int lastCheckpointRound,
int lastCheckpointLeader,
int lastEid,
byte[] state,
byte[] stateHash)
Constructs a TansferableState
This constructor should be used when there is a valid state to construct the object with
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
This method MUST be implemented.
|
int |
getLastCheckpointEid()
Retrieves the execution ID for the last checkpoint
|
int |
getLastCheckpointLeader()
Retrieves the leader for the last checkpoint
|
int |
getLastCheckpointRound()
Retrieves the decision round for the last checkpoint
|
int |
getLastEid()
Retrieves the execution ID for the last messages batch delivered to the application
|
CommandsInfo |
getMessageBatch(int eid)
Retrieves the specified batch of messages
|
CommandsInfo[] |
getMessageBatches()
Retrieves all batches of messages
|
byte[] |
getSerializedState()
Byte array that must be a representation of the application state
|
byte[] |
getState()
Retrieves the state associated with the last checkpoint
|
byte[] |
getStateHash()
Retrieves the hash of the state associated with the last checkpoint
|
int |
hashCode()
This method MUST be implemented.
|
boolean |
hasState()
Indicates if the TransferableState object has a valid state
|
void |
setMessageBatches(CommandsInfo[] messageBatches) |
void |
setSerializedState(byte[] state)
Sets a byte array that must be a representation of the application state
|
void |
setState(byte[] state)
Sets the state associated with the last checkpoint
|
public DefaultApplicationState(CommandsInfo[] messageBatches, int lastCheckpointEid, int lastCheckpointRound, int lastCheckpointLeader, int lastEid, byte[] state, byte[] stateHash)
messageBatches - Batches received since the last checkpoint.state - State associated with the last checkpointstateHash - Hash of the state associated with the last checkpointpublic DefaultApplicationState(CommandsInfo[] messageBatches, byte[] logHash, int lastCheckpointEid, int lastCheckpointRound, int lastCheckpointLeader, int lastEid, byte[] state, byte[] stateHash)
public DefaultApplicationState()
public void setSerializedState(byte[] state)
ApplicationStatesetSerializedState in interface ApplicationStatestate - a byte array that must be a representation of the application statepublic byte[] getSerializedState()
ApplicationStategetSerializedState in interface ApplicationStatepublic boolean hasState()
hasState in interface ApplicationStatepublic int getLastEid()
getLastEid in interface ApplicationStatepublic byte[] getState()
public byte[] getStateHash()
getStateHash in interface ApplicationStatepublic void setState(byte[] state)
state - State associated with the last checkpointpublic CommandsInfo[] getMessageBatches()
public void setMessageBatches(CommandsInfo[] messageBatches)
public CommandsInfo getMessageBatch(int eid)
eid - Execution ID associated with the batch to be fetchedpublic int getLastCheckpointEid()
public int getLastCheckpointRound()
public int getLastCheckpointLeader()
public boolean equals(java.lang.Object obj)
ApplicationStateequals in interface ApplicationStateequals in class java.lang.Objectpublic int hashCode()
ApplicationStatehashCode in interface ApplicationStatehashCode in class java.lang.Object