Package io.aeron.driver
Class MaxMulticastFlowControl
java.lang.Object
io.aeron.driver.MaxMulticastFlowControl
- All Implemented Interfaces:
FlowControl,AutoCloseable
Default multicast sender flow control strategy.
Max of right edges. No tracking of receivers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringURI param value to identify thisFlowControlstrategy. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanHas the flow control strategy its required group of receivers to be considered connected? The result of this feeds into the determination of if a publication is connected.voidinitialize(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.intmaxRetransmissionLength(int termOffset, int resendLength, int termBufferLength, int mtuLength) The maximum window length allowed to retransmit per NAK.voidonError(ErrorFlyweight errorFlyweight, InetSocketAddress receiverAddress, long timeNs) Update the sender flow control strategy if an error comes from one of the receivers.longonIdle(long timeNs, long senderLimit, long senderPosition, boolean isEos) Perform any maintenance needed by the flow control strategy and return current sender limit position.longonSetup(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.longonStatusMessage(StatusMessageFlyweight flyweight, InetSocketAddress receiverAddress, long senderLimit, int initialTermId, int positionBitsToShift, long timeNs) Update the sender flow control strategy based on a status message from the receiver.voidonTriggerSendSetup(StatusMessageFlyweight flyweight, InetSocketAddress receiverAddress, long timeNs) Update the sender flow control strategy based on a Status Message received triggering a setup to be sent.
-
Field Details
-
FC_PARAM_VALUE
URI param value to identify thisFlowControlstrategy.- See Also:
-
-
Constructor Details
-
MaxMulticastFlowControl
public MaxMulticastFlowControl()
-
-
Method Details
-
initialize
public 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.- Specified by:
initializein interfaceFlowControl- Parameters:
context- 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.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceFlowControl
-
onStatusMessage
public long onStatusMessage(StatusMessageFlyweight flyweight, InetSocketAddress receiverAddress, long senderLimit, int initialTermId, int positionBitsToShift, long timeNs) Update the sender flow control strategy based on a status message from the receiver.- Specified by:
onStatusMessagein interfaceFlowControl- Parameters:
flyweight- over the status message received.receiverAddress- of the receiver.senderLimit- the current sender position limit.initialTermId- for the term buffers.positionBitsToShift- in use for the length of each term buffer.timeNs- current time (in nanoseconds).- Returns:
- the new position limit to be employed by the sender.
-
onTriggerSendSetup
public void onTriggerSendSetup(StatusMessageFlyweight flyweight, InetSocketAddress receiverAddress, long timeNs) Update the sender flow control strategy based on a Status Message received triggering a setup to be sent.- Specified by:
onTriggerSendSetupin interfaceFlowControl- Parameters:
flyweight- over the Status Message receivedreceiverAddress- of the receiver.timeNs- current time (in nanoseconds).
-
onSetup
public 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.- Specified by:
onSetupin interfaceFlowControl- Parameters:
flyweight- 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.- Returns:
- the new position limit to be employed by the sender.
-
onIdle
public 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.- Specified by:
onIdlein interfaceFlowControl- Parameters:
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.- Returns:
- the position limit to be employed by the sender.
-
onError
Update the sender flow control strategy if an error comes from one of the receivers.- Specified by:
onErrorin interfaceFlowControl- Parameters:
errorFlyweight- over the error received.receiverAddress- the address of the receiver.timeNs- current time in nanoseconds
-
hasRequiredReceivers
public boolean hasRequiredReceivers()Has the flow control strategy its required group of receivers to be considered connected? The result of this feeds into the determination of if a publication is connected.- Specified by:
hasRequiredReceiversin interfaceFlowControl- Returns:
- true if the required group of receivers is connected, otherwise false.
-
maxRetransmissionLength
public int maxRetransmissionLength(int termOffset, int resendLength, int termBufferLength, int mtuLength) The maximum window length allowed to retransmit per NAK. Will limit it by an estimate of the window limit and to the end of the current term.- Specified by:
maxRetransmissionLengthin interfaceFlowControl- Parameters:
termOffset- of the NAK.resendLength- of the NAK.termBufferLength- of the publication.mtuLength- of the publication.- Returns:
- the maximum window length allowed to retransmit per NAK.
-