org.jgroups.stack
public class AckMcastSenderWindow extends Object
This class may need flow control in order to avoid needless retransmissions because of timeouts.
Version: $Revision: 1.9 $
Nested Class Summary | |
---|---|
interface | AckMcastSenderWindow.RetransmitCommand
Called by retransmitter thread whenever a message needs to be re-sent
to a destination. |
Field Summary | |
---|---|
protected static Log | log |
Constructor Summary | |
---|---|
AckMcastSenderWindow(AckMcastSenderWindow.RetransmitCommand cmd, long[] retransmit_intervals, TimeScheduler sched)
Create and start the retransmitter
| |
AckMcastSenderWindow(AckMcastSenderWindow.RetransmitCommand cmd, TimeScheduler sched)
Create and start the retransmitter
| |
AckMcastSenderWindow(AckMcastSenderWindow.RetransmitCommand cmd, long[] retransmit_intervals)
Create and start the retransmitter
| |
AckMcastSenderWindow(AckMcastSenderWindow.RetransmitCommand cmd)
Create and start the retransmitter
|
Method Summary | |
---|---|
void | ack(long seqno, Address sender)
An ACK has been received from sender . |
void | add(long seqno, Message msg, Vector receivers)
Adds a new message to the hash table.
|
void | clearStableMessages() |
long | getNumberOfResponsesExpected(long seqno) Returns the number of members for a given entry for which acks have to be received |
long | getNumberOfResponsesReceived(long seqno) Returns the number of members for a given entry for which acks have been received |
Vector | getStableMessages() |
String | printDetails(long seqno) Prints all members plus whether an ack has been received from those members for a given seqno |
void | remove(Address obj)
Remove obj from all receiver sets and wake up
retransmission thread.
|
void | reset()
Remove all pending msgs from the hashtable. |
long | size() |
void | start()
Start the retransmitter. |
void | stop()
Stop the rentransmition and clear all pending msgs.
|
void | suspect(Address suspected)
Process with address suspected is suspected: remove it
from all receiver sets. |
String | toString() |
void | waitUntilAllAcksReceived(long timeout)
Waits until all outstanding messages have been ACKed by all receivers.
|
Parameters: cmd the callback object for retranmissions retransmit_intervals the interval between two consecutive retransmission attempts sched the external scheduler to use to schedule retransmissions
Throws: IllegalArgumentException if cmd
is null
Parameters: cmd the callback object for retranmissions sched the external scheduler to use to schedule retransmissions
Throws: IllegalArgumentException if cmd
is null
Parameters: cmd the callback object for retranmissions retransmit_intervals the interval between two consecutive retransmission attempts
Throws: IllegalArgumentException if cmd
is null
Parameters: cmd the callback object for retranmissions
Throws: IllegalArgumentException if cmd
is null
sender
. Tag the sender in
the hash table as 'received'. If all ACKs have been received, remove
the entry all together.
Parameters: seqno The sequence number of the message for which an ACK has been received. sender The sender which sent the ACK
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
Returns: a copy of stable messages, or null (if non available). Removes all stable messages afterwards
obj
from all receiver sets and wake up
retransmission thread.
Parameters: obj the sender to remove
Returns: the number of currently pending msgs
If this retransmitter has been provided an externally managed scheduler, then just clear all msgs and the associated tasks, else stop the scheduler. In this case the method blocks until the scheduler's thread is dead. Only the owner of the scheduler should stop it.
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
Parameters: timeout Miliseconds to wait. 0 means wait indefinitely.