Package org.jgroups.util
Class AckCollector
- java.lang.Object
-
- org.jgroups.util.AckCollector
-
public class AckCollector extends java.lang.Object
Collects acks from a number of nodes, waits for all acks. Can also be time bounded- Author:
- Bela Ban
-
-
Field Summary
Fields Modifier and Type Field Description protected Promise<java.lang.Boolean>
all_acks_received
protected int
expected_acks
protected java.util.List<Address>
missing_acks
List of members from whom we haven't received an ACK yetprotected java.util.List<Address>
suspected_mbrs
-
Constructor Summary
Constructors Constructor Description AckCollector()
AckCollector(java.util.Collection<Address> members)
AckCollector(Address... members)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
ack(java.util.Collection<Address> members)
void
ack(Address member)
void
ack(Address... members)
protected void
addAll(java.util.Collection<Address> members)
protected void
addAll(java.util.Collection<Address> members, java.util.Collection<Address> exclude)
protected void
addAll(java.util.Collection<Address> members, Address... exclude)
protected void
addAll(Address... members)
void
destroy()
int
expectedAcks()
java.lang.String
printMissing()
java.lang.String
printSuspected()
void
reset(java.util.Collection<Address> members)
AckCollector
reset(java.util.Collection<Address> expected_acks, java.util.Collection<Address> exclude)
AckCollector
reset(java.util.Collection<Address> expected_acks, Address... exclude)
boolean
retainAll(java.util.Collection<Address> members)
int
size()
void
suspect(java.util.Collection<Address> members)
void
suspect(Address member)
void
suspect(Address... members)
java.lang.String
toString()
boolean
waitForAllAcks()
boolean
waitForAllAcks(long timeout)
-
-
-
Field Detail
-
missing_acks
protected final java.util.List<Address> missing_acks
List of members from whom we haven't received an ACK yet
-
all_acks_received
protected final Promise<java.lang.Boolean> all_acks_received
-
suspected_mbrs
protected final java.util.List<Address> suspected_mbrs
-
expected_acks
protected int expected_acks
-
-
Method Detail
-
reset
public void reset(java.util.Collection<Address> members)
-
reset
public AckCollector reset(java.util.Collection<Address> expected_acks, java.util.Collection<Address> exclude)
-
reset
public AckCollector reset(java.util.Collection<Address> expected_acks, Address... exclude)
-
destroy
public void destroy()
-
size
public int size()
-
expectedAcks
public int expectedAcks()
-
ack
public void ack(Address member)
-
ack
public void ack(Address... members)
-
ack
public void ack(java.util.Collection<Address> members)
-
suspect
public void suspect(Address member)
-
suspect
public void suspect(Address... members)
-
suspect
public void suspect(java.util.Collection<Address> members)
-
retainAll
public boolean retainAll(java.util.Collection<Address> members)
-
waitForAllAcks
public boolean waitForAllAcks()
-
waitForAllAcks
public boolean waitForAllAcks(long timeout) throws java.util.concurrent.TimeoutException
- Throws:
java.util.concurrent.TimeoutException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
printMissing
public java.lang.String printMissing()
-
printSuspected
public java.lang.String printSuspected()
-
addAll
protected void addAll(Address... members)
-
addAll
protected void addAll(java.util.Collection<Address> members)
-
addAll
protected void addAll(java.util.Collection<Address> members, java.util.Collection<Address> exclude)
-
-