public class LeaderModule
extends java.lang.Object
Constructor and Description |
---|
LeaderModule()
Creates a new instance of LeaderModule
|
Modifier and Type | Method and Description |
---|---|
void |
addLeaderInfo(int c,
int r,
int l)
Adds information about a leader
|
void |
decided(int c,
int l)
Invoked by the acceptor object when a value is decided
It adds a new tuple to the list, which corresponds to the next consensus
|
int |
getCurrentLeader()
Get the current leader
|
int |
getLeader(int c,
int r)
Retrieves the replica ID of the leader for the specified consensus's execution ID and round number
TODO: This is more than a getter.
|
void |
removeStableConsenusInfos(int c) |
void |
removeStableMultipleConsenusInfos(int cStart,
int cEnd) |
void |
setNewLeader(int leader) |
public void addLeaderInfo(int c, int r, int l)
c
- Consensus where the replica is a leaderr
- Rounds of the consensus where the replica is a leaderl
- ID of the leaderpublic void setNewLeader(int leader)
public int getCurrentLeader()
public void decided(int c, int l)
c
- ID of the consensus established as being decidedl
- ID of the replica established as being the leader for the round 0 of the next consensuspublic int getLeader(int c, int r)
c
- consensus's execution IDr
- Round number for the specified consensuspublic void removeStableConsenusInfos(int c)
public void removeStableMultipleConsenusInfos(int cStart, int cEnd)