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 Form| Constructor and Description |
|---|
ComparableRecordComparator(GeneratedRecordComparator generatedRecordComparator,
int[] compareKeyPositions,
org.apache.flink.table.types.logical.LogicalType[] compareKeyTypes,
boolean[] compareOrders,
boolean[] nullsIsLast) |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(org.apache.flink.table.data.RowData o1,
org.apache.flink.table.data.RowData o2) |
boolean |
equals(Object o) |
GeneratedRecordComparator |
getGeneratedRecordComparator() |
int |
hashCode() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic ComparableRecordComparator(GeneratedRecordComparator generatedRecordComparator, int[] compareKeyPositions, org.apache.flink.table.types.logical.LogicalType[] compareKeyTypes, boolean[] compareOrders, boolean[] nullsIsLast)
public GeneratedRecordComparator getGeneratedRecordComparator()
public int compare(org.apache.flink.table.data.RowData o1,
org.apache.flink.table.data.RowData o2)
compare in interface Comparator<org.apache.flink.table.data.RowData>compare in interface RecordComparatorpublic boolean equals(Object o)
equals in interface Comparator<org.apache.flink.table.data.RowData>equals in class ObjectCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.