Package org.jgroups.stack
Class AckSenderWindow
java.lang.Object
org.jgroups.stack.AckSenderWindow
- All Implemented Interfaces:
Retransmitter.RetransmitCommand
ACK-based sliding window for a sender. Messages are added to the window keyed by seqno
When an ACK is received, the corresponding message is removed. The Retransmitter
continously iterates over the entries in the hashmap, retransmitting messages based on their
creation time and an (increasing) timeout. When there are no more messages in the retransmission
table left, the thread terminates. It will be re-activated when a new entry is added to the
retransmission table.
- Author:
- Bela Ban
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance without retransmitterAckSenderWindow(AckSenderWindow.RetransmitCommand com, Interval interval, TimeScheduler sched) AckSenderWindow(AckSenderWindow.RetransmitCommand com, Interval interval, TimeScheduler sched, Address sender) -
Method Summary
Modifier and TypeMethodDescriptionvoidack(long seqno) Removes all messages less than or equal to seqno frommsgs, and cancels their retransmissionvoidAdds a new message to the retransmission table.voidaddToMessages(long seqno, Message msg) voidaddToRetransmitter(long seqno, Message msg) get(long seqno) longlongOnly to be used for testing purposesReturns the message with the lowest seqnovoidreset()voidretransmit(long first_seqno, long last_seqno, Address sender) Get the missing messages between sequence numbersfirst_seqnoandlast_seqno.intsize()toString()
-
Constructor Details
-
AckSenderWindow
-
AckSenderWindow
public AckSenderWindow(AckSenderWindow.RetransmitCommand com, Interval interval, TimeScheduler sched) -
AckSenderWindow
public AckSenderWindow(AckSenderWindow.RetransmitCommand com, Interval interval, TimeScheduler sched, Address sender) -
AckSenderWindow
public AckSenderWindow()Creates an instance without retransmitter
-
-
Method Details
-
getLowest
public long getLowest()Only to be used for testing purposes -
getHighest
public long getHighest() -
reset
public void reset() -
get
-
add
Adds a new message to the retransmission table. The message will be retransmitted (based on timeouts passed into AckSenderWindow until (1) an ACK is received or (2) the AckSenderWindow is stopped (@link{#reset}) -
addToMessages
-
addToRetransmitter
-
ack
public void ack(long seqno) Removes all messages less than or equal to seqno frommsgs, and cancels their retransmission -
getLowestMessage
Returns the message with the lowest seqno -
size
public int size() -
toString
-
printDetails
-
retransmit
Description copied from interface:Retransmitter.RetransmitCommandGet the missing messages between sequence numbersfirst_seqnoandlast_seqno. This can either be done by sending a retransmit message to destinationsender(nak-based scheme), or by retransmitting the missing message(s) tosender(ack-based scheme).- Specified by:
retransmitin interfaceRetransmitter.RetransmitCommand- Parameters:
first_seqno- The sequence number of the first missing messagelast_seqno- The sequence number of the last missing messagesender- The destination of the member to which the retransmit request will be sent (nak-based scheme), or to which the message will be retransmitted (ack-based scheme).
-