public final class ExecutionManager
extends java.lang.Object
Constructor and Description |
---|
ExecutionManager(ServerViewController controller,
Acceptor acceptor,
Proposer proposer,
int me)
Creates a new instance of ExecutionManager
|
Modifier and Type | Method and Description |
---|---|
void |
addOutOfContextMessage(PaxosMessage m)
Stores a message established as being out of context (a message that
doesn't belong to current executing consensus).
|
boolean |
checkLimits(PaxosMessage msg)
Checks if this message can execute now.
|
void |
clearStopped() |
Acceptor |
getAcceptor()
Returns the acceptor role of the PaW algorithm
|
Execution |
getExecution(int eid)
Returns the specified consensus' execution
|
Proposer |
getProposer() |
java.util.Queue<PaxosMessage> |
getStoppedMsgs() |
TOMLayer |
getTOMLayer()
Returns the TOM layer associated with this execution manager
|
boolean |
isDecidable(int eid) |
void |
processOutOfContext(Execution execution) |
void |
processOutOfContextPropose(Execution execution) |
boolean |
receivedOutOfContextPropose(int eid)
Informs if there are messages till to be processed associated the specified consensus's execution
|
Execution |
removeExecution(int id)
Removes a consensus's execution from this manager
|
void |
removeOutOfContexts(int id)
THIS IS JOAO'S CODE, FOR HANDLING THE STATE TRANSFER
|
void |
restart()
Restarts this execution manager
|
void |
setTOMLayer(TOMLayer tom)
Sets the TOM layer associated with this execution manager
|
void |
stop()
Stops this execution manager
|
boolean |
stopped() |
java.lang.String |
toString() |
public ExecutionManager(ServerViewController controller, Acceptor acceptor, Proposer proposer, int me)
acceptor
- Acceptor role of the PaW algorithmproposer
- Proposer role of the PaW algorithmacceptors
- Process ID's of all replicas, including this onef
- Maximum number of replicas that can be faultyme
- This process IDinitialTimeout
- initial timeout for roundspublic void setTOMLayer(TOMLayer tom)
tom
- The TOM layer associated with this execution managerpublic TOMLayer getTOMLayer()
public Acceptor getAcceptor()
public Proposer getProposer()
public boolean stopped()
public java.util.Queue<PaxosMessage> getStoppedMsgs()
public void clearStopped()
public void stop()
public void restart()
public final boolean checkLimits(PaxosMessage msg)
msg
- the received messagepublic boolean receivedOutOfContextPropose(int eid)
eid
- The ID for the consensus execution in questionpublic Execution removeExecution(int id)
id
- ID of the consensus's execution to be removedpublic void removeOutOfContexts(int id)
public Execution getExecution(int eid)
eid
- ID of the consensus execution to be returnedpublic boolean isDecidable(int eid)
public void processOutOfContextPropose(Execution execution)
public void processOutOfContext(Execution execution)
public void addOutOfContextMessage(PaxosMessage m)
m
- Out of context message to be storedpublic java.lang.String toString()
toString
in class java.lang.Object