All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JavaGroups.AckMcastSenderWindow

java.lang.Object
   |
   +----JavaGroups.AckMcastSenderWindow

public class AckMcastSenderWindow
extends Object
implements Runnable
Keeps track of ACKs from receivers for each message. When a new message is sent, it is tagged with a sequence number and the receiver set (set of members to which the message is sent) and added to a hashtable (key = sequence number, val = message + receiver set). Each incoming ACK is noted and when all ACKs for a specific sequence number haven been received, the corresponding entry is removed from the hashtable. A retransmission thread periodically re-sends the message point-to-point to all receivers from which no ACKs have been received yet. A view change or suspect message causes the corresponding non-existing receivers to be removed from the hashtable.

This class may need flow control in order to avoid needless retransmissions because of timeouts.

Author:
Bela Ban June 9 1999

Constructor Index

 o AckMcastSenderWindow(AckMcastSenderWindow. RetransmitCommand)

Method Index

 o Ack(long, Object)
An ACK has been received from sender.
 o Add(long, Message, Vector)
Adds a new message to the hash table.
 o GetStableMessages()
Returns copy of stable messages, or null (if non available).
 o main(String[])
 o Remove(Object)
Remove obj from all receiver sets and wake up retransmission thread.
 o Reset()
Remove all entries from the hashtable.
 o run()
Retransmitter thread.
 o Size()
 o Start()
 o Stop()
 o Suspect(Object)
Process with address suspected is suspected: remove it from all receiver sets.
 o toString()
 o WaitUntilAllAcksReceived(long)
Waits until all outstanding messages have been ACKed by all receivers.

Constructors

 o AckMcastSenderWindow
 public AckMcastSenderWindow(AckMcastSenderWindow. RetransmitCommand command)

Methods

 o GetStableMessages
 public Vector GetStableMessages()
Returns copy of stable messages, or null (if non available). Removes all stable messages afterwards

 o Size
 public long Size()
 o Add
 public void Add(long seqno,
                 Message msg,
                 Vector receivers)
Adds a new message to the hash table.

Parameters:
seqno - The sequence number associated with the message
msg - The message (should be a copy !)
receivers - The set of addresses to which the message was sent and from which consequently an ACK is expected
 o Ack
 public void Ack(long seqno,
                 Object sender)
An ACK has been received from sender. Tag the sender in the hash table as 'received'. If all ACKs have been received, remove the entry altogether.

Parameters:
seqno - The sequence number of the message for which an ACK has been received.
sender - The sender which sent the ACK
 o Remove
 public void Remove(Object obj)
Remove obj from all receiver sets and wake up retransmission thread.

 o Suspect
 public void Suspect(Object suspected)
Process with address suspected is suspected: remove it from all receiver sets. This means that no ACKs are expected from this process anymore.

Parameters:
suspected - The suspected process
 o Reset
 public void Reset()
Remove all entries from the hashtable. Stop the retransmitter thread

 o WaitUntilAllAcksReceived
 public void WaitUntilAllAcksReceived(long timeout)
Waits until all outstanding messages have been ACKed by all receivers. Takes into account suspicions and view changes. Returns when there are no entries left in the hashtable. While waiting, no entries can be added to the hashtable (they will be discarded).

Parameters:
timeout - Miliseconds to wait. 0 means wait indefinitely.
 o run
 public void run()
Retransmitter thread. While there are messages available for which not all ACKs have been received yet, retransmit those without ACKs.

 o toString
 public String toString()
Overrides:
toString in class Object
 o Start
 public synchronized void Start()
 o Stop
 public synchronized void Stop()
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index