Class FixedLossGenerator

java.lang.Object
io.aeron.driver.ext.FixedLossGenerator
All Implemented Interfaces:
LossGenerator

public class FixedLossGenerator extends Object implements 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 Details

    • FixedLossGenerator

      public FixedLossGenerator(int termId, int termOffset, int length)
      Set the range of messages to be dropped.
      Parameters:
      termId - to be dropped
      termOffset - to be dropped
      length - to be dropped
  • Method Details

    • shouldDropFrame

      public boolean shouldDropFrame(InetSocketAddress address, UnsafeBuffer buffer, int length)
      Should a frame be dropped?
      Specified by:
      shouldDropFrame in interface LossGenerator
      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:
      shouldDropFrame in interface LossGenerator
      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 frame
      termId - of the incoming frame.
      termOffset - of the incoming frame.
      length - of the incoming frame.
      Returns:
      true to drop, false to process