Package io.aeron.driver.ext
Class FixedLossGenerator
java.lang.Object
io.aeron.driver.ext.FixedLossGenerator
- All Implemented Interfaces:
LossGenerator
A loss generator implementation that will lose a fixed block of data from a specific term-id/term-offset pair. It
will only lose the selected block of data once for a given stream-id/session-id pair.
-
Constructor Summary
ConstructorsConstructorDescriptionFixedLossGenerator(int termId, int termOffset, int length) 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
-
FixedLossGenerator
public FixedLossGenerator(int termId, int termOffset, int length) Set the range of messages to be dropped.- Parameters:
termId- to be droppedtermOffset- to be droppedlength- to be dropped
-
-
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
-