Class ParallelSnapshotReader.ParallelHaltingPredicate
- java.lang.Object
-
- io.debezium.connector.mysql.legacy.ParallelSnapshotReader.ParallelHaltingPredicate
-
- All Implemented Interfaces:
HaltingPredicate
- Enclosing class:
- ParallelSnapshotReader
static class ParallelSnapshotReader.ParallelHaltingPredicate extends Object implements HaltingPredicate
A Halting Predicate for the parallel snapshot reader. Usage for this predicate assumes two readers using two ParallelHalting Predicates. The booleans are owned by the two predicates, and keep track of whether they or the other reader has reached the end of the binlog. Test returns false if both both readers have been determined to be near the end of the binlog. Being near the end of the binlog is determined to be this predicate having seen a record with a timestamp withinDEFAULT_MIN_HALTING_DURATION
of the current time. Once a single record near the end of the binlog has been seen, we we assume the reader will stay near the end of the binlog.
-
-
Field Summary
Fields Modifier and Type Field Description private static Duration
DEFAULT_MIN_HALTING_DURATION
private static org.slf4j.Logger
LOGGER
private Duration
minHaltingDuration
private AtomicBoolean
otherReaderNearEnd
private AtomicBoolean
thisReaderNearEnd
-
Constructor Summary
Constructors Constructor Description ParallelHaltingPredicate(AtomicBoolean thisReaderNearEndRef, AtomicBoolean otherReaderNearEndRef)
ParallelHaltingPredicate(AtomicBoolean thisReaderNearEndRef, AtomicBoolean otherReaderNearEndRef, Duration minHaltingDuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(org.apache.kafka.connect.source.SourceRecord ourSourceRecord)
Whether this record should be processed by the calling reader or not.
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
DEFAULT_MIN_HALTING_DURATION
private static final Duration DEFAULT_MIN_HALTING_DURATION
-
thisReaderNearEnd
private volatile AtomicBoolean thisReaderNearEnd
-
otherReaderNearEnd
private volatile AtomicBoolean otherReaderNearEnd
-
minHaltingDuration
private final Duration minHaltingDuration
-
-
Constructor Detail
-
ParallelHaltingPredicate
ParallelHaltingPredicate(AtomicBoolean thisReaderNearEndRef, AtomicBoolean otherReaderNearEndRef)
-
ParallelHaltingPredicate
ParallelHaltingPredicate(AtomicBoolean thisReaderNearEndRef, AtomicBoolean otherReaderNearEndRef, Duration minHaltingDuration)
-
-
Method Detail
-
accepts
public boolean accepts(org.apache.kafka.connect.source.SourceRecord ourSourceRecord)
Description copied from interface:HaltingPredicate
Whether this record should be processed by the calling reader or not.- Specified by:
accepts
in interfaceHaltingPredicate
-
-