Interface OrderByProcessor
public interface OrderByProcessor
A processor for ordering output events according to the order specified in the order-by clause.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetSortKey
(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext) Returns the sort key for a given row.getSortKeyRollup
(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext, AggregationGroupByRollupLevel level) Returns the sort key for a given row for rollup.sortPlain
(EventBean[] outgoingEvents, EventBean[][] generatingEvents, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext, AggregationService aggregationService) Sort the output events.sortRollup
(EventBean[] outgoingEvents, List<GroupByRollupKey> currentGenerators, boolean newData, ExprEvaluatorContext exprEvaluatorContext, AggregationService aggregationService) Sort the output events, using the provided group-by keys for evaluating grouped aggregation functions, and avoiding the cost of recomputing the keys.sortTwoKeys
(EventBean first, Object sortKeyFirst, EventBean second, Object sortKeySecond) Sort two keys and eventssortWGroupKeys
(EventBean[] outgoingEvents, EventBean[][] generatingEvents, Object[] groupByKeys, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext, AggregationService aggregationService) Sort the output events, using the provided group-by keys for evaluating grouped aggregation functions, and avoiding the cost of recomputing the keys.sortWOrderKeys
(EventBean[] outgoingEvents, Object[] orderKeys, ExprEvaluatorContext exprEvaluatorContext) Sort a given array of outgoing events using the sort keys returning a sorted outgoing event array.
-
Field Details
-
EPTYPE
-
-
Method Details
-
sortPlain
EventBean[] sortPlain(EventBean[] outgoingEvents, EventBean[][] generatingEvents, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext, AggregationService aggregationService) Sort the output events. If the order-by processor needs group-by keys to evaluate the expressions in the order-by clause, these will be computed from the generating events.- Parameters:
outgoingEvents
- - the events to be sortedgeneratingEvents
- - the events that generated the output events (each event has a corresponding array of generating events per different event streams)isNewData
- - indicates whether we are dealing with new data (istream) or old data (rstream)exprEvaluatorContext
- context for expression evalauationaggregationService
- aggregation svc- Returns:
- an array containing the output events in sorted order
-
sortWGroupKeys
EventBean[] sortWGroupKeys(EventBean[] outgoingEvents, EventBean[][] generatingEvents, Object[] groupByKeys, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext, AggregationService aggregationService) Sort the output events, using the provided group-by keys for evaluating grouped aggregation functions, and avoiding the cost of recomputing the keys.- Parameters:
outgoingEvents
- - the events to sortgeneratingEvents
- - the events that generated the output events (each event has a corresponding array of generating events per different event streams)groupByKeys
- - the keys to use for determining the group-by group of output eventsisNewData
- - indicates whether we are dealing with new data (istream) or old data (rstream)exprEvaluatorContext
- context for expression evaluationaggregationService
- aggregation svc- Returns:
- an array containing the output events in sorted order
-
sortRollup
EventBean[] sortRollup(EventBean[] outgoingEvents, List<GroupByRollupKey> currentGenerators, boolean newData, ExprEvaluatorContext exprEvaluatorContext, AggregationService aggregationService) Sort the output events, using the provided group-by keys for evaluating grouped aggregation functions, and avoiding the cost of recomputing the keys.- Parameters:
outgoingEvents
- - the events to sortcurrentGenerators
- - the events that generated the output events (each event has a corresponding array of generating events per different event streams)newData
- - indicates whether we are dealing with new data (istream) or old data (rstream)exprEvaluatorContext
- context for expression evaluationaggregationService
- aggregation svc- Returns:
- an array containing the output events in sorted order
-
getSortKey
Object getSortKey(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext) Returns the sort key for a given row.- Parameters:
eventsPerStream
- is the row consisting of one event per streamisNewData
- is true for new dataexprEvaluatorContext
- context for expression evalauation- Returns:
- sort key
-
getSortKeyRollup
Object getSortKeyRollup(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext, AggregationGroupByRollupLevel level) Returns the sort key for a given row for rollup.- Parameters:
eventsPerStream
- is the row consisting of one event per streamisNewData
- is true for new dataexprEvaluatorContext
- context for expression evalauationlevel
- rollup level- Returns:
- sort key
-
sortWOrderKeys
EventBean[] sortWOrderKeys(EventBean[] outgoingEvents, Object[] orderKeys, ExprEvaluatorContext exprEvaluatorContext) Sort a given array of outgoing events using the sort keys returning a sorted outgoing event array.- Parameters:
outgoingEvents
- is the events to sortorderKeys
- is the keys to sort byexprEvaluatorContext
- context for expression evalauation- Returns:
- sorted events
-
sortTwoKeys
EventBean[] sortTwoKeys(EventBean first, Object sortKeyFirst, EventBean second, Object sortKeySecond) Sort two keys and events- Parameters:
first
- firstsortKeyFirst
- sort key firstsecond
- secondsortKeySecond
- sort key seconds- Returns:
- sorted
-