public abstract class AbstractMinMulticastFlowControl extends Object implements FlowControl
Tracking of receivers is done as long as they continue to send Status Messages. Once SMs stop, the receiver tracking for that receiver will time out after a given number of nanoseconds.
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMinMulticastFlowControl(boolean isGroupTagAware)
Base constructor for use by specialised implementations.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected int |
groupMinSize()
The minimum group size required for progress.
|
protected long |
groupTag()
The tag used to identify members of the group.
|
protected boolean |
hasGroupTag()
Indicates if the flow control strategy has a group tag it is aware of for tracking membership.
|
boolean |
hasRequiredReceivers()
Has the observed receiver count reached the
groupMinSize() threshold? |
void |
initialize(MediaDriver.Context context,
CountersManager countersManager,
UdpChannel udpChannel,
int streamId,
int sessionId,
long registrationId,
int initialTermId,
int termBufferLength)
Initialize the flow control strategy for a stream.
|
int |
maxRetransmissionLength(long resendPosition,
int resendLength,
int termBufferLength,
int mtuLength)
The maximum window length allowed to retransmit per NAK.
|
long |
onIdle(long timeNs,
long senderLimit,
long senderPosition,
boolean isEos)
Perform any maintenance needed by the flow control strategy and return current sender limit position.
|
long |
onSetup(SetupFlyweight flyweight,
long senderLimit,
long senderPosition,
int positionBitsToShift,
long timeNs)
Update the sender flow control strategy based on an elicited setup message being sent out.
|
protected void |
processSendSetupTrigger(StatusMessageFlyweight flyweight,
InetSocketAddress receiverAddress,
long timeNs,
boolean hasMatchingTag)
Process a status message triggering a setup to be sent.
|
protected long |
processStatusMessage(StatusMessageFlyweight flyweight,
long senderLimit,
int initialTermId,
int positionBitsToShift,
long timeNs,
boolean matchesTag)
Process a received status message.
|
protected long |
receiverTimeoutNs()
Timeout after which an inactive receiver will be dropped.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonStatusMessage, onTriggerSendSetupprotected AbstractMinMulticastFlowControl(boolean isGroupTagAware)
isGroupTagAware - true if the group tag is used.public void initialize(MediaDriver.Context context, CountersManager countersManager, UdpChannel udpChannel, int streamId, int sessionId, long registrationId, int initialTermId, int termBufferLength)
initialize in interface FlowControlcontext - to allow access to media driver configurationcountersManager - to use for any counters in use by the strategyudpChannel - for the stream.streamId - for the stream.sessionId - for the stream.registrationId - for the stream.initialTermId - at which the stream started.termBufferLength - to use as the length of each term buffer.public void close()
close in interface FlowControlclose in interface AutoCloseablepublic long onSetup(SetupFlyweight flyweight, long senderLimit, long senderPosition, int positionBitsToShift, long timeNs)
onSetup in interface FlowControlflyweight - over the setup to be sent.senderLimit - for the current sender position.senderPosition - which has been sent.positionBitsToShift - in use for the length of each term buffer.timeNs - current time in nanoseconds.public long onIdle(long timeNs,
long senderLimit,
long senderPosition,
boolean isEos)
onIdle in interface FlowControltimeNs - current time in nanoseconds.senderLimit - for the current sender position.senderPosition - which has been sent.isEos - is this end-of-stream for the sender.public boolean hasRequiredReceivers()
groupMinSize() threshold?hasRequiredReceivers in interface FlowControlgroupMinSize() threshold?public int maxRetransmissionLength(long resendPosition,
int resendLength,
int termBufferLength,
int mtuLength)
maxRetransmissionLength in interface FlowControlresendPosition - of the NAK.resendLength - of the NAK.termBufferLength - of the publication.mtuLength - of the publication.protected final long processStatusMessage(StatusMessageFlyweight flyweight, long senderLimit, int initialTermId, int positionBitsToShift, long timeNs, boolean matchesTag)
flyweight - mapped over the status message.senderLimit - the sender is currently limited to for sending.initialTermId - for the publication.positionBitsToShift - when calculating term length with requiring a divide.timeNs - current time.matchesTag - if the status messages comes from a receiver with a tag matching the group.protected void processSendSetupTrigger(StatusMessageFlyweight flyweight, InetSocketAddress receiverAddress, long timeNs, boolean hasMatchingTag)
flyweight - over the status message receiver.receiverAddress - of the receiver.timeNs - current time (in nanoseconds).hasMatchingTag - if the status messages comes from a receiver with a tag matching the group.protected final long receiverTimeoutNs()
protected final boolean hasGroupTag()
protected final long groupTag()
protected final int groupMinSize()
Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.