public class ForwardQueue
extends java.lang.Object
FORWARD_TO_COORD
.Modifier and Type | Class and Description |
---|---|
protected class |
ForwardQueue.Flusher |
Modifier and Type | Field and Description |
---|---|
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,BoundedHashMap<java.lang.Long,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 and Description |
---|
ForwardQueue(Log log) |
Modifier and Type | Method and Description |
---|---|
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() |
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,BoundedHashMap<java.lang.Long,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
public ForwardQueue(Log log)
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 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()
Copyright © 1998-2020 Red Hat. All Rights Reserved.