public final class CounterServer extends java.lang.Object implements BatchExecutable, Recoverable
Constructor and Description |
---|
CounterServer(int id) |
CounterServer(int id,
boolean join) |
Modifier and Type | Method and Description |
---|---|
byte[] |
execute(byte[] command,
MessageContext msgCtx) |
byte[][] |
executeBatch(byte[][] commands,
MessageContext[] msgCtxs)
Execute a batch of requests.
|
byte[] |
executeUnordered(byte[] command,
MessageContext msgCtx)
Method called to execute a request totally ordered.
|
ApplicationState |
getState(int eid,
boolean sendState)
THIS IS JOAO'S CODE, TO HANDLE CHECKPOINTS
|
StateManager |
getStateManager()
Recoverers implementing this interface will have to chose among
different options of state managers like DurableStateManager or
StandardStateManager.
|
static void |
main(java.lang.String[] args) |
void |
setReplicaContext(ReplicaContext replicaContext) |
int |
setState(ApplicationState state)
Sets the state to the representation obtained in the state transfer protocol
|
public CounterServer(int id)
public CounterServer(int id, boolean join)
public void setReplicaContext(ReplicaContext replicaContext)
setReplicaContext
in interface Recoverable
public byte[][] executeBatch(byte[][] commands, MessageContext[] msgCtxs)
BatchExecutable
executeBatch
in interface BatchExecutable
public byte[] executeUnordered(byte[] command, MessageContext msgCtx)
Executable
executeUnordered
in interface Executable
command
- the command issue by the clientmsgCtx
- information related with the commandpublic byte[] execute(byte[] command, MessageContext msgCtx)
public static void main(java.lang.String[] args)
public ApplicationState getState(int eid, boolean sendState)
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 state)
Recoverable
setState
in interface Recoverable
state
- State obtained in the state transfer protocolpublic StateManager getStateManager()
Recoverable
getStateManager
in interface Recoverable