public class CounterState extends java.lang.Object implements ApplicationState
| Constructor and Description |
|---|
CounterState()
Constructs a TansferableState
This constructor should be used when there isn't a valid state to construct the object with
|
CounterState(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 |
getLastEid()
The consensus of the last batch of commands which the application was given
|
byte[] |
getSerializedState()
Byte array that must be a representation of the application state
|
byte[] |
getStateHash()
Gets an secure hash of the application state
|
int |
hashCode()
This method MUST be implemented.
|
boolean |
hasState()
Indicates if the sender replica had the state requested by the recovering replica
|
void |
setSerializedState(byte[] state)
Sets a byte array that must be a representation of the application state
|
public CounterState(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 CounterState()
public int getLastEid()
ApplicationStategetLastEid in interface ApplicationStatepublic boolean hasState()
ApplicationStatehasState in interface ApplicationStatepublic 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 byte[] getStateHash()
ApplicationStategetStateHash in interface ApplicationStatepublic 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