public class PreferredMulticastFlowControl extends java.lang.Object implements FlowControl
Flow control is set to minimum of tracked preferred receivers.
Tracking of preferred 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 and Type | Field and Description |
---|---|
static java.lang.String |
PREFERRED_ASF |
static byte[] |
PREFERRED_ASF_BYTES |
static java.lang.String |
PREFERRED_ASF_DEFAULT
Default Application Specific Feedback (ASF) value
|
static java.lang.String |
PREFERRED_ASF_PROP_NAME
Property name used to set Application Specific Feedback (ASF) in Status Messages to identify preferred receivers.
|
static long |
RECEIVER_TIMEOUT |
static long |
RECEIVER_TIMEOUT_DEFAULT
Default timeout, in nanoseconds, until a receiver is no longer tracked and considered for minimum.
|
static java.lang.String |
RECEIVER_TIMEOUT_PROP_NAME
Property name to set timeout, in nanoseconds, for a receiver to be tracked.
|
Constructor and Description |
---|
PreferredMulticastFlowControl() |
Modifier and Type | Method and Description |
---|---|
void |
initialize(int initialTermId,
int termBufferLength)
Initialize the flow control strategy
|
boolean |
isFromPreferred(StatusMessageFlyweight statusMessageFlyweight) |
long |
onIdle(long timeNs,
long senderLimit,
long senderPosition,
boolean isEos)
Perform any maintenance needed by the flow control strategy and return current position
|
long |
onStatusMessage(StatusMessageFlyweight flyweight,
java.net.InetSocketAddress receiverAddress,
long senderLimit,
int initialTermId,
int positionBitsToShift,
long timeNs)
Update the sender flow control strategy based on a status message from the receiver.
|
boolean |
shouldLinger(long timeNs)
Called from the
DriverConductor to check should the NetworkPublication linger or not. |
public static final java.lang.String RECEIVER_TIMEOUT_PROP_NAME
public static final long RECEIVER_TIMEOUT_DEFAULT
public static final long RECEIVER_TIMEOUT
public static final java.lang.String PREFERRED_ASF_PROP_NAME
public static final java.lang.String PREFERRED_ASF_DEFAULT
public static final java.lang.String PREFERRED_ASF
public static final byte[] PREFERRED_ASF_BYTES
public long onStatusMessage(StatusMessageFlyweight flyweight, java.net.InetSocketAddress receiverAddress, long senderLimit, int initialTermId, int positionBitsToShift, long timeNs)
onStatusMessage
in interface FlowControl
flyweight
- the Status Message contentsreceiverAddress
- 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). System.nanoTime()
public void initialize(int initialTermId, int termBufferLength)
initialize
in interface FlowControl
initialTermId
- for the term bufferstermBufferLength
- to use as the length of each term bufferpublic 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
- for the currentisEos
- is this end-of-stream for the sender.public boolean shouldLinger(long timeNs)
DriverConductor
to check should the NetworkPublication
linger or not.shouldLinger
in interface FlowControl
timeNs
- current time in nanoseconds.public boolean isFromPreferred(StatusMessageFlyweight statusMessageFlyweight)
Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.