@Deprecated public class UNICAST2 extends Protocol implements AgeOutCache.Handler<Address>
UNICAST
is that it doesn't send acks for every
message. Instead, it sends 'acks' after receiving max_bytes and/ or periodically (stable_interval).Modifier and Type | Class and Description |
---|---|
protected class |
UNICAST2.ConnectionReaper
Deprecated.
|
protected class |
UNICAST2.ReceiverEntry
Deprecated.
|
protected class |
UNICAST2.RetransmitTask
Deprecated.
Retransmitter task which periodically (every xmit_interval ms) looks at all the retransmit tables and
sends retransmit request to all members from which we have missing messages
|
protected class |
UNICAST2.SenderEntry
Deprecated.
|
static class |
UNICAST2.Unicast2Header
Deprecated.
The following types and fields are serialized:
|
Modifier and Type | Field and Description |
---|---|
protected AgeOutCache<Address> |
cache
Deprecated.
|
protected long |
conn_expiry_timeout
Deprecated.
|
protected java.util.concurrent.Future<?> |
connection_reaper
Deprecated.
|
static long |
DEFAULT_FIRST_SEQNO
Deprecated.
|
protected static Filter<Message> |
dont_loopback_filter
Deprecated.
|
protected int |
exponential_backoff
Deprecated.
|
protected short |
last_conn_id
Deprecated.
|
protected Address |
local_addr
Deprecated.
|
protected boolean |
log_not_found_msgs
Deprecated.
|
protected long |
max_bytes
Deprecated.
|
protected int |
max_msg_batch_size
Deprecated.
|
protected long |
max_retransmit_time
Deprecated.
|
protected int |
max_stable_msgs
Deprecated.
|
protected java.util.List<Address> |
members
Deprecated.
|
protected int |
num_messages_received
Deprecated.
|
protected int |
num_messages_sent
Deprecated.
|
protected java.util.concurrent.ConcurrentMap<Address,UNICAST2.ReceiverEntry> |
recv_table
Deprecated.
|
protected java.util.concurrent.locks.ReentrantLock |
recv_table_lock
Deprecated.
|
protected boolean |
running
Deprecated.
|
protected java.util.concurrent.ConcurrentMap<Address,UNICAST2.SenderEntry> |
send_table
Deprecated.
|
protected long |
stable_interval
Deprecated.
|
protected java.util.concurrent.Future<?> |
stable_task_future
Deprecated.
|
protected int[] |
timeout
Deprecated.
|
protected TimeScheduler |
timer
Deprecated.
|
protected boolean |
use_range_based_retransmitter
Deprecated.
|
protected long |
xmit_interval
Deprecated.
|
protected java.util.concurrent.atomic.AtomicLong |
xmit_reqs_received
Deprecated.
|
protected java.util.concurrent.atomic.AtomicLong |
xmit_reqs_sent
Deprecated.
|
protected java.util.concurrent.atomic.AtomicLong |
xmit_rsps_sent
Deprecated.
|
protected boolean |
xmit_table_automatic_purging
Deprecated.
|
protected long |
xmit_table_max_compaction_time
Deprecated.
|
protected int |
xmit_table_msgs_per_row
Deprecated.
|
protected int |
xmit_table_num_rows
Deprecated.
|
protected double |
xmit_table_resize_factor
Deprecated.
|
protected java.util.concurrent.Future<?> |
xmit_task
Deprecated.
RetransmitTask running every xmit_interval ms
|
protected java.util.Map<Address,java.lang.Long> |
xmit_task_map
Deprecated.
Used by the retransmit task to keep the last retransmitted seqno per sender (https://issues.jboss.org/browse/JGRP-1539)
|
after_creation_hook, down_prot, ergonomics, id, log, name, stack, stats, up_prot
Constructor and Description |
---|
UNICAST2()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
connectionEstablished(Address target)
Deprecated.
Is the send connection to target established
|
java.lang.Object |
down(Event evt)
Deprecated.
An event is to be sent down the stack.
|
void |
expired(Address key)
Deprecated.
Called by AgeOutCache, to removed expired connections
|
AgeOutCache<Address> |
getAgeOutCache()
Deprecated.
|
int |
getAgeOutCacheSize()
Deprecated.
|
java.lang.String |
getLocalAddress()
Deprecated.
|
long |
getMaxRetransmitTime()
Deprecated.
|
java.lang.String |
getMembers()
Deprecated.
|
protected short |
getNewConnectionId()
Deprecated.
|
int |
getNumConnections()
Deprecated.
|
int |
getNumReceiveConnections()
Deprecated.
|
int |
getNumSendConnections()
Deprecated.
|
protected UNICAST2.ReceiverEntry |
getOrCreateReceiverEntry(Address sender,
long seqno,
short conn_id)
Deprecated.
|
protected UNICAST2.ReceiverEntry |
getReceiverEntry(Address sender,
long seqno,
boolean first,
short conn_id)
Deprecated.
|
int[] |
getTimeout()
Deprecated.
|
TimeScheduler |
getTimer()
Deprecated.
|
long |
getXmitTableMissingMessages()
Deprecated.
|
int |
getXmitTableNumCompactions()
Deprecated.
|
int |
getXmitTableNumMoves()
Deprecated.
|
int |
getXmitTableNumPurges()
Deprecated.
|
int |
getXmitTableNumResizes()
Deprecated.
|
long |
getXmitTableUndeliveredMessages()
Deprecated.
|
protected void |
handleBatchReceived(Address sender,
java.util.Map<java.lang.Short,java.util.List<Message>> map)
Deprecated.
|
protected boolean |
handleDataReceived(Address sender,
long seqno,
short conn_id,
boolean first,
Message msg,
Event evt)
Deprecated.
Check whether the hashmap contains an entry e for
sender (create if not). |
protected void |
handleResendingOfFirstMessage(Address sender,
long seqno)
Deprecated.
We need to resend our first message with our conn_id
|
protected void |
handleXmitRequest(Address sender,
SeqnoList missing)
Deprecated.
|
boolean |
hasSendConnectionTo(Address dest)
Deprecated.
Used for testing only
|
void |
init()
Deprecated.
Called after instance has been created (null constructor) and before protocol is started.
|
boolean |
isConnectionReaperRunning()
Deprecated.
|
boolean |
isXmitTaskRunning()
Deprecated.
|
java.lang.String |
printAgeOutCache()
Deprecated.
|
java.lang.String |
printConnections()
Deprecated.
|
protected java.lang.String |
printMessageList(java.util.List<Message> list)
Deprecated.
|
java.lang.String |
printReceiveWindowMessages()
Deprecated.
|
java.lang.String |
printSendWindowMessages()
Deprecated.
|
void |
reapIdleConnections()
Deprecated.
|
void |
removeAllConnections()
Deprecated.
This method is public only so it can be invoked by unit testing, but should not otherwise be used !
|
protected void |
removeAndPassUp(Table<Message> win,
Address sender)
Deprecated.
Try to remove as many messages as possible and pass them up.
|
void |
removeConnection(Address mbr)
Deprecated.
Removes and resets from connection table (which is already locked).
|
void |
removeReceiveConnection(Address mbr)
Deprecated.
|
void |
removeSendConnection(Address mbr)
Deprecated.
|
void |
resetStats()
Deprecated.
|
void |
retransmit(SeqnoList missing,
Address sender)
Deprecated.
|
protected void |
sendAck(Address dest,
long seqno,
short conn_id)
Deprecated.
|
protected void |
sendRequestForFirstSeqno(Address dest,
long seqno_received)
Deprecated.
|
protected void |
sendStableMessage(Address dest,
short conn_id,
long hd,
long hr)
Deprecated.
|
void |
sendStableMessages()
Deprecated.
|
void |
setMaxMessageBatchSize(int size)
Deprecated.
|
void |
setMaxRetransmitTime(long max_retransmit_time)
Deprecated.
|
void |
setTimeout(int[] val)
Deprecated.
|
void |
setTimer(TimeScheduler timer)
Deprecated.
Only used for unit tests, don't use !
|
protected void |
stable(Address sender,
short conn_id,
long hd,
long hr)
Deprecated.
Purge all messages in window for local_addr, which are <= low.
|
void |
start()
Deprecated.
This method is called on a
Channel.connect(String) . |
protected void |
startConnectionReaper()
Deprecated.
|
protected void |
startRetransmitTask()
Deprecated.
|
protected void |
startStableTask()
Deprecated.
|
void |
stop()
Deprecated.
This method is called on a
Channel.disconnect() . |
protected void |
stopConnectionReaper()
Deprecated.
|
protected void |
stopRetransmitTask()
Deprecated.
|
protected void |
stopStableTask()
Deprecated.
|
void |
triggerXmit()
Deprecated.
|
java.lang.Object |
up(Event evt)
Deprecated.
An event was received from the layer below.
|
void |
up(MessageBatch batch)
Deprecated.
Sends up a multiple messages in a
MessageBatch . |
accept, afterCreationHook, destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, statsEnabled
public static final long DEFAULT_FIRST_SEQNO
@Deprecated protected int[] timeout
@Deprecated protected int exponential_backoff
protected int max_msg_batch_size
protected long max_bytes
protected long stable_interval
protected int max_stable_msgs
protected int xmit_table_num_rows
protected int xmit_table_msgs_per_row
protected double xmit_table_resize_factor
protected long xmit_table_max_compaction_time
@Deprecated protected boolean xmit_table_automatic_purging
protected boolean use_range_based_retransmitter
protected boolean log_not_found_msgs
protected long conn_expiry_timeout
protected long max_retransmit_time
protected long xmit_interval
protected int num_messages_sent
protected int num_messages_received
protected final java.util.concurrent.ConcurrentMap<Address,UNICAST2.SenderEntry> send_table
protected final java.util.concurrent.ConcurrentMap<Address,UNICAST2.ReceiverEntry> recv_table
protected java.util.concurrent.Future<?> xmit_task
protected final java.util.Map<Address,java.lang.Long> xmit_task_map
protected final java.util.concurrent.locks.ReentrantLock recv_table_lock
protected volatile java.util.List<Address> members
protected Address local_addr
protected TimeScheduler timer
protected volatile boolean running
protected short last_conn_id
protected AgeOutCache<Address> cache
protected java.util.concurrent.Future<?> stable_task_future
protected java.util.concurrent.Future<?> connection_reaper
protected final java.util.concurrent.atomic.AtomicLong xmit_reqs_received
protected final java.util.concurrent.atomic.AtomicLong xmit_reqs_sent
protected final java.util.concurrent.atomic.AtomicLong xmit_rsps_sent
@Deprecated public int[] getTimeout()
@Deprecated public void setTimeout(int[] val)
public void setMaxMessageBatchSize(int size)
public java.lang.String getLocalAddress()
public java.lang.String getMembers()
public int getNumSendConnections()
public int getNumReceiveConnections()
public int getNumConnections()
public java.lang.String printConnections()
public boolean connectionEstablished(Address target)
public boolean isConnectionReaperRunning()
public long getXmitTableUndeliveredMessages()
public long getXmitTableMissingMessages()
public int getXmitTableNumCompactions()
public int getXmitTableNumMoves()
public int getXmitTableNumResizes()
public int getXmitTableNumPurges()
public java.lang.String printReceiveWindowMessages()
public java.lang.String printSendWindowMessages()
public boolean isXmitTaskRunning()
public long getMaxRetransmitTime()
public void setMaxRetransmitTime(long max_retransmit_time)
public int getAgeOutCacheSize()
public java.lang.String printAgeOutCache()
public AgeOutCache<Address> getAgeOutCache()
public boolean hasSendConnectionTo(Address dest)
public void resetStats()
resetStats
in class Protocol
public TimeScheduler getTimer()
public void setTimer(TimeScheduler timer)
timer
- public void init() throws java.lang.Exception
Protocol
public void start() throws java.lang.Exception
Protocol
Channel.connect(String)
. Starts work.
Protocols are connected and queues are ready to receive events.
Will be called from bottom to top. This call will replace
the START and START_OK events.start
in class Protocol
java.lang.Exception
- Thrown if protocol cannot be started successfully. This will cause the ProtocolStack
to fail, so Channel.connect(String)
will throw an exceptionpublic void stop()
Protocol
Channel.disconnect()
. Stops work (e.g. by closing multicast socket).
Will be called from top to bottom. This means that at the time of the method invocation the
neighbor protocol below is still working. This method will replace the
STOP, STOP_OK, CLEANUP and CLEANUP_OK events. The ProtocolStack guarantees that
when this method is called all messages in the down queue will have been flushedpublic java.lang.Object up(Event evt)
Protocol
down_prot.down()
or c) the event (or another event) is sent up
the stack using up_prot.up()
.public void up(MessageBatch batch)
Protocol
MessageBatch
. The sender of the batch is always the same, and so is the
destination (null == multicast messages). Messages in a batch can be OOB messages, regular messages, or mixed
messages, although the transport itself will create initial MessageBatches that contain only either OOB or
regular messages.
The default processing below sends messages up the stack individually, based on a matching criteria
(calling Protocol.accept(org.jgroups.Message)
), and - if true - calls Protocol.up(org.jgroups.Event)
for that message and removes the message. If the batch is not empty, it is passed up, or else it is dropped.
Subclasses should check if there are any messages destined for them (e.g. using
MessageBatch.getMatchingMessages(short,boolean)
), then possibly remove and process them and finally pass
the batch up to the next protocol. Protocols can also modify messages in place, e.g. ENCRYPT could decrypt all
encrypted messages in the batch, not remove them, and pass the batch up when done.public java.lang.Object down(Event evt)
Protocol
down_prot.down()
. In case of a GET_ADDRESS event (which tries to
retrieve the stack's address from one of the bottom layers), the layer may need to send
a new response event back up the stack using up_prot.up()
.protected void stable(Address sender, short conn_id, long hd, long hr)
sender
- hd
- Highest delivered seqnohr
- Highest received seqnopublic void sendStableMessages()
protected void sendStableMessage(Address dest, short conn_id, long hd, long hr)
protected void startStableTask()
protected void stopStableTask()
protected void startConnectionReaper()
protected void stopConnectionReaper()
public void removeConnection(Address mbr)
public void removeSendConnection(Address mbr)
public void removeReceiveConnection(Address mbr)
public void removeAllConnections()
public void expired(Address key)
expired
in interface AgeOutCache.Handler<Address>
key
- protected boolean handleDataReceived(Address sender, long seqno, short conn_id, boolean first, Message msg, Event evt)
sender
(create if not). If
e.received_msgs is null and first
is true: create a new AckReceiverWindow(seqno) and
add message. Set e.received_msgs to the new window. Else just add the message.protected void handleBatchReceived(Address sender, java.util.Map<java.lang.Short,java.util.List<Message>> map)
protected java.lang.String printMessageList(java.util.List<Message> list)
protected void removeAndPassUp(Table<Message> win, Address sender)
protected UNICAST2.ReceiverEntry getReceiverEntry(Address sender, long seqno, boolean first, short conn_id)
protected UNICAST2.ReceiverEntry getOrCreateReceiverEntry(Address sender, long seqno, short conn_id)
protected void handleResendingOfFirstMessage(Address sender, long seqno)
sender
- seqno
- Resend the non null messages in the range [lowest .. seqno]protected void startRetransmitTask()
protected void stopRetransmitTask()
protected short getNewConnectionId()
protected void sendRequestForFirstSeqno(Address dest, long seqno_received)
protected void sendAck(Address dest, long seqno, short conn_id)
public void reapIdleConnections()
public void triggerXmit()
Copyright © 1998-2020 Red Hat. All Rights Reserved.