| java.lang.Object org.jgroups.stack.AckReceiverWindow
AckReceiverWindow | public class AckReceiverWindow (Code) | | Counterpart of AckSenderWindow. Simple FIFO buffer.
Every message received is ACK'ed (even duplicates) and added to a hashmap
keyed by seqno. The next seqno to be received is stored in next_to_remove . When a message with
a seqno less than next_to_remove is received, it will be discarded. The remove() method removes
and returns a message whose seqno is equal to next_to_remove, or null if not found.
Change May 28 2002 (bela): replaced TreeSet with HashMap. Keys do not need to be sorted, and adding a key to
a sorted set incurs overhead.
author: Bela Ban |
Method Summary | |
public void | add(long seqno, Message msg) Adds a new message. | public String | printDetails() | public Message | remove() Removes a message whose seqno is equal to next_to_remove , increments the latter.
Returns message that was removed, or null, if no message can be removed. | public void | reset() | public int | size() | public String | toString() |
next_to_remove | long next_to_remove(Code) | | |
AckReceiverWindow | public AckReceiverWindow(long initial_seqno)(Code) | | |
add | public void add(long seqno, Message msg)(Code) | | Adds a new message. Message cannot be null
|
remove | public Message remove()(Code) | | Removes a message whose seqno is equal to next_to_remove , increments the latter.
Returns message that was removed, or null, if no message can be removed. Messages are thus
removed in order.
|
reset | public void reset()(Code) | | |
|
|