Package org.apache.druid.collections
Class StableLimitingSorter<T>
java.lang.Object
org.apache.druid.collections.StableLimitingSorter<T>
Simultaneously sorts and limits its input.
The sort is stable, meaning that equal elements (as determined by the comparator) will not be reordered.
Not thread-safe.
Note: this class doesn't have its own unit tests. It is tested along with
TopNSequence in "TopNSequenceTest".-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
StableLimitingSorter
-
-
Method Details
-
add
Offer an element to the sorter. -
size
public int size()Returns the number of elements currently in the sorter. -
drain
Drain elements in sorted order (least first).
-