|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.javagroups.protocols.pbcast.Digest
A message digest, which is used e.g. by the PBCAST layer for gossiping (also used by NAKACK for keeping track of current seqnos for all members). It contains pairs of senders and a range of seqnos (low and high), where each sender is associated with its highest and lowest seqnos seen so far. That is, the lowest seqno which was not yet garbage-collected and the highest that was seen so far and is deliverable (or was already delivered) to the application. A range of [0 - 0] means no messages have been received yet.
April 3 2001 (bela): Added high_seqnos_seen member. It is used to disseminate information about the last (highest) message M received from a sender P. Since we might be using a negative acknowledgment message numbering scheme, we would never know if the last message was lost. Therefore we periodically gossip and include the last message seqno. Members who haven't seen it (e.g. because msg was dropped) will request a retransmission. See DESIGN for details.
Constructor Summary | |
---|---|
Digest()
|
|
Digest(int size)
|
Method Summary | |
---|---|
void |
add(Address sender,
long low_seqno,
long high_seqno)
|
void |
add(Address sender,
long low_seqno,
long high_seqno,
long high_seqno_seen)
|
void |
add(Digest d)
|
boolean |
contains(Address sender)
|
Digest |
copy()
|
int |
getIndex(Address sender)
|
long |
highSeqnoAt(Address sender)
|
long |
highSeqnoAt(int index)
|
long |
highSeqnoSeenAt(Address sender)
|
long |
highSeqnoSeenAt(int index)
|
void |
incrementHighSeqno(Address sender)
Increment the sender's high_seqno by 1 |
long |
lowSeqnoAt(int index)
|
void |
merge(Address sender,
long low_seqno,
long high_seqno,
long high_seqno_seen)
Similar to add(), but if the sender already exists, its seqnos will be modified (no new entry) as follows: this.low_seqno=min(this.low_seqno, low_seqno) this.high_seqno=max(this.high_seqno, high_seqno) this.high_seqno_seen=max(this.high_seqno_seen, high_seqno_seen) If the sender doesn not exist, a new entry will be added (provided there is enough space) |
void |
merge(Digest d)
Adds a digest to this digest. |
java.lang.String |
printHighSeqnos()
|
java.lang.String |
printHighSeqnosSeen()
|
void |
readExternal(java.io.ObjectInput in)
|
void |
reset(int size)
|
void |
resetAt(int index)
Resets the seqnos for the sender at 'index' to 0. |
Address |
senderAt(int index)
|
void |
setHighSeqnoAt(Address sender,
long high_seqno)
|
void |
setHighSeqnoAt(int index,
long high_seqno)
|
void |
setHighSeqnoSeenAt(Address sender,
long high_seqno_seen)
|
void |
setHighSeqnoSeenAt(int index,
long high_seqno_seen)
|
void |
setLowSeqnoAt(int index,
long low_seqno)
|
int |
size()
|
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Digest()
public Digest(int size)
Method Detail |
public void add(Address sender, long low_seqno, long high_seqno)
public void add(Address sender, long low_seqno, long high_seqno, long high_seqno_seen)
public void add(Digest d)
public void merge(Digest d)
public void merge(Address sender, long low_seqno, long high_seqno, long high_seqno_seen)
public int getIndex(Address sender)
public boolean contains(Address sender)
public void incrementHighSeqno(Address sender)
public int size()
public Address senderAt(int index)
public void resetAt(int index)
public void reset(int size)
public long lowSeqnoAt(int index)
public long highSeqnoAt(int index)
public long highSeqnoSeenAt(int index)
public long highSeqnoAt(Address sender)
public long highSeqnoSeenAt(Address sender)
public void setLowSeqnoAt(int index, long low_seqno)
public void setHighSeqnoAt(int index, long high_seqno)
public void setHighSeqnoSeenAt(int index, long high_seqno_seen)
public void setHighSeqnoAt(Address sender, long high_seqno)
public void setHighSeqnoSeenAt(Address sender, long high_seqno_seen)
public Digest copy()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String printHighSeqnos()
public java.lang.String printHighSeqnosSeen()
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |