|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgroups.util.Digest
public class Digest
A message digest, containing senders and ranges of seqnos, where each sender is associated with its highest delivered and received seqno seen so far.
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.DigestEntry
Keeps track of one members plus its highest delivered and received seqnos |
protected class |
Digest.MyIterator
|
Field Summary | |
---|---|
protected Address[] |
members
|
protected long[] |
seqnos
|
Constructor Summary | |
---|---|
|
Digest()
Used for serialization |
protected |
Digest(Address[] members,
long[] seqnos)
|
|
Digest(Address sender,
long highest_delivered)
|
|
Digest(Address sender,
long highest_delivered,
long highest_received)
|
|
Digest(Digest digest)
|
|
Digest(java.util.Map<Address,long[]> map)
Creates a new digest from an existing map by copying the keys and values from map |
Method Summary | |
---|---|
boolean |
contains(Address member)
|
boolean |
containsAll(Digest other)
Returns true if our 'members' array contains all of the elements in other.members |
Digest |
copy()
|
protected void |
createArrays(int size)
|
protected void |
createArrays(java.util.Map<Address,long[]> map)
|
Digest |
difference(Digest other)
|
boolean |
equals(java.lang.Object obj)
Not really used, other than in unit tests and by FLUSH (reconciliation phase), so it doesn't need to be super efficient |
protected int |
find(Address member)
|
long[] |
get(Address member)
Returns the highest delivered and received seqnos associated with a member. |
java.util.Set<Address> |
getMembers()
|
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 |
java.util.Iterator<Digest.DigestEntry> |
iterator()
|
java.lang.String |
printHighestDeliveredSeqnos()
|
void |
readFrom(java.io.DataInput 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()
|
java.lang.String |
toStringSorted()
|
java.lang.String |
toStringSorted(boolean print_highest_received)
|
void |
writeTo(java.io.DataOutput 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 |
---|
protected Address[] members
protected long[] seqnos
Constructor Detail |
---|
protected Digest(Address[] members, long[] seqnos)
public Digest()
public Digest(java.util.Map<Address,long[]> map)
public Digest(Digest digest)
public Digest(Address sender, long highest_delivered, long highest_received)
public Digest(Address sender, long highest_delivered)
Method Detail |
---|
public boolean contains(Address member)
public boolean containsAll(Digest other)
other
-
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public long[] get(Address member)
member
-
public java.util.Set<Address> getMembers()
public boolean sameSenders(Digest other)
other
-
public Digest difference(Digest other)
public Digest highestSequence(Digest other)
public int size()
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 toStringSorted()
public java.lang.String toStringSorted(boolean print_highest_received)
public java.lang.String printHighestDeliveredSeqnos()
public void writeTo(java.io.DataOutput out) throws java.lang.Exception
Streamable
writeTo
in interface Streamable
java.lang.Exception
public void readFrom(java.io.DataInput in) throws java.lang.Exception
Streamable
readFrom
in interface Streamable
java.lang.Exception
public long serializedSize()
protected int find(Address member)
protected void createArrays(int size)
protected void createArrays(java.util.Map<Address,long[]> map)
public java.util.Iterator<Digest.DigestEntry> iterator()
iterator
in interface java.lang.Iterable<Digest.DigestEntry>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |