Package org.jgroups.protocols
Class UNICAST4
- java.lang.Object
-
- org.jgroups.stack.Protocol
-
- org.jgroups.protocols.ReliableUnicast
-
- org.jgroups.protocols.UNICAST4
-
- All Implemented Interfaces:
Lifecycle
,AgeOutCache.Handler<Address>
public class UNICAST4 extends ReliableUnicast
New unicast protocol based on fixed-size xmit windows and message ACKs
Details: https://issues.redhat.com/browse/JGRP-2843- Since:
- 5.4
- Author:
- Bela Ban
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jgroups.protocols.ReliableUnicast
ReliableUnicast.Entry, ReliableUnicast.ReceiverEntry, ReliableUnicast.RetransmitTask, ReliableUnicast.SenderEntry, ReliableUnicast.State
-
-
Field Summary
Fields Modifier and Type Field Description protected int
ack_threshold
protected java.util.function.IntBinaryOperator
add_acks
protected static Buffer.Options
BLOCKING_SENDS
protected int
capacity
-
Fields inherited from class org.jgroups.protocols.ReliableUnicast
avg_delivery_batch_size, BATCH_ACCUMULATOR, cache, cached_batches, conn_close_timeout, conn_expiry_timeout, DEFAULT_FIRST_SEQNO, DEFAULT_INCREMENT, DEFAULT_INITIAL_CAPACITY, DEFAULT_XMIT_INTERVAL, drop_oob_and_dont_loopback_msgs_filter, DUMMY_OOB_MSG, is_trace, last_conn_id, last_sync_sent, log_not_found_msgs, loopback, max_batch_size, max_retransmit_time, max_xmit_req_size, members, msg_cache, num_acks_received, num_acks_sent, num_loopbacks, num_msgs_received, num_msgs_sent, num_xmits, recv_table, recv_table_lock, relay_present, remove_filter, reuse_message_batches, running, send_atomically, send_table, sends_can_block, sync_min_interval, time_service, timer, timestamper, xmit_interval, xmit_reqs_received, xmit_reqs_sent, xmit_rsps_sent, xmit_task, xmit_task_map, xmits_enabled
-
Fields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot
-
-
Constructor Summary
Constructors Constructor Description UNICAST4()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
ackThreshold()
UNICAST4
ackThreshold(int t)
int
capacity()
UNICAST4
capacity(int c)
void
changeCapacity(int new_capacity)
Changes the capacity of all buffers, basically by creating new buffers and copying the messages from the old ones.protected Buffer<Message>
createBuffer(long seqno)
AverageMinMax
getAvgTimeBlocked()
long
getNumBlockings()
void
init()
Called after a protocol has been created and before the protocol is started.protected boolean
needToSendAck(ReliableUnicast.Entry e, int num_acks)
Buffer.Options
sendOptions()
-
Methods inherited from class org.jgroups.protocols.ReliableUnicast
_getReceiverEntry, accumulate, addMessage, addQueuedMessages, addToSendWindow, clearCachedBatches, closeConnection, closeIdleConnections, closeReceiveConnection, closeSendConnection, compare, compareConnIds, createReceiverEntry, deliverBatch, deliverMessage, down, down, expired, getAgeOutCache, getAgeOutCacheSize, getConnCloseTimeout, getConnExpiryTimeout, getLowestSeqno, getMaxRetransmitTime, getMaxXmitReqSize, getNewConnectionId, getNumAcksReceived, getNumAcksSent, getNumConnections, getNumLoopbacks, getNumMessagesReceived, getNumMessagesSent, getNumReceiveConnections, getNumSendConnections, getNumUnackedMessages, getNumXmits, getReceiverEntry, getSenderEntry, getSyncMinInterval, getTimestamp, getTimestamper, getXmitInterval, getXmitTableDeliverableMessages, getXmitTableMissingMessages, getXmitTableUndeliveredMessages, handleAckReceived, handleBatchFromSelf, handleBatchReceived, handleDataReceived, handleDataReceivedFromSelf, handleResendingOfFirstMessage, handleUpEvent, handleXmitRequest, hasSendConnectionTo, isCallerRunsHandler, isLocal, isLocalSiteMaster, isXmitsEnabled, isXmitTaskRunning, lastSync, logNotFoundMsgs, logNotFoundMsgs, loopback, loopback, max, printAgeOutCache, printCachedBatches, printConnections, printMessageList, printReceiveWindowMessages, printSendWindowMessages, removeAllConnections, removeAndDeliver, removeConnections, removeExpiredConnections, removeReceiveConnection, removeSendConnection, removeSendConnection, resend, resetStats, retransmit, retransmit, reuseMessageBatches, reuseMessageBatches, send, sendAck, sendAtomically, sendAtomically, sendClose, sendPendingAcks, sendRequestForFirstSeqno, sendsCanBlock, sendsCanBlock, setConnCloseTimeout, setConnExpiryTimeout, setLevel, setMaxRetransmitTime, setMaxXmitReqSize, setSyncMinInterval, setXmitInterval, setXmitsEnabled, start, startRetransmitTask, stop, stopRetransmitTask, timeService, triggerXmit, trimCachedBatches, up, up, update
-
Methods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, destroy, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, policies, providedDownServices, providedUpServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, statsEnabled, toString, up
-
-
-
-
Field Detail
-
BLOCKING_SENDS
protected static final Buffer.Options BLOCKING_SENDS
-
capacity
protected int capacity
-
ack_threshold
protected int ack_threshold
-
add_acks
protected final java.util.function.IntBinaryOperator add_acks
-
-
Method Detail
-
getNumBlockings
public long getNumBlockings()
-
getAvgTimeBlocked
public AverageMinMax getAvgTimeBlocked()
-
changeCapacity
public void changeCapacity(int new_capacity)
Changes the capacity of all buffers, basically by creating new buffers and copying the messages from the old ones. This method is only supposed to be used by perf testing, so DON'T USE!
-
createBuffer
protected Buffer<Message> createBuffer(long seqno)
- Specified by:
createBuffer
in classReliableUnicast
-
sendOptions
public Buffer.Options sendOptions()
- Overrides:
sendOptions
in classReliableUnicast
-
capacity
public int capacity()
-
capacity
public UNICAST4 capacity(int c)
-
ackThreshold
public int ackThreshold()
-
ackThreshold
public UNICAST4 ackThreshold(int t)
-
init
public void init() throws java.lang.Exception
Description copied from class:Protocol
Called after a protocol has been created and before the protocol is started. Attributes are already set. Other protocols are not yet connected and events cannot yet be sent.- Specified by:
init
in interfaceLifecycle
- Overrides:
init
in classReliableUnicast
- Throws:
java.lang.Exception
- Thrown if protocol cannot be initialized successfully. This will cause the ProtocolStack to fail, so the the channel constructor will throw an exception
-
needToSendAck
protected boolean needToSendAck(ReliableUnicast.Entry e, int num_acks)
- Specified by:
needToSendAck
in classReliableUnicast
-
-