Interface OrderByProcessor


public interface OrderByProcessor
A processor for ordering output events according to the order specified in the order-by clause.
  • Field Details

  • 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 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
      aggregationService - 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 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 evaluation
      aggregationService - 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 sort
      currentGenerators - - 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 evaluation
      aggregationService - 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 stream
      isNewData - is true for new data
      exprEvaluatorContext - 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 stream
      isNewData - is true for new data
      exprEvaluatorContext - context for expression evalauation
      level - 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 sort
      orderKeys - is the keys to sort by
      exprEvaluatorContext - 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 - first
      sortKeyFirst - sort key first
      second - second
      sortKeySecond - sort key seconds
      Returns:
      sorted