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()
ApplicationState
getLastEid
in interface ApplicationState
public boolean hasState()
ApplicationState
hasState
in interface ApplicationState
public void setSerializedState(byte[] state)
ApplicationState
setSerializedState
in interface ApplicationState
state
- a byte array that must be a representation of the application statepublic byte[] getSerializedState()
ApplicationState
getSerializedState
in interface ApplicationState
public byte[] getStateHash()
ApplicationState
getStateHash
in interface ApplicationState
public boolean equals(java.lang.Object obj)
ApplicationState
equals
in interface ApplicationState
equals
in class java.lang.Object
public int hashCode()
ApplicationState
hashCode
in interface ApplicationState
hashCode
in class java.lang.Object