Package io.aeron.logbuffer
Class TermGapScanner
java.lang.Object
io.aeron.logbuffer.TermGapScanner
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceHandler for notifying of gaps in the log. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intscanForGap(UnsafeBuffer termBuffer, int termId, int termOffset, int limitOffset, TermGapScanner.GapHandler handler) Scan for gaps from the scanOffset up to a limit offset.
-
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 theTermGapScanner.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
-