public abstract class DefaultSingleRecoverable extends java.lang.Object implements Recoverable, SingleExecutable
Modifier and Type | Field and Description |
---|---|
protected ReplicaContext |
replicaContext |
Constructor and Description |
---|
DefaultSingleRecoverable() |
Modifier and Type | Method and Description |
---|---|
abstract byte[] |
appExecuteOrdered(byte[] command,
MessageContext msgCtx) |
byte[] |
computeHash(byte[] data) |
byte[] |
executeOrdered(byte[] command,
MessageContext msgCtx)
Method called to execute a request totally ordered.
|
abstract byte[] |
getSnapshot() |
ApplicationState |
getState(int eid,
boolean sendState)
This method should return a representation of the application state
|
StateManager |
getStateManager()
Recoverers implementing this interface will have to chose among
different options of state managers like DurableStateManager or
StandardStateManager.
|
protected void |
initLog() |
abstract void |
installSnapshot(byte[] state) |
void |
noOp(int lastEid) |
void |
setReplicaContext(ReplicaContext replicaCtx) |
int |
setState(ApplicationState recvState)
Sets the state to the representation obtained in the state transfer protocol
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeUnordered
protected ReplicaContext replicaContext
public byte[] executeOrdered(byte[] command, MessageContext msgCtx)
SingleExecutable
executeOrdered
in interface SingleExecutable
command
- the command issue by the clientmsgCtx
- information related with the commandpublic final byte[] computeHash(byte[] data)
public ApplicationState getState(int eid, boolean sendState)
Recoverable
getState
in interface Recoverable
eid
- Execution up to which the application should return an Application statesendState
- true if the replica should send a complete
representation of the state instead of only the hash. False otherwisepublic int setState(ApplicationState recvState)
Recoverable
setState
in interface Recoverable
recvState
- State obtained in the state transfer protocolpublic void setReplicaContext(ReplicaContext replicaCtx)
setReplicaContext
in interface Recoverable
public StateManager getStateManager()
Recoverable
getStateManager
in interface Recoverable
protected void initLog()
public void noOp(int lastEid)
noOp
in interface Recoverable
public abstract void installSnapshot(byte[] state)
public abstract byte[] getSnapshot()
public abstract byte[] appExecuteOrdered(byte[] command, MessageContext msgCtx)