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 within
DEFAULT_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
FieldsModifier and TypeFieldDescriptionprivate static final Durationprivate static final org.slf4j.Loggerprivate final Durationprivate AtomicBooleanprivate AtomicBoolean -
Constructor Summary
ConstructorsConstructorDescriptionParallelHaltingPredicate(AtomicBoolean thisReaderNearEndRef, AtomicBoolean otherReaderNearEndRef) ParallelHaltingPredicate(AtomicBoolean thisReaderNearEndRef, AtomicBoolean otherReaderNearEndRef, Duration minHaltingDuration) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(org.apache.kafka.connect.source.SourceRecord ourSourceRecord) Whether this record should be processed by the calling reader or not.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
DEFAULT_MIN_HALTING_DURATION
-
thisReaderNearEnd
-
otherReaderNearEnd
-
minHaltingDuration
-
-
Constructor Details
-
ParallelHaltingPredicate
ParallelHaltingPredicate(AtomicBoolean thisReaderNearEndRef, AtomicBoolean otherReaderNearEndRef) -
ParallelHaltingPredicate
ParallelHaltingPredicate(AtomicBoolean thisReaderNearEndRef, AtomicBoolean otherReaderNearEndRef, Duration minHaltingDuration)
-
-
Method Details
-
accepts
public boolean accepts(org.apache.kafka.connect.source.SourceRecord ourSourceRecord) Description copied from interface:HaltingPredicateWhether this record should be processed by the calling reader or not.- Specified by:
acceptsin interfaceHaltingPredicate
-