|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object infoservice.agreement.paxos.PaxosObject infoservice.agreement.paxos.PaxosRound
public class PaxosRound
Field Summary | |
---|---|
private boolean |
m_aborted
|
private boolean |
m_collected
|
private java.lang.String |
m_decided
|
private java.util.Hashtable |
m_decideMessages
|
private PaxosExecution |
m_execution
|
private boolean |
m_freezed
|
private java.util.Vector |
m_freezeMessages
|
private java.util.Vector |
m_freezeProofMessages
|
private java.lang.String |
m_leaderId
|
private PaxosMessage |
m_proposal
|
private int |
m_roundNumber
|
private java.lang.String |
m_strongAccepted
|
private java.util.Hashtable |
m_strongMessages
|
private TimeoutThread |
m_timeout
|
private java.lang.String |
m_weakAccepted
|
private java.util.Hashtable |
m_weakMessages
|
Constructor Summary | |
---|---|
PaxosRound(PaxosExecution a_execution,
int a_round,
java.lang.String a_leaderId)
Creates a new PaxosRound within the given PaxosExecution with the given round number and the given leaderId |
Method Summary | |
---|---|
void |
abort()
Aborts this round |
boolean |
acc(java.lang.String a_proposal)
Calculates if the given proposal belongs to the set Acc (see Paxos at War) |
boolean |
addCollectMessage(CollectMessage a_msg)
Adds a CollectMessage to this round. |
boolean |
addDecideMessage(PaxosMessage a_msg)
Adds a DecideMessage to this round |
boolean |
addFreezeMessage(PaxosMessage a_msg)
Adds a FreezeMessage to this round |
private boolean |
addMessage(java.util.Hashtable a_messages,
PaxosMessage a_msg)
Does some message checking and then adds the given message to the given hashtable |
boolean |
addProof(FreezeProofMessage a_msg)
Adds a FreezeProofMessage to this round. |
boolean |
addProposal(PaxosMessage a_msg)
Adds a proposal for tihs round |
boolean |
addStrongMessage(PaxosMessage a_msg)
Adds a StrongMessage to this round |
boolean |
addWeakMessage(PaxosMessage a_msg)
Adds a WeakMessage to this round |
void |
decide(java.lang.String a_proposal)
Decides on the given value. |
void |
freeze()
Freezes this round. |
java.util.Vector |
getAcc()
Returns the set Acc for this round |
int |
getDecideMessageCount(java.lang.String a_proposal)
Returns the number of decide-messages received for the given proposal |
PaxosExecution |
getExecution()
Returns the PaxosExecution this round belongs to |
int |
getFreezeMessageCount()
Returns the nunmber of totally received freeze messages |
int |
getFreezeProofMessageCount()
Returns the number of FreezeProofMessages received in this round |
java.util.Vector |
getFreezeProofs()
Returns the FreezeProofMessages for tihs round |
java.lang.String |
getLeaderId()
Returns the ID of the leader of thi round |
java.util.Vector |
getPoss()
Returns the set Poss for this round |
int |
getRoundNumber()
Returns the round number of this round |
java.lang.String |
getStrongAccepted()
Returns the value which has been strongly accepted |
int |
getStrongMessageCount(java.lang.String a_proposal)
Returns the number of strong-messages received for the given proposal |
int |
getTotalDecideMessageCount()
Returns the nunmber of totally received decide messages |
java.lang.String |
getWeakAccepted()
Returns the value which has been weakly accepted |
int |
getWeakMessageCount(java.lang.String a_proposal)
Returns the number of weak-messages received for the given proposal |
boolean |
isAborted()
Indicates if this round has been aborted |
boolean |
isDecided()
Indicates of this round has been decided |
boolean |
isFrozen()
Indicates if this round has been frozen |
boolean |
isGood(java.lang.String a_value)
Indicates if the given value is "good" (see Paxos at War) |
boolean |
isStrongAccepted()
Indicates if we have strongly accepted a proposal in this round |
boolean |
isWeakAccepted()
Indicates if there is a weakly accepted value for this round |
boolean |
poss(java.lang.String a_proposal)
Calculates if the given proposal belongs to the set Poss (see Paxos at War) |
void |
strongAccept(java.lang.String a_proposal)
Strongly accepts the given proposal |
void |
weakAccept(java.lang.String a_proposal)
Weakly accepts the given proposal |
Methods inherited from class infoservice.agreement.paxos.PaxosObject |
---|
debug, error, fatal, getLog, info, setLog |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private TimeoutThread m_timeout
private PaxosMessage m_proposal
private java.util.Hashtable m_weakMessages
private java.util.Hashtable m_strongMessages
private java.util.Hashtable m_decideMessages
private java.util.Vector m_freezeMessages
private java.util.Vector m_freezeProofMessages
private PaxosExecution m_execution
private java.lang.String m_weakAccepted
private java.lang.String m_strongAccepted
private boolean m_freezed
private int m_roundNumber
private java.lang.String m_leaderId
private java.lang.String m_decided
private boolean m_collected
private boolean m_aborted
Constructor Detail |
---|
public PaxosRound(PaxosExecution a_execution, int a_round, java.lang.String a_leaderId)
a_execution
- The PaxosExecution this round belongs toa_round
- The round numbera_leaderId
- The leaders idMethod Detail |
---|
public java.lang.String getLeaderId()
public int getRoundNumber()
public boolean addProposal(PaxosMessage a_msg)
a_msg
- The ProposeMessage to be added
public PaxosExecution getExecution()
public boolean addWeakMessage(PaxosMessage a_msg)
a_msg
- The message to be added
public boolean addStrongMessage(PaxosMessage a_msg)
a_msg
- The message to be added
public boolean addDecideMessage(PaxosMessage a_msg)
a_msg
- The message to be added
public boolean addFreezeMessage(PaxosMessage a_msg)
a_msg
- The message to be added
public void weakAccept(java.lang.String a_proposal)
a_proposal
- The proposal to be weakly acceptedpublic void strongAccept(java.lang.String a_proposal)
a_proposal
- The proposal to be strongly acceptedpublic java.lang.String getWeakAccepted()
public java.lang.String getStrongAccepted()
public boolean isWeakAccepted()
public int getWeakMessageCount(java.lang.String a_proposal)
a_proposal
- The proposal to be checked
public int getStrongMessageCount(java.lang.String a_proposal)
a_proposal
- The proposal to be checked
public int getDecideMessageCount(java.lang.String a_proposal)
a_proposal
- The proposal to be checked
public int getTotalDecideMessageCount()
public int getFreezeMessageCount()
private boolean addMessage(java.util.Hashtable a_messages, PaxosMessage a_msg)
a_messages
- The message to be addeda_msg
- The hashtable the message should be added to
public void decide(java.lang.String a_proposal)
a_proposal
- The proposal to decide topublic boolean isDecided()
public boolean isStrongAccepted()
public void freeze()
public boolean isFrozen()
public boolean addProof(FreezeProofMessage a_msg)
a_msg
- The FreezeProofMessage to be added
public int getFreezeProofMessageCount()
public boolean acc(java.lang.String a_proposal)
a_proposal
- The proposal to checkpublic java.util.Vector getAcc()
public java.util.Vector getPoss()
public boolean poss(java.lang.String a_proposal)
a_proposal
- The proposal to checkpublic boolean isGood(java.lang.String a_value)
a_value
- The value to be tested
public java.util.Vector getFreezeProofs()
public boolean addCollectMessage(CollectMessage a_msg)
a_msg
- The CollectMessage to be added
public boolean isAborted()
public void abort()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |