public class LossDetector
extends java.lang.Object
implements io.aeron.logbuffer.TermGapScanner.GapHandler
| Constructor and Description |
|---|
LossDetector(FeedbackDelayGenerator delayGenerator,
LossHandler lossHandler)
Create a loss detector for a channel.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
lossFound(long scanOutcome)
Has loss been found in the scan?
|
void |
onGap(int termId,
int offset,
int length) |
static long |
pack(int rebuildOffset,
boolean lossFound)
Pack the values for workCount and rebuildOffset into a long for returning on the stack.
|
static int |
rebuildOffset(long scanOutcome)
The offset up to which the log has been rebuilt.
|
long |
scan(org.agrona.concurrent.UnsafeBuffer termBuffer,
long rebuildPosition,
long hwmPosition,
long now,
int termLengthMask,
int positionBitsToShift,
int initialTermId)
Scan for gaps and handle received data.
|
public LossDetector(FeedbackDelayGenerator delayGenerator, LossHandler lossHandler)
delayGenerator - to use for delay determinationlossHandler - to call when signalling a gappublic long scan(org.agrona.concurrent.UnsafeBuffer termBuffer,
long rebuildPosition,
long hwmPosition,
long now,
int termLengthMask,
int positionBitsToShift,
int initialTermId)
termBuffer - to scanrebuildPosition - to start scanning fromhwmPosition - to scan up tonow - time in nanosecondstermLengthMask - used for offset calculationpositionBitsToShift - used for position calculationinitialTermId - used by the scannerpublic void onGap(int termId,
int offset,
int length)
onGap in interface io.aeron.logbuffer.TermGapScanner.GapHandlerpublic static long pack(int rebuildOffset,
boolean lossFound)
rebuildOffset - value to be packed.lossFound - value to be packed.public static boolean lossFound(long scanOutcome)
scanOutcome - into which the fragments read value has been packed.public static int rebuildOffset(long scanOutcome)
scanOutcome - into which the offset value has been packed.Copyright © 2014-2017 Real Logic Ltd. All Rights Reserved.