Class MultiGapLossGenerator

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

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

    • MultiGapLossGenerator

      public MultiGapLossGenerator(int termId, int gapRadix, int gapLength, int totalGaps)
      Set the range of messages to be dropped.
      Parameters:
      termId - to be dropped
      gapRadix - the initial offset and subsequent interval between gaps - must be a power of 2
      gapLength - length of each gap
      totalGaps - the total number of gaps
  • 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