infoservice.agreement.paxos
Class PaxosInstance

java.lang.Object
  extended by infoservice.agreement.paxos.PaxosObject
      extended by infoservice.agreement.paxos.PaxosInstance
Direct Known Subclasses:
InfoServicePaxosInstance

public class PaxosInstance
extends PaxosObject


Field Summary
private  PaxosAcceptor m_acceptor
          The PaxosAcceptor to which this instance belongs
private  java.util.Hashtable m_decissions
          A hashtable containing the decissions of this instance, execution-id mapped to decission
protected  java.util.Hashtable m_executions
          A hashtable containing all executions which belong to this instance
private  java.lang.String m_instanceNumber
          The identifier of this instance.
private  boolean m_notified
           
 
Constructor Summary
PaxosInstance(PaxosAcceptor a_acceptor, java.lang.String a_instanceNumber)
          Creates a new PaxosInstance for the given PaxosAcceptor and the given instance number
 
Method Summary
 void addDecision(java.lang.String a_initiator, java.lang.String a_value)
          Adds the decission for the given initiator
 PaxosAcceptor getAcceptor()
          Returns the PaxosAcceptor this instance belongs to
 java.util.Hashtable getDecissions()
          Returns a hashtable containing the decissions of this instance.
 PaxosExecution getExecution(PaxosMessage a_msg)
          Returns the PaxosExecution atching the given message
 java.util.Hashtable getExecutions()
          Returns a Hashtable containing all Executions of this round
 java.lang.String getInstanceNumber()
          Returns the round number of this round
 
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_decissions

private java.util.Hashtable m_decissions
A hashtable containing the decissions of this instance, execution-id mapped to decission


m_executions

protected java.util.Hashtable m_executions
A hashtable containing all executions which belong to this instance


m_instanceNumber

private java.lang.String m_instanceNumber
The identifier of this instance.


m_acceptor

private PaxosAcceptor m_acceptor
The PaxosAcceptor to which this instance belongs


m_notified

private boolean m_notified
Constructor Detail

PaxosInstance

public PaxosInstance(PaxosAcceptor a_acceptor,
                     java.lang.String a_instanceNumber)
Creates a new PaxosInstance for the given PaxosAcceptor and the given instance number

Parameters:
a_acceptor - The PaxosAcceptor to which this instance belongs
a_instanceNumber - The unique instance number
Method Detail

getAcceptor

public PaxosAcceptor getAcceptor()
Returns the PaxosAcceptor this instance belongs to

Returns:

getExecution

public PaxosExecution getExecution(PaxosMessage a_msg)
Returns the PaxosExecution atching the given message

Parameters:
a_msg - A message
Returns:
The exectution the message belongs to

getDecissions

public java.util.Hashtable getDecissions()
Returns a hashtable containing the decissions of this instance. Key is the ID of the PaxosTarget, value is the decission for this PaxosTarget

Returns:
A Hashtable with the decissions

getExecutions

public java.util.Hashtable getExecutions()
Returns a Hashtable containing all Executions of this round

Returns:

getInstanceNumber

public java.lang.String getInstanceNumber()
Returns the round number of this round

Returns:
The round number of this round

addDecision

public void addDecision(java.lang.String a_initiator,
                        java.lang.String a_value)
Adds the decission for the given initiator

Parameters:
a_initiator - The decission for the execution of this initiator will be set
a_value - The reached decission