Package org.apache.druid.query.scan
Class ScanResultValueTimestampComparator
- java.lang.Object
-
- org.apache.druid.query.scan.ScanResultValueTimestampComparator
-
- All Implemented Interfaces:
Comparator<ScanResultValue>
public class ScanResultValueTimestampComparator extends Object implements Comparator<ScanResultValue>
This comparator class supports comparisons of ScanResultValues based on the timestamp of their first event. Since only the first event is looked at, this Comparator is especially useful for unbatched ScanResultValues (such as inScanQueryQueryToolChest#mergeResults(org.apache.druid.query.QueryRunner
. The comparator takes a scanQuery as a parameter so that it knows the result format (list or compactedList) of Object ScanResultValue#events. It uses this result format to perform a bunch of type casts on the object to get the timestamp then compares the timestamps.)
-
-
Constructor Summary
Constructors Constructor Description ScanResultValueTimestampComparator(ScanQuery scanQuery)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(ScanResultValue o1, ScanResultValue o2)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
ScanResultValueTimestampComparator
public ScanResultValueTimestampComparator(ScanQuery scanQuery)
-
-
Method Detail
-
compare
public int compare(ScanResultValue o1, ScanResultValue o2)
- Specified by:
compare
in interfaceComparator<ScanResultValue>
-
-