infoservice.agreement.paxos
Class PaxosExecution

java.lang.Object
  extended by infoservice.agreement.paxos.PaxosObject
      extended by infoservice.agreement.paxos.PaxosExecution

public class PaxosExecution
extends PaxosObject


Field Summary
private  boolean m_decided
          Indicator if this execution has been decided
private  java.lang.String m_initiator
          The identifier for this execution
private  PaxosInstance m_paxosInstance
          The PaxosInstance this execution belongs to
private  java.util.Vector m_roundLeaders
           
private  java.util.Hashtable m_rounds
          A Hashtable of all active rounds for this execution
 
Constructor Summary
PaxosExecution(PaxosInstance a_instance, java.lang.String a_initiator, java.util.Vector a_roundLeaders)
          Creates a new PaxosExecution within the given PaxosInstance for the given initiator.
 
Method Summary
 void cancel()
          Aborts all active rounds
 PaxosRound createRound()
          Creates a PaxosRound with round number 0
 PaxosRound createRound(int a_round)
          Creates and returns a new PaxosRound with the given round number
 void decide(java.lang.String a_proposal)
          Decides the given proposal for this execution
 java.lang.String getGoodProposal(int a_nextRound)
          Returns a "good" (see Paxos at War) proposal for this execution A proposal is p good if a) There is no pending decission, i.e.
 java.lang.String getInitiator()
          Returns this executions initiators id
 java.lang.String getNextRoundLeader(int a_round)
          Returns the ID of the next rounds leader.
 PaxosInstance getPaxosInstance()
          Returns the PaxosInstance this execution belongs to
 PaxosRound getRound(int a_round)
          Returns the round with the given round number or null if there is no such round exists
 boolean isDecided()
          Indicates if this execution has been decided
 
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

m_initiator

private java.lang.String m_initiator
The identifier for this execution


m_rounds

private java.util.Hashtable m_rounds
A Hashtable of all active rounds for this execution


m_paxosInstance

private PaxosInstance m_paxosInstance
The PaxosInstance this execution belongs to


m_roundLeaders

private java.util.Vector m_roundLeaders

m_decided

private boolean m_decided
Indicator if this execution has been decided

Constructor Detail

PaxosExecution

public PaxosExecution(PaxosInstance a_instance,
                      java.lang.String a_initiator,
                      java.util.Vector a_roundLeaders)
Creates a new PaxosExecution within the given PaxosInstance for the given initiator. A PaxosRound with round number 0 is also created and its timeout is started

Parameters:
a_instance - The instance to which the Execution belongs
a_initiator - The initiator of this execution
Method Detail

getRound

public PaxosRound getRound(int a_round)
Returns the round with the given round number or null if there is no such round exists

Parameters:
a_round - The round number
Returns:
The corresponding PaxosRound or null if no such round exists

createRound

public PaxosRound createRound(int a_round)
Creates and returns a new PaxosRound with the given round number

Parameters:
a_round - The number of the newly created round
Returns:
The newly created PaxosRound

createRound

public PaxosRound createRound()
Creates a PaxosRound with round number 0

Returns:
A PaxosRound with round number 0

getInitiator

public java.lang.String getInitiator()
Returns this executions initiators id

Returns:
This executions initiators id

getPaxosInstance

public PaxosInstance getPaxosInstance()
Returns the PaxosInstance this execution belongs to

Returns:
he PaxosInstance this execution belongs to

cancel

public void cancel()
Aborts all active rounds


decide

public void decide(java.lang.String a_proposal)
Decides the given proposal for this execution

Parameters:
proposal - The proposal that will be decided

isDecided

public boolean isDecided()
Indicates if this execution has been decided

Returns:
true if decided, false otherwise

getNextRoundLeader

public java.lang.String getNextRoundLeader(int a_round)
Returns the ID of the next rounds leader. This will only be needed if the previous round gets frozen

Parameters:
a_round - The round number of the current round
Returns:
The ID of the next rounds leader

getGoodProposal

public java.lang.String getGoodProposal(int a_nextRound)
Returns a "good" (see Paxos at War) proposal for this execution A proposal is p good if a) There is no pending decission, i.e. the set Poss is empty in all rounds and p = "NULL" b) p is in acc in some round i and in poss in all rounds i \<= k \< a_nextRound

Returns:
A good proposal for this round