| java.lang.Object org.jgroups.protocols.pbcast.Digest
Digest | public class Digest implements Externalizable,Streamable(Code) | | A message digest, which is used 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.
author: Bela Ban |
Method Summary | |
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 | clear() | public boolean | contains(Address sender) | public Digest | copy() | public boolean | equals(Object obj) | public Entry | get(Address sender) | public long | highSeqnoAt(Address sender) | public long | highSeqnoSeenAt(Address sender) | public void | incrementHighSeqno(Address sender) Increments the sender's high_seqno by 1. | public long | lowSeqnoAt(Address sender) | public void | merge(Digest d) Adds a digest to this digest. | public void | merge(Address sender, long low_seqno, long high_seqno, long high_seqno_seen) | public String | printHighSeqnos() | public String | printHighSeqnosSeen() | public void | readExternal(ObjectInput in) | public void | readFrom(DataInputStream in) | public void | replace(Digest d) | public void | resetAt(Address sender) Resets the seqnos for the sender at 'index' to 0. | public boolean | sameSenders(Digest other) Compares two digests and returns true if the senders are the same, otherwise false. | public long | serializedSize() | public boolean | set(Address sender, long low_seqno, long high_seqno, long high_seqno_seen) | public void | setHighSeqnoAt(Address sender, long high_seqno) | public void | setHighSeqnoSeenAt(Address sender, long high_seqno_seen) | public void | setHighestDeliveredAndSeenSeqnos(Address sender, long high_seqno, long high_seqno_seen) | public int | size() | public String | toString() | public void | writeExternal(ObjectOutput out) | public void | writeTo(DataOutputStream out) |
log | final protected static Log log(Code) | | |
warn | final static boolean warn(Code) | | |
Digest | public Digest(int size)(Code) | | |
add | public void add(Address sender, long low_seqno, long high_seqno)(Code) | | |
add | public void add(Address sender, long low_seqno, long high_seqno, long high_seqno_seen)(Code) | | |
clear | public void clear()(Code) | | |
incrementHighSeqno | public void incrementHighSeqno(Address sender)(Code) | | Increments the sender's high_seqno by 1.
|
merge | public void merge(Digest d)(Code) | | Adds a digest to this digest. This digest must have enough space to add the other digest; otherwise an error
message will be written. For each sender in the other digest, the merge() method will be called.
|
merge | public void merge(Address sender, long low_seqno, long high_seqno, long high_seqno_seen)(Code) | | 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)
|
printHighSeqnosSeen | public String printHighSeqnosSeen()(Code) | | |
resetAt | public void resetAt(Address sender)(Code) | | Resets the seqnos for the sender at 'index' to 0. This happens when a member has left the group,
but it is still in the digest. Resetting its seqnos ensures that no-one will request a message
retransmission from the dead member.
|
sameSenders | public boolean sameSenders(Digest other)(Code) | | Compares two digests and returns true if the senders are the same, otherwise false.
Parameters: other - True if senders are the same, otherwise false. |
serializedSize | public long serializedSize()(Code) | | |
set | public boolean set(Address sender, long low_seqno, long high_seqno, long high_seqno_seen)(Code) | | |
setHighSeqnoAt | public void setHighSeqnoAt(Address sender, long high_seqno)(Code) | | |
setHighSeqnoSeenAt | public void setHighSeqnoSeenAt(Address sender, long high_seqno_seen)(Code) | | |
setHighestDeliveredAndSeenSeqnos | public void setHighestDeliveredAndSeenSeqnos(Address sender, long high_seqno, long high_seqno_seen)(Code) | | |
|
|