Class 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 in ScanQueryQueryToolChest#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.