|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--JavaGroups.AckMcastSenderWindow
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.
| Inner Class Summary | |
static interface |
AckMcastSenderWindow.RetransmitCommand
Called by retransmitter thread whenever a message needs to be re-sent to a destination. |
| Constructor Summary | |
AckMcastSenderWindow(AckMcastSenderWindow.RetransmitCommand command)
|
|
| Method Summary | |
void |
Ack(long seqno,
java.lang.Object sender)
An ACK has been received from sender. |
void |
Add(long seqno,
Message msg,
java.util.Vector receivers)
Adds a new message to the hash table. |
java.util.Vector |
GetStableMessages()
Returns copy of stable messages, or null (if non available). |
static void |
main(java.lang.String[] args)
|
void |
Remove(java.lang.Object obj)
Remove obj from all receiver sets and wake up retransmission thread. |
void |
Reset()
Remove all entries from the hashtable. |
void |
run()
Retransmitter thread. |
long |
Size()
|
void |
Start()
|
void |
Stop()
|
void |
Suspect(java.lang.Object suspected)
Process with address suspected is suspected: remove it from all receiver sets. |
java.lang.String |
toString()
|
void |
WaitUntilAllAcksReceived(long timeout)
Waits until all outstanding messages have been ACKed by all receivers. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public AckMcastSenderWindow(AckMcastSenderWindow.RetransmitCommand command)
| Method Detail |
public java.util.Vector GetStableMessages()
public long Size()
public void Add(long seqno,
Message msg,
java.util.Vector receivers)
seqno - The sequence number associated with the messagemsg - 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
public void Ack(long seqno,
java.lang.Object sender)
sender. Tag the sender in the hash table as
'received'. If all ACKs have been received, remove the entry altogether.seqno - The sequence number of the message for which an ACK has been received.sender - The sender which sent the ACKpublic void Remove(java.lang.Object obj)
obj from all receiver sets and wake up retransmission thread.public void Suspect(java.lang.Object suspected)
suspected is suspected: remove it from all receiver sets.
This means that no ACKs are expected from this process anymore.suspected - The suspected processpublic void Reset()
public void WaitUntilAllAcksReceived(long timeout)
timeout - Miliseconds to wait. 0 means wait indefinitely.public void run()
public java.lang.String toString()
public void Start()
public void Stop()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||