com.espertech.esper.epl.core
Class OrderByProcessorOrderedLimit

java.lang.Object
  extended by com.espertech.esper.epl.core.OrderByProcessorOrderedLimit
All Implemented Interfaces:
OrderByProcessor

public class OrderByProcessorOrderedLimit
extends java.lang.Object
implements OrderByProcessor

Sorter and row limiter in one: sorts using a sorter and row limits


Constructor Summary
OrderByProcessorOrderedLimit(OrderByProcessorImpl orderByProcessor, RowLimitProcessor rowLimitProcessor)
          Ctor.
 
Method Summary
 java.lang.Object getSortKey(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
          Returns the sort key for a given row.
 java.lang.Object getSortKey(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext, OrderByElement[] elementsForLevel)
           
 java.lang.Object[] getSortKeyPerRow(EventBean[] generatingEvents, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
          Returns the sort key for a each row where a row is a single event (no join, single stream).
 EventBean[] sort(EventBean[] outgoingEvents, EventBean[][] generatingEvents, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
          Sort the output events.
 EventBean[] sort(EventBean[] outgoingEvents, EventBean[][] generatingEvents, java.lang.Object[] groupByKeys, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
          Sort the output events, using the provided group-by keys for evaluating grouped aggregation functions, and avoiding the cost of recomputing the keys.
 EventBean[] sort(EventBean[] outgoingEvents, java.util.List<GroupByRollupKey> currentGenerators, boolean newData, AgentInstanceContext agentInstanceContext, OrderByElement[][] elementsPerLevel)
           
 EventBean[] sort(EventBean[] outgoingEvents, java.lang.Object[] orderKeys, ExprEvaluatorContext exprEvaluatorContext)
          Sort a given array of outgoing events using the sort keys returning a sorted outgoing event array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderByProcessorOrderedLimit

public OrderByProcessorOrderedLimit(OrderByProcessorImpl orderByProcessor,
                                    RowLimitProcessor rowLimitProcessor)
Ctor.

Parameters:
orderByProcessor - the sorter
rowLimitProcessor - the row limiter
Method Detail

sort

public EventBean[] sort(EventBean[] outgoingEvents,
                        EventBean[][] generatingEvents,
                        boolean isNewData,
                        ExprEvaluatorContext exprEvaluatorContext)
Description copied from interface: OrderByProcessor
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.

Specified by:
sort in interface OrderByProcessor
Parameters:
outgoingEvents - - the events to be sorted
generatingEvents - - 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 evalauation
Returns:
an array containing the output events in sorted order

sort

public EventBean[] sort(EventBean[] outgoingEvents,
                        java.util.List<GroupByRollupKey> currentGenerators,
                        boolean newData,
                        AgentInstanceContext agentInstanceContext,
                        OrderByElement[][] elementsPerLevel)
Specified by:
sort in interface OrderByProcessor

sort

public EventBean[] sort(EventBean[] outgoingEvents,
                        EventBean[][] generatingEvents,
                        java.lang.Object[] groupByKeys,
                        boolean isNewData,
                        ExprEvaluatorContext exprEvaluatorContext)
Description copied from interface: OrderByProcessor
Sort the output events, using the provided group-by keys for evaluating grouped aggregation functions, and avoiding the cost of recomputing the keys.

Specified by:
sort in interface OrderByProcessor
Parameters:
outgoingEvents - - the events to sort
generatingEvents - - 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 events
isNewData - - indicates whether we are dealing with new data (istream) or old data (rstream)
exprEvaluatorContext - context for expression evalauation
Returns:
an array containing the output events in sorted order

getSortKey

public java.lang.Object getSortKey(EventBean[] eventsPerStream,
                                   boolean isNewData,
                                   ExprEvaluatorContext exprEvaluatorContext)
Description copied from interface: OrderByProcessor
Returns the sort key for a given row.

Specified by:
getSortKey in interface OrderByProcessor
Parameters:
eventsPerStream - is the row consisting of one event per stream
isNewData - is true for new data
exprEvaluatorContext - context for expression evalauation
Returns:
sort key

getSortKey

public java.lang.Object getSortKey(EventBean[] eventsPerStream,
                                   boolean isNewData,
                                   ExprEvaluatorContext exprEvaluatorContext,
                                   OrderByElement[] elementsForLevel)
Specified by:
getSortKey in interface OrderByProcessor

getSortKeyPerRow

public java.lang.Object[] getSortKeyPerRow(EventBean[] generatingEvents,
                                           boolean isNewData,
                                           ExprEvaluatorContext exprEvaluatorContext)
Description copied from interface: OrderByProcessor
Returns the sort key for a each row where a row is a single event (no join, single stream).

Specified by:
getSortKeyPerRow in interface OrderByProcessor
Parameters:
generatingEvents - is the rows consisting of one event per row
isNewData - is true for new data
exprEvaluatorContext - context for expression evalauation
Returns:
sort key for each row

sort

public EventBean[] sort(EventBean[] outgoingEvents,
                        java.lang.Object[] orderKeys,
                        ExprEvaluatorContext exprEvaluatorContext)
Description copied from interface: OrderByProcessor
Sort a given array of outgoing events using the sort keys returning a sorted outgoing event array.

Specified by:
sort in interface OrderByProcessor
Parameters:
outgoingEvents - is the events to sort
orderKeys - is the keys to sort by
exprEvaluatorContext - context for expression evalauation
Returns:
sorted events

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com