|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--JavaGroups.NakReceiverWindow
Keeps track of messages according to their sequence numbers. Allows messages to be added out of
order, and with gaps between sequence numbers. Method Remove removes the first
message with a sequence number that is 1 higher than next_to_remove (this variable
is then incremented), or it returns null if no message is present, or if no message's sequence
number is 1 higher.
Started out as a copy of SlidingWindow. Main diff: RetransmitCommand is different, and retransmission thread is only created upon detection of a gap.
| Inner Class Summary | |
static interface |
NakReceiverWindow.RetransmitCommand
Retransmit command (see Gamma et al.) used by the sliding window table to retrieve missing messages. |
| Constructor Summary | |
NakReceiverWindow(java.lang.Object sender,
NakReceiverWindow.RetransmitCommand command,
long start_seqno)
|
|
| Method Summary | |
void |
Add(long seqno,
Message msg)
Adds a message according to its sequence number (ordered). |
void |
finalize()
|
long |
GetHighestDelivered()
Returns the highest sequence number of a message consumed by the application (by Remove()) |
long |
GetHighestReceived()
Returns the highest sequence number received so far (which may be higher than the highest seqno delivered so far |
List |
GetMessagesHigherThan(long seqno)
Return messages that are higher than seqno (excluding seqno) |
List |
GetMessagesInRange(long lower,
long upper)
Return all messages m for which the following holds: m > lower && m <= upper (excluding lower, including upper). |
static void |
main(java.lang.String[] args)
|
Message |
Remove()
Find the entry with seqno head. |
void |
Reset()
Deletes all entries |
void |
SetRetransmitPeriod(long t)
|
int |
Size()
|
void |
Stable(long seqno)
Delete all messages <= seqno (they are stable, that is, have been received at all members). |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public NakReceiverWindow(java.lang.Object sender,
NakReceiverWindow.RetransmitCommand command,
long start_seqno)
| Method Detail |
public void finalize()
public void SetRetransmitPeriod(long t)
public void Add(long seqno,
Message msg)
head and
tail mark the start and end of the messages received, but not delivered yet.
When a message is received, if its seqno is smaller than head, it is discarded
(already received). If it is bigger than tail, we advance tail and
add empty elements. If it is between head and tail, we set the
corresponding missing (or already present) element. If it is equal to tail,
we advance the latter by 1 and add the message (default case).public Message Remove()
head. If e.msg is != null -> return it and increment
head, else return null.public void Stable(long seqno)
public void Reset()
public long GetHighestDelivered()
public long GetHighestReceived()
public List GetMessagesHigherThan(long seqno)
seqno (excluding seqno)
public List GetMessagesInRange(long lower,
long upper)
msgs and delivered_msgs.public int Size()
public java.lang.String toString()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||