Class TermGapScanner

java.lang.Object
io.aeron.logbuffer.TermGapScanner

public class TermGapScanner extends Object
Scans for gaps in the sequence of bytes in a replicated term buffer between the completed rebuild and the high-water-mark. This can be used for detecting loss and generating a NAK message to the source.

Note: This class is threadsafe to be used across multiple threads.

  • Constructor Details

    • TermGapScanner

      public TermGapScanner()
  • Method Details

    • scanForGap

      public static int scanForGap(UnsafeBuffer termBuffer, int termId, int termOffset, int limitOffset, TermGapScanner.GapHandler handler)
      Scan for gaps from the scanOffset up to a limit offset. Each gap will be reported to the TermGapScanner.GapHandler.
      Parameters:
      termBuffer - to be scanned for a gap.
      termId - of the current term buffer.
      termOffset - at which to start scanning.
      limitOffset - at which to stop scanning.
      handler - to call if a gap is found.
      Returns:
      offset of last contiguous frame