Class AbstractHistoryRecordComparator
java.lang.Object
io.debezium.relational.history.HistoryRecordComparator
io.debezium.connector.mysql.strategy.AbstractHistoryRecordComparator
- Direct Known Subclasses:
MariaDbHistoryRecordComparator,MySqlHistoryRecordComparator
- Author:
- Chris Cranford
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class -
Field Summary
FieldsFields inherited from class io.debezium.relational.history.HistoryRecordComparator
INSTANCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract GtidSetcreateGtidSet(String gtidSet) booleanisPositionAtOrBefore(Document recorded, Document desired) Determine whether the first offset is at or before the point in time of the second offset, where the offsets are given in JSON representation of the maps returned byMySqlOffsetContext.getOffset().Methods inherited from class io.debezium.relational.history.HistoryRecordComparator
isAtOrBefore, isSameSource
-
Field Details
-
gtidSourceFilter
-
-
Constructor Details
-
AbstractHistoryRecordComparator
-
-
Method Details
-
createGtidSet
-
isPositionAtOrBefore
Determine whether the first offset is at or before the point in time of the second offset, where the offsets are given in JSON representation of the maps returned byMySqlOffsetContext.getOffset().This logic makes a significant assumption: once a MySQL server/cluster has GTIDs enabled, they will never be disabled. This is the only way to compare a position with a GTID to a position without a GTID, and we conclude that any position with a GTID is *after* the position without.
When both positions have GTIDs, then we compare the positions by using only the GTIDs. Of course, if the GTIDs are the same, then we also look at whether they have snapshots enabled.
- Overrides:
isPositionAtOrBeforein classHistoryRecordComparator- Parameters:
recorded- the position obtained from recorded history; never nulldesired- the desired position that we want to obtain, which should be after some recorded positions, at some recorded positions, and before other recorded positions; never null- Returns:
trueif the recorded position is at or before the desired position; orfalseotherwise
-