public final class ComparableRecordComparator extends Object implements RecordComparator
RecordComparator
instance generated by GeneratedRecordComparator
from checkpoint snapshot. Hence, we introduce ComparableRecordComparator
class to wrap the GeneratedRecordComparator
. A ComparableRecordComparator
instance is serializable and can restore the RecordComparator
from the serialized ComparableRecordComparator
. Besides, the equals(Object)
doesn't take GeneratedRecordComparator
into
account, because the code is not deterministic across different client. Therefore, equals(Object)
only compares the meta information used for generating
code of RecordComparator
.
Note: currently, this class is only used for RetractableTopNFunction
.
RetractableTopNFunction
,
Serialized FormConstructor and Description |
---|
ComparableRecordComparator(GeneratedRecordComparator generatedRecordComparator,
int[] compareKeyPositions,
LogicalType[] compareKeyTypes,
boolean[] compareOrders,
boolean[] nullsIsLast) |
Modifier and Type | Method and Description |
---|---|
int |
compare(RowData o1,
RowData o2) |
boolean |
equals(Object o) |
GeneratedRecordComparator |
getGeneratedRecordComparator() |
int |
hashCode() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public ComparableRecordComparator(GeneratedRecordComparator generatedRecordComparator, int[] compareKeyPositions, LogicalType[] compareKeyTypes, boolean[] compareOrders, boolean[] nullsIsLast)
public GeneratedRecordComparator getGeneratedRecordComparator()
public int compare(RowData o1, RowData o2)
compare
in interface Comparator<RowData>
compare
in interface RecordComparator
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.