Package bftsmart.tom.server
Interface Recoverable
- 
- All Known Implementing Classes:
- CounterServer,- DefaultRecoverable,- DefaultSingleRecoverable,- DurabilityCoordinator,- MapServer,- RecoveryTestServer,- SimpleServiceServer,- ThroughputLatencyServer,- ThroughputLatencyServer,- YCSBServer
 
 public interface RecoverableClasses that implement this interface should implement a state transfer protocol. Typically, classes should both implement this interface and one of the executables.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description ApplicationStategetState(int cid, boolean sendState)This method should return a representation of the application stateStateManagergetStateManager()Recoverers implementing this interface will have to chose among different options of state managers like DurableStateManager or StandardStateManager.voidnoOp(int CID, byte[][] operations, MessageContext[] msgCtx)This method is invoked by ServiceReplica to indicate that a consensus instance finished without delivering anything to the application (e.g., an instance only decided a single reconfiguration operation. or an instance where the client operation was not delivered because its view was outdated).voidOp(int CID, byte[] requests, MessageContext msgCtx)This method is invoked by ServiceReplica to pass information that was decided in a particular consensus instance.voidsetClientsManager(ClientsManager clientsManager)Recoverers implement this interface to access and save replies from the ClientManager as replies need to be transfered to a recovering replica as part of its replica state (which is enriched by a replies storage object) To access the clientManager, the recoverer needs to set its referencevoidsetReplicaContext(ReplicaContext replicaContext)Sets the replica contextintsetState(ApplicationState state)Sets the state to the representation obtained in the state transfer protocol
 
- 
- 
- 
Method Detail- 
setReplicaContextvoid setReplicaContext(ReplicaContext replicaContext) Sets the replica context- Parameters:
- replicaContext- The replica context
 
 - 
getStateApplicationState getState(int cid, boolean sendState) This method should return a representation of the application state- Parameters:
- cid- Consensus up to which the application should return an Application state
- sendState- true if the replica should send a complete representation of the state instead of only the hash. False otherwise
- Returns:
- A representation of the application state
 
 - 
setStateint setState(ApplicationState state) Sets the state to the representation obtained in the state transfer protocol- Parameters:
- state- State obtained in the state transfer protocol
- Returns:
 
 - 
getStateManagerStateManager getStateManager() Recoverers implementing this interface will have to chose among different options of state managers like DurableStateManager or StandardStateManager. The recoverer class can also define a new strategy to manage the state and return it in this method.- Returns:
- the implementation of state manager that suplies the strategy defined
 
 - 
setClientsManagervoid setClientsManager(ClientsManager clientsManager) Recoverers implement this interface to access and save replies from the ClientManager as replies need to be transfered to a recovering replica as part of its replica state (which is enriched by a replies storage object) To access the clientManager, the recoverer needs to set its reference
 - 
Opvoid Op(int CID, byte[] requests, MessageContext msgCtx)This method is invoked by ServiceReplica to pass information that was decided in a particular consensus instance. This method is always invoked before the executor. However, multiple invocations for the same consensus ID may occur, so developers must take this behavior into consideration when developing their own logging and checkpointing. If there is no information to be passed to the application, noOp(...) is invoked instead.- Parameters:
- CID- the consensus instance ID associated with the request
- requests- A request decided in CID
- msgCtx- Message context associated with the client request and the consensus instance where it was ordered. msgCtx.getConsensusId() will be equal to CID.
 
 - 
noOpvoid noOp(int CID, byte[][] operations, MessageContext[] msgCtx)This method is invoked by ServiceReplica to indicate that a consensus instance finished without delivering anything to the application (e.g., an instance only decided a single reconfiguration operation. or an instance where the client operation was not delivered because its view was outdated). To allow the underlying state transfer protocol to execute correctly, it needs to be notified of this special case In the current protocols included, it suffices to register a NOOP operation in the logs used within the state transfer, but never deliver it to the application- Parameters:
- CID- the consensus instance where the aforementioned condition occurred
- operations- Operations decided in CID
- msgCtx- Message context associated with the consensus instance. furthermore msgCtx.getConsensusId() will be equal to CID.
 
 
- 
 
-