universal.consensus.register
Class AckListener

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--universal.consensus.register.AckListener
All Implemented Interfaces:
java.lang.Runnable

public class AckListener
extends java.lang.Thread

Thread that wait for AckReadMessage, NackReadMessage, AckWriteMessage, NackwriteMessage to arrive.


Field Summary
 int ackreadcount
          Number of Ackread messages we have received
 int ackwritecount
          Number of AckWrite messages we have received
 int batchno
          The position in the total order for which we are actually doing the consensus
 int falsepermissioncount
          Could be useful if we want to implement the crash recovery model as it was done in Paxos
private  java.lang.String filename
          Could be useful if we want to implement the crash recovery model as it was done in Paxos
 int nackreadcount
          Number of NackRead messages we have received
 int nackwritecount
          Number of NackWrite messages we have received
 int readcount
          Number of AckRead+NackRead messages we have received
 boolean readrecvd
          True if we have received a majority + 1 AckRead or NackRead messages for this round number
(package private)  universal.consensus.register.Register reg
           
 universal.Outcome remember_highest_k_out
          If a request has already been processed for this position in the total order,the AckRead messages contain the value decided and for for which round number it has been written.
 int remember_highest_k_value
          If a request has already been processed for this position in the total order,the AckRead messages contains the value decided and for for which round number it has been written.
 int roundno
          The round number for which we are actually doing the consensus
protected  universal.Universal uni
          The object Universal this AckListenner is linked to
 int writecount
          Number of AckWrite+NackWrite messages we have received
 boolean writerecvd
          True if we have received a majority + 1 AckWrite or NackWrite for this round number
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AckListener(universal.consensus.register.Register regi)
           
 
Method Summary
 void ackListener()
          The thread that is going to wait for Acknowledgement message to arrive.
 void initialize(int round, int batch)
          Initialize all the global variable
 universal.communication.Receiver receiver()
           
 void run()
           
 universal.communication.Sender sender()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

roundno

public int roundno
The round number for which we are actually doing the consensus


batchno

public int batchno
The position in the total order for which we are actually doing the consensus


readrecvd

public boolean readrecvd
True if we have received a majority + 1 AckRead or NackRead messages for this round number


writerecvd

public boolean writerecvd
True if we have received a majority + 1 AckWrite or NackWrite for this round number


ackreadcount

public int ackreadcount
Number of Ackread messages we have received


nackreadcount

public int nackreadcount
Number of NackRead messages we have received


ackwritecount

public int ackwritecount
Number of AckWrite messages we have received


nackwritecount

public int nackwritecount
Number of NackWrite messages we have received


falsepermissioncount

public int falsepermissioncount
Could be useful if we want to implement the crash recovery model as it was done in Paxos


readcount

public int readcount
Number of AckRead+NackRead messages we have received


writecount

public int writecount
Number of AckWrite+NackWrite messages we have received


remember_highest_k_value

public int remember_highest_k_value
If a request has already been processed for this position in the total order,the AckRead messages contains the value decided and for for which round number it has been written. In the variable remenber_highest_k_value we store the highest round number when the value has been written.I


remember_highest_k_out

public universal.Outcome remember_highest_k_out
If a request has already been processed for this position in the total order,the AckRead messages contain the value decided and for for which round number it has been written. In the variable remenber_highest_k_out we store the value that has been written for the highest round number.


filename

private java.lang.String filename
Could be useful if we want to implement the crash recovery model as it was done in Paxos


uni

protected universal.Universal uni
The object Universal this AckListenner is linked to


reg

universal.consensus.register.Register reg
Constructor Detail

AckListener

public AckListener(universal.consensus.register.Register regi)
Method Detail

initialize

public void initialize(int round,
                       int batch)
Initialize all the global variable


ackListener

public void ackListener()
The thread that is going to wait for Acknowledgement message to arrive. As soon as a majority+1 of replicated servers as acknowledge it notifies the Registry.


receiver

public universal.communication.Receiver receiver()

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

sender

public universal.communication.Sender sender()