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 timeout 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 |
---|---|
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,
UdpChannel udpChannel,
int initialTermId,
int termBufferLength)
Initialize the flow control strategy for a stream.
|
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.
|
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, wait
onStatusMessage
protected AbstractMinMulticastFlowControl(boolean isGroupTagAware)
isGroupTagAware
- true if the group tag is used.public void initialize(MediaDriver.Context context, UdpChannel udpChannel, int initialTermId, int termBufferLength)
initialize
in interface FlowControl
context
- to allow access to media driver configurationudpChannel
- for the stream.initialTermId
- at which the stream started.termBufferLength
- to use as the length of each term buffer.public long onIdle(long timeNs, long senderLimit, long senderPosition, boolean isEos)
onIdle
in interface FlowControl
timeNs
- 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 FlowControl
groupMinSize()
threshold?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 final long receiverTimeoutNs()
protected final boolean hasGroupTag()
protected final long groupTag()
protected final int groupMinSize()
Copyright © 2014-2021 Real Logic Limited. All Rights Reserved.