Package io.debezium.relational.history
Class HistoryRecordComparator
java.lang.Object
io.debezium.relational.history.HistoryRecordComparator
Compares HistoryRecord instances to determine which came first.
- Since:
- 0.2
- Author:
- Randall Hauch
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HistoryRecordComparator
A comparator instance that requires therecords' sources
to be the same and considers only those fields that are in both records'positions
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isAtOrBefore
(HistoryRecord record1, HistoryRecord record2) Determine if the firstHistoryRecord
is at the same or earlier point in time than the secondHistoryRecord
.protected boolean
isPositionAtOrBefore
(Document position1, Document position2) protected boolean
isSameSource
(Document source1, Document source2)
-
Field Details
-
INSTANCE
A comparator instance that requires therecords' sources
to be the same and considers only those fields that are in both records'positions
.
-
-
Constructor Details
-
HistoryRecordComparator
public HistoryRecordComparator()
-
-
Method Details
-
isAtOrBefore
Determine if the firstHistoryRecord
is at the same or earlier point in time than the secondHistoryRecord
.- Parameters:
record1
- the first record; never nullrecord2
- the second record; never null- Returns:
true
if the first record is at the same or earlier point in time than the second record, orfalse
otherwise
-
isPositionAtOrBefore
-
isSameSource
-