Package io.aeron.driver.ext
Class MultiGapLossGenerator
java.lang.Object
io.aeron.driver.ext.MultiGapLossGenerator
- All Implemented Interfaces:
LossGenerator
A loss generator implementation that will introduce multiple data gaps from a specific term-id/term-offset pair. It
will only gaps once for a given stream-id/session-id pair.
-
Constructor Summary
ConstructorsConstructorDescriptionMultiGapLossGenerator(int termId, int gapRadix, int gapLength, int totalGaps) Set the range of messages to be dropped. -
Method Summary
Modifier and TypeMethodDescriptionbooleanshouldDropFrame(InetSocketAddress address, UnsafeBuffer buffer, int length) Should a frame be dropped?booleanshouldDropFrame(InetSocketAddress address, UnsafeBuffer buffer, int streamId, int sessionId, int termId, int termOffset, int length) Should a frame be dropped?
-
Constructor Details
-
MultiGapLossGenerator
public MultiGapLossGenerator(int termId, int gapRadix, int gapLength, int totalGaps) Set the range of messages to be dropped.- Parameters:
termId- to be droppedgapRadix- the initial offset and subsequent interval between gaps - must be a power of 2gapLength- length of each gaptotalGaps- the total number of gaps
-
-
Method Details
-
shouldDropFrame
Should a frame be dropped?- Specified by:
shouldDropFramein interfaceLossGenerator- Parameters:
address- The source address of the frame if inbound or the remote address if outbound.buffer- The buffer containing the frame data.length- The length of the frame.- Returns:
- true to drop, false to process
-
shouldDropFrame
public boolean shouldDropFrame(InetSocketAddress address, UnsafeBuffer buffer, int streamId, int sessionId, int termId, int termOffset, int length) Should a frame be dropped?- Specified by:
shouldDropFramein interfaceLossGenerator- Parameters:
address- The source address of the frame if inbound or the remote address if outbound.buffer- The buffer containing the frame data.streamId- of the incoming frame.sessionId- of the incoming frametermId- of the incoming frame.termOffset- of the incoming frame.length- of the incoming frame.- Returns:
- true to drop, false to process
-