final class MySqlHistoryRecordComparator extends HistoryRecordComparator
| Modifier and Type | Field and Description |
|---|---|
private Predicate<String> |
gtidSourceFilter |
INSTANCE| Constructor and Description |
|---|
MySqlHistoryRecordComparator(Predicate<String> gtidSourceFilter) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
isPositionAtOrBefore(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 by #offset(). |
isAtOrBefore, isSameSource, usingPositionsprotected boolean isPositionAtOrBefore(Document recorded, Document desired)
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 by #offset().
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.
isPositionAtOrBefore in class HistoryRecordComparatorrecorded - 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 nullgtidFilter - the predicate function that will return true if a GTID source is to be included, or
false if a GTID source is to be excluded; may be null if no filtering is to be donetrue if the recorded position is at or before the desired position; or false otherwiseCopyright © 2021 JBoss by Red Hat. All rights reserved.