|
|||||||||
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.PaxosCommunicator infoservice.agreement.paxos.PaxosProposer infoservice.agreement.paxos.PaxosAcceptor infoservice.agreement.paxos.integration.PaxosAdapter
public abstract class PaxosAdapter
Nested Class Summary | |
---|---|
(package private) class |
PaxosAdapter.AgreementStarterThread
The AgreementStarterThread looks from time to time if the next agreement has to be startet. |
Field Summary | |
---|---|
protected java.util.Hashtable |
m_commitments
|
protected int |
m_currentState
|
protected Commitment |
m_ownCommitment
|
protected java.util.Vector |
m_passivelyReceivedMessages
|
protected java.util.Vector |
m_potentialyCorrectMessage
|
(package private) PaxosAdapter.AgreementStarterThread |
m_starterThread
|
private static int |
STATE_COMMITMENT
|
private static int |
STATE_INACTIVE
|
private static int |
STATE_PASSIVE
|
private static int |
STATE_PHASE_GAP
|
private static int |
STATE_REVEAL
|
Fields inherited from class infoservice.agreement.paxos.PaxosAcceptor |
---|
m_paxosInstances |
Fields inherited from class infoservice.agreement.paxos.PaxosProposer |
---|
m_lastRandom |
Fields inherited from class infoservice.agreement.paxos.PaxosCommunicator |
---|
m_targets |
Constructor Summary | |
---|---|
protected |
PaxosAdapter()
Creates a new PaxosAdapter and starts the AgreementStarterThread for starting agreement at a specific time |
Method Summary | |
---|---|
private void |
babylonianConfusion()
If something went terribly wrong, this gets called. |
void |
handleIncommingMessage(PaxosMessage a_msg)
Handles an incomming message. |
void |
handleMessage(PaxosMessage a_msg)
Handles the message by passing it to the underlying PaxosAcceptor |
protected void |
notifyAgreement(java.util.Hashtable a_agreements)
This gets called when an agreement has been reached, i.e. |
void |
notifyReject(java.lang.String a_newRound)
Callback for the RejectManager. |
protected abstract void |
prepareTargets()
|
protected boolean |
roundNrAcceptable(PaxosMessage a_msg)
Tests if the PaxosInstance-identifier in this messages is acceptable, i.e. |
protected boolean |
senderNotInSnapshot(PaxosMessage a_msg)
Tests if the sender of this message is in the snapshot for the current PaxosInstance. |
protected void |
sendReject(PaxosMessage a_msg)
Sends a RejectMessage to the sender of the given message. |
void |
startAgreement()
Starts the protocol by proposing a value to the others |
void |
startPassivePhase()
Starts the passive phase of the protocol. |
void |
startProtocolByOperator()
Manually start an agreement |
void |
startRound()
Starts a PaxosExection for all known IPaxosTargets so that timeouts are synchronized |
protected abstract void |
useAgreement(long a_agreement)
What shall we do with an agreement? You can define it here |
Methods inherited from class infoservice.agreement.paxos.PaxosAcceptor |
---|
addMessage, getPaxosInstance, getRoundLeaders, timeout |
Methods inherited from class infoservice.agreement.paxos.PaxosProposer |
---|
propose, setRound |
Methods inherited from class infoservice.agreement.paxos.PaxosCommunicator |
---|
getF, getIdentifier, getN, getQuorumDecideStrong, getQuorumDecideWeak, getQuorumStrong, getQuorumTwoThird, getTargets, multicast, sendMessage, sendMessage, setTargets |
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 static final int STATE_INACTIVE
private static final int STATE_PASSIVE
private static final int STATE_COMMITMENT
private static final int STATE_PHASE_GAP
private static final int STATE_REVEAL
protected java.util.Hashtable m_commitments
protected Commitment m_ownCommitment
protected java.util.Vector m_passivelyReceivedMessages
protected java.util.Vector m_potentialyCorrectMessage
PaxosAdapter.AgreementStarterThread m_starterThread
protected int m_currentState
Constructor Detail |
---|
protected PaxosAdapter()
Method Detail |
---|
protected abstract void prepareTargets()
public void startProtocolByOperator()
public void startAgreement()
public void startRound()
protected boolean roundNrAcceptable(PaxosMessage a_msg)
a_msg
- The message to be tested
protected boolean senderNotInSnapshot(PaxosMessage a_msg)
a_msg
- The message whose sender should be checked
protected void sendReject(PaxosMessage a_msg)
a_msg
- The message whose sender will receive a RejectMessagepublic void handleIncommingMessage(PaxosMessage a_msg)
a_msg
- The message to be handledpublic void handleMessage(PaxosMessage a_msg)
a_msg
- The message to be handledpublic void notifyReject(java.lang.String a_newRound)
a_newRound
- private void babylonianConfusion()
protected void notifyAgreement(java.util.Hashtable a_agreements)
notifyAgreement
in class PaxosAcceptor
a_agreements
- Map of execution-identifier to decissionpublic void startPassivePhase()
protected abstract void useAgreement(long a_agreement)
a_agreement
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |