Example #1
0
        public EventBean[] Sort(EventBean[] outgoingEvents, EventBean[][] generatingEvents, bool isNewData, ExprEvaluatorContext exprEvaluatorContext)
        {
            _rowLimitProcessor.DetermineCurrentLimit();

            if (_rowLimitProcessor.CurrentRowLimit == 1 &&
                _rowLimitProcessor.CurrentOffset == 0 &&
                outgoingEvents != null &&
                outgoingEvents.Length > 1)
            {
                EventBean minmax = _orderByProcessor.DetermineLocalMinMax(outgoingEvents, generatingEvents, isNewData, exprEvaluatorContext);
                return(new EventBean[] { minmax });
            }

            EventBean[] sorted = _orderByProcessor.Sort(outgoingEvents, generatingEvents, isNewData, exprEvaluatorContext);
            return(_rowLimitProcessor.ApplyLimit(sorted));
        }