|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgroups.util.ForwardQueue
public class ForwardQueue
Forwards messages in FIFO order to a destination. Uses IDs to prevent duplicates. Used by
FORWARD_TO_COORD
.
Nested Class Summary | |
---|---|
protected class |
ForwardQueue.Flusher
|
Field Summary | |
---|---|
protected Promise<java.lang.Long> |
ack_promise
Used for each resent message to wait until the message has been received |
protected java.util.concurrent.ConcurrentMap<Address,java.util.NavigableSet<java.lang.Long>> |
delivery_table
|
protected int |
delivery_table_max_size
Size of the set to store received seqnos (for duplicate checking) |
protected Protocol |
down_prot
|
protected ForwardQueue.Flusher |
flusher
|
protected boolean |
flushing
Set when we block all sending threads to resend all messages from forward_table |
protected java.util.NavigableMap<java.lang.Long,Message> |
forward_table
Maintains messages forwarded to the target which which no ack has been received yet. |
protected java.util.concurrent.atomic.AtomicInteger |
in_flight_sends
Keeps track of the threads sending messages |
protected Address |
local_addr
|
protected Log |
log
|
protected boolean |
running
|
protected java.util.concurrent.locks.Condition |
send_cond
|
protected java.util.concurrent.locks.Lock |
send_lock
|
protected Protocol |
up_prot
|
Constructor Summary | |
---|---|
ForwardQueue(Log log)
|
Method Summary | |
---|---|
void |
ack(long id)
|
protected void |
block()
|
protected boolean |
canDeliver(Address sender,
long seqno)
Checks if seqno has already been received from sender. |
int |
deliveryTableSize()
Total size of all queues of the delivery table |
protected void |
doFlush(Address new_target)
|
void |
flush(Address new_target,
java.util.List<Address> mbrs)
|
protected void |
flushMessagesInForwardTable(Address target)
Sends all messages currently in forward_table to the new target (changing the dest field). |
int |
getDeliveryTableMaxSize()
|
Protocol |
getDownProt()
|
Address |
getLocalAddr()
|
Protocol |
getUpProt()
|
void |
receive(long id,
Message msg)
|
void |
send(long id,
Message msg)
|
void |
setDeliveryTableMaxSize(int max_size)
|
void |
setDownProt(Protocol down_prot)
|
void |
setLocalAddr(Address local_addr)
|
void |
setUpProt(Protocol up_prot)
|
int |
size()
|
void |
start()
|
protected void |
startFlusher(Address new_coord)
|
void |
stop()
|
protected void |
stopFlusher()
|
protected void |
unblockAll()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Protocol up_prot
protected Protocol down_prot
protected Address local_addr
protected final java.util.NavigableMap<java.lang.Long,Message> forward_table
protected final java.util.concurrent.locks.Lock send_lock
protected final java.util.concurrent.locks.Condition send_cond
protected volatile boolean flushing
protected volatile boolean running
protected final java.util.concurrent.atomic.AtomicInteger in_flight_sends
protected final java.util.concurrent.ConcurrentMap<Address,java.util.NavigableSet<java.lang.Long>> delivery_table
protected volatile ForwardQueue.Flusher flusher
protected final Promise<java.lang.Long> ack_promise
protected final Log log
protected int delivery_table_max_size
Constructor Detail |
---|
public ForwardQueue(Log log)
Method Detail |
---|
public Protocol getUpProt()
public void setUpProt(Protocol up_prot)
public Protocol getDownProt()
public void setDownProt(Protocol down_prot)
public Address getLocalAddr()
public void setLocalAddr(Address local_addr)
public int getDeliveryTableMaxSize()
public void setDeliveryTableMaxSize(int max_size)
public int deliveryTableSize()
public void start()
public void stop()
public void send(long id, Message msg)
public void receive(long id, Message msg)
public void flush(Address new_target, java.util.List<Address> mbrs)
public void ack(long id)
public int size()
protected void doFlush(Address new_target) throws java.lang.InterruptedException
java.lang.InterruptedException
protected void flushMessagesInForwardTable(Address target)
protected boolean canDeliver(Address sender, long seqno)
protected void block()
protected void unblockAll()
protected void startFlusher(Address new_coord)
protected void stopFlusher()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |