public class SortingTopNProjector extends java.lang.Object implements Projector
Constructor and Description |
---|
SortingTopNProjector(java.util.Collection<? extends Input<?>> inputs,
java.lang.Iterable<? extends CollectExpression<Row,?>> collectExpressions,
int numOutputs,
java.util.Comparator<java.lang.Object[]> ordering,
int limit,
int offset) |
Modifier and Type | Method and Description |
---|---|
BatchIterator |
apply(BatchIterator batchIterator) |
boolean |
providesIndependentScroll()
Indicates that the projector supports scrolling independent of the source iterator.
|
public SortingTopNProjector(java.util.Collection<? extends Input<?>> inputs, java.lang.Iterable<? extends CollectExpression<Row,?>> collectExpressions, int numOutputs, java.util.Comparator<java.lang.Object[]> ordering, int limit, int offset)
inputs
- contains output Input
s and orderBy Input
scollectExpressions
- gathered from outputs and orderBy inputsnumOutputs
- inputs
contains this much output Input
s starting form index 0ordering
- ordering that is used to compare the rowslimit
- the number of rows to gather, pass to upStreamoffset
- the initial offset, this number of rows are skippedpublic BatchIterator apply(BatchIterator batchIterator)
apply
in interface java.util.function.Function<BatchIterator,BatchIterator>
public boolean providesIndependentScroll()
Projector
If the projector does not support independent scrolling, the source iterator must provide the scrolling capability on its own
providesIndependentScroll
in interface Projector