|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.util.Digest
public class Digest
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.
Nested Class Summary | |
---|---|
static class |
Digest.Entry
Class keeping track of the lowest and highest sequence numbers delivered, and the highest sequence numbers received, per member. |
Field Summary | |
---|---|
static Digest |
EMPTY_DIGEST
|
protected static org.apache.commons.logging.Log |
log
|
protected java.util.Map<Address,Digest.Entry> |
senders
Map<Address, Entry> |
Constructor Summary | |
---|---|
Digest()
Used for externalization |
|
Digest(Address sender,
long low,
long highest_delivered)
|
|
Digest(Address sender,
long low,
long highest_delivered,
long highest_received)
|
|
Digest(Digest d)
|
|
Digest(int size)
|
|
Digest(java.util.Map<Address,Digest.Entry> map)
Creates a new digest from an existing map by copying the keys and values from map |
Method Summary | |
---|---|
boolean |
contains(Address sender)
|
Digest |
copy()
|
Digest |
difference(Digest other)
|
boolean |
equals(java.lang.Object obj)
|
Digest.Entry |
get(Address sender)
Returns the Entry for the given sender. |
java.util.Map<Address,Digest.Entry> |
getSenders()
Returns an unmodifiable map, so modifications will result in exceptions |
long |
highestDeliveredSeqnoAt(Address sender)
|
long |
highestReceivedSeqnoAt(Address sender)
|
Digest |
highestSequence(Digest other)
|
boolean |
isGreaterThanOrEqual(Digest other)
Returns true if all senders of the current digest have their seqnos >= the ones from other |
long |
lowSeqnoAt(Address sender)
|
java.lang.String |
printHighestDeliveredSeqnos()
|
java.lang.String |
printHighestReceivedSeqnos()
|
void |
readExternal(java.io.ObjectInput in)
|
void |
readFrom(java.io.DataInputStream in)
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed |
boolean |
sameSenders(Digest other)
Compares two digests and returns true if the senders are the same, otherwise false. |
long |
serializedSize()
|
int |
size()
|
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
void |
writeTo(java.io.DataOutputStream out)
Write the entire state of the current object (including superclasses) to outstream. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Digest EMPTY_DIGEST
protected final java.util.Map<Address,Digest.Entry> senders
protected static final org.apache.commons.logging.Log log
Constructor Detail |
---|
public Digest()
public Digest(int size)
public Digest(java.util.Map<Address,Digest.Entry> map)
public Digest(Digest d)
public Digest(Address sender, long low, long highest_delivered, long highest_received)
public Digest(Address sender, long low, long highest_delivered)
Method Detail |
---|
public java.util.Map<Address,Digest.Entry> getSenders()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean contains(Address sender)
public Digest.Entry get(Address sender)
public boolean sameSenders(Digest other)
other
-
public Digest difference(Digest other)
public Digest highestSequence(Digest other)
public int size()
public long lowSeqnoAt(Address sender)
public long highestDeliveredSeqnoAt(Address sender)
public long highestReceivedSeqnoAt(Address sender)
public boolean isGreaterThanOrEqual(Digest other)
other
-
public Digest copy()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String printHighestDeliveredSeqnos()
public java.lang.String printHighestReceivedSeqnos()
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
public void writeTo(java.io.DataOutputStream out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
java.io.IOException
public void readFrom(java.io.DataInputStream in) throws java.io.IOException, java.lang.IllegalAccessException, java.lang.InstantiationException
Streamable
readFrom
in interface Streamable
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException
public long serializedSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |