Package org.jgroups.util
Class MutableDigest
java.lang.Object
org.jgroups.util.Digest
org.jgroups.util.MutableDigest
- All Implemented Interfaces:
Externalizable,Serializable,Streamable
A mutable version of Digest (which is immutable
- Author:
- Bela Ban
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jgroups.util.Digest
Digest.Entry -
Field Summary
Fields inherited from class org.jgroups.util.Digest
EMPTY_DIGEST, log, senders -
Constructor Summary
ConstructorsConstructorDescriptionUsed for externalizationMutableDigest(int size) MutableDigest(Map<Address, Digest.Entry> map) MutableDigest(Digest digest) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidclear()Returns an unmodifiable map, so modifications will result in exceptionsvoidIncrements the sender's highest delivered seqno by 1voidSimilar 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.highest_delivered_seqno=max(this.highest_delivered_seqno, highest_delivered_seqno) this.highest_received_seqno=max(this.highest_received_seqno, highest_received_seqno) If the sender doesn not exist, a new entry will be added (provided there is enough space)voidAdds a digest to this digest.voidvoidResets the seqnos for the sender at 'index' to 0.booleanseal()Seals the instance against modificationsbooleanvoidsetHighestDeliveredAndSeenSeqnos(Address sender, long low_seqno, long highest_delivered_seqno, long highest_received_seqno) Methods inherited from class org.jgroups.util.Digest
contains, copy, difference, equals, get, highestDeliveredSeqnoAt, highestReceivedSeqnoAt, highestSequence, isGreaterThanOrEqual, lowSeqnoAt, printHighestDeliveredSeqnos, printHighestReceivedSeqnos, readExternal, readFrom, sameSenders, serializedSize, size, toString, toStringSorted, writeExternal, writeTo
-
Constructor Details
-
MutableDigest
public MutableDigest()Used for externalization -
MutableDigest
public MutableDigest(int size) -
MutableDigest
-
MutableDigest
-
-
Method Details
-
getSenders
Description copied from class:DigestReturns an unmodifiable map, so modifications will result in exceptions- Overrides:
getSendersin classDigest
-
add
-
add
public void add(Address sender, long low_seqno, long highest_delivered_seqno, long highest_received_seqno) -
add
-
replace
-
set
public boolean set(Address sender, long low_seqno, long highest_delivered_seqno, long highest_received_seqno) -
merge
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 highest_delivered_seqno, long highest_received_seqno) 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.highest_delivered_seqno=max(this.highest_delivered_seqno, highest_delivered_seqno)
- this.highest_received_seqno=max(this.highest_received_seqno, highest_received_seqno)
-
incrementHighestDeliveredSeqno
Increments the sender's highest delivered seqno by 1 -
resetAt
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. -
clear
public void clear() -
setHighestDeliveredAndSeenSeqnos
public void setHighestDeliveredAndSeenSeqnos(Address sender, long low_seqno, long highest_delivered_seqno, long highest_received_seqno) -
seal
public boolean seal()Seals the instance against modifications
-