public class Digest extends Object implements Streamable, Iterable<Digest.DigestEntry>
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.
Modifier and Type | Class and Description |
---|---|
static class |
Digest.DigestEntry
Keeps track of one members plus its highest delivered and received seqnos
|
protected class |
Digest.MyIterator |
Modifier and Type | Field and Description |
---|---|
protected Address[] |
members |
protected long[] |
seqnos |
Modifier | Constructor and Description |
---|---|
|
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(Map<Address,long[]> map)
Creates a new digest from an existing map by copying the keys and values from map
|
Modifier and Type | Method and Description |
---|---|
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(Map<Address,long[]> map) |
Digest |
difference(Digest other) |
boolean |
equals(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.
|
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
|
Iterator<Digest.DigestEntry> |
iterator() |
String |
printHighestDeliveredSeqnos() |
void |
readFrom(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() |
String |
toString() |
String |
toStringSorted() |
String |
toStringSorted(boolean print_highest_received) |
void |
writeTo(DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
|
protected Address[] members
protected long[] seqnos
protected Digest(Address[] members, long[] seqnos)
public Digest()
public Digest(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)
public boolean contains(Address member)
public boolean containsAll(Digest other)
other
- public boolean equals(Object obj)
public long[] get(Address member)
member
- public boolean sameSenders(Digest other)
other
- public int size()
public long highestDeliveredSeqnoAt(Address sender)
public long highestReceivedSeqnoAt(Address sender)
public boolean isGreaterThanOrEqual(Digest other)
other
- public Digest copy()
public String toStringSorted()
public String toStringSorted(boolean print_highest_received)
public String printHighestDeliveredSeqnos()
public void writeTo(DataOutput out) throws Exception
Streamable
writeTo
in interface Streamable
Exception
public void readFrom(DataInput in) throws Exception
Streamable
readFrom
in interface Streamable
Exception
public long serializedSize()
protected int find(Address member)
protected void createArrays(int size)
public Iterator<Digest.DigestEntry> iterator()
iterator
in interface Iterable<Digest.DigestEntry>
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.