public class Digest extends Object implements Externalizable, Streamable
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.Entry
Class keeping track of the lowest and highest sequence numbers delivered, and the highest
sequence numbers received, per member.
|
Modifier and Type | Field and Description |
---|---|
static Digest |
EMPTY_DIGEST |
protected static Log |
log |
protected Map<Address,Digest.Entry> |
senders
Map<Address, Entry>
|
Constructor and Description |
---|
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(Map<Address,Digest.Entry> 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 sender) |
Digest |
copy() |
Digest |
difference(Digest other) |
boolean |
equals(Object obj) |
Digest.Entry |
get(Address sender)
Returns the Entry for the given sender.
|
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) |
String |
printHighestDeliveredSeqnos() |
String |
printHighestReceivedSeqnos() |
void |
readExternal(ObjectInput in) |
void |
readFrom(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() |
String |
toString() |
String |
toStringSorted() |
void |
writeExternal(ObjectOutput out) |
void |
writeTo(DataOutputStream out)
Write the entire state of the current object (including superclasses) to outstream.
|
public static final Digest EMPTY_DIGEST
protected final Map<Address,Digest.Entry> senders
protected static final Log log
public Digest()
public Digest(int size)
public Digest(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)
public Map<Address,Digest.Entry> getSenders()
public boolean contains(Address sender)
public Digest.Entry get(Address sender)
public boolean sameSenders(Digest other)
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 String toStringSorted()
public String printHighestDeliveredSeqnos()
public String printHighestReceivedSeqnos()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeTo(DataOutputStream out) throws IOException
Streamable
writeTo
in interface Streamable
IOException
public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException
Streamable
readFrom
in interface Streamable
IOException
IllegalAccessException
InstantiationException
public long serializedSize()
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.