Пример #1
0
        public override UniformPair <EventBean[]> ProcessViewResult(EventBean[] newData, EventBean[] oldData, bool isSynthesize)
        {
            if (InstrumentationHelper.ENABLED)
            {
                InstrumentationHelper.Get().QResultSetProcessSimple();
            }

            EventBean[] selectOldEvents = null;
            EventBean[] selectNewEvents;
            if (Prototype.OptionalHavingExpr == null)
            {
                if (Prototype.IsSelectRStream)
                {
                    if (_orderByProcessor == null)
                    {
                        selectOldEvents = ResultSetProcessorUtil.GetSelectEventsNoHaving(_selectExprProcessor, oldData, false, isSynthesize, ExprEvaluatorContext);
                    }
                    else
                    {
                        selectOldEvents = ResultSetProcessorUtil.GetSelectEventsNoHavingWithOrderBy(_selectExprProcessor, _orderByProcessor, oldData, false, isSynthesize, ExprEvaluatorContext);
                    }
                }

                if (_orderByProcessor == null)
                {
                    selectNewEvents = ResultSetProcessorUtil.GetSelectEventsNoHaving(_selectExprProcessor, newData, true, isSynthesize, ExprEvaluatorContext);
                }
                else
                {
                    selectNewEvents = ResultSetProcessorUtil.GetSelectEventsNoHavingWithOrderBy(_selectExprProcessor, _orderByProcessor, newData, true, isSynthesize, ExprEvaluatorContext);
                }
            }
            else
            {
                if (Prototype.IsSelectRStream)
                {
                    if (_orderByProcessor == null)
                    {
                        selectOldEvents = ResultSetProcessorUtil.GetSelectEventsHaving(_selectExprProcessor, oldData, Prototype.OptionalHavingExpr, false, isSynthesize, ExprEvaluatorContext);
                    }
                    else
                    {
                        selectOldEvents = ResultSetProcessorUtil.GetSelectEventsHavingWithOrderBy(_selectExprProcessor, _orderByProcessor, oldData, Prototype.OptionalHavingExpr, false, isSynthesize, ExprEvaluatorContext);
                    }
                }
                if (_orderByProcessor == null)
                {
                    selectNewEvents = ResultSetProcessorUtil.GetSelectEventsHaving(_selectExprProcessor, newData, Prototype.OptionalHavingExpr, true, isSynthesize, ExprEvaluatorContext);
                }
                else
                {
                    selectNewEvents = ResultSetProcessorUtil.GetSelectEventsHavingWithOrderBy(_selectExprProcessor, _orderByProcessor, newData, Prototype.OptionalHavingExpr, true, isSynthesize, ExprEvaluatorContext);
                }
            }

            if (InstrumentationHelper.ENABLED)
            {
                InstrumentationHelper.Get().AResultSetProcessSimple(selectNewEvents, selectOldEvents);
            }
            return(new UniformPair <EventBean[]>(selectNewEvents, selectOldEvents));
        }
        public UniformPair <EventBean[]> ProcessViewResult(EventBean[] newData, EventBean[] oldData, bool isSynthesize)
        {
            if (InstrumentationHelper.ENABLED)
            {
                InstrumentationHelper.Get().QResultSetProcessUngroupedNonfullyAgg();
            }
            EventBean[] selectOldEvents = null;
            EventBean[] selectNewEvents;

            var eventsPerStream = new EventBean[1];

            ResultSetProcessorUtil.ApplyAggViewResult(_aggregationService, _exprEvaluatorContext, newData, oldData, eventsPerStream);

            // generate new events using select expressions
            if (_prototype.OptionalHavingNode == null)
            {
                if (_prototype.IsSelectRStream)
                {
                    if (_orderByProcessor == null)
                    {
                        selectOldEvents = ResultSetProcessorUtil.GetSelectEventsNoHaving(_selectExprProcessor, oldData, false, isSynthesize, _exprEvaluatorContext);
                    }
                    else
                    {
                        selectOldEvents = ResultSetProcessorUtil.GetSelectEventsNoHavingWithOrderBy(_selectExprProcessor, _orderByProcessor, oldData, false, isSynthesize, _exprEvaluatorContext);
                    }
                }

                if (_orderByProcessor == null)
                {
                    selectNewEvents = ResultSetProcessorUtil.GetSelectEventsNoHaving(_selectExprProcessor, newData, true, isSynthesize, _exprEvaluatorContext);
                }
                else
                {
                    selectNewEvents = ResultSetProcessorUtil.GetSelectEventsNoHavingWithOrderBy(_selectExprProcessor, _orderByProcessor, newData, true, isSynthesize, _exprEvaluatorContext);
                }
            }
            else
            {
                if (_prototype.IsSelectRStream)
                {
                    if (_orderByProcessor == null)
                    {
                        selectOldEvents = ResultSetProcessorUtil.GetSelectEventsHaving(_selectExprProcessor, oldData, _prototype.OptionalHavingNode, false, isSynthesize, _exprEvaluatorContext);
                    }
                    else
                    {
                        selectOldEvents = ResultSetProcessorUtil.GetSelectEventsHavingWithOrderBy(_selectExprProcessor, _orderByProcessor, oldData, _prototype.OptionalHavingNode, false, isSynthesize, _exprEvaluatorContext);
                    }
                }

                if (_orderByProcessor == null)
                {
                    selectNewEvents = ResultSetProcessorUtil.GetSelectEventsHaving(_selectExprProcessor, newData, _prototype.OptionalHavingNode, true, isSynthesize, _exprEvaluatorContext);
                }
                else
                {
                    selectNewEvents = ResultSetProcessorUtil.GetSelectEventsHavingWithOrderBy(_selectExprProcessor, _orderByProcessor, newData, _prototype.OptionalHavingNode, true, isSynthesize, _exprEvaluatorContext);
                }
            }

            if ((selectNewEvents == null) && (selectOldEvents == null))
            {
                if (InstrumentationHelper.ENABLED)
                {
                    InstrumentationHelper.Get().AResultSetProcessUngroupedNonfullyAgg(null, null);
                }
                return(null);
            }

            if (InstrumentationHelper.ENABLED)
            {
                InstrumentationHelper.Get().AResultSetProcessUngroupedNonfullyAgg(selectNewEvents, selectOldEvents);
            }
            return(new UniformPair <EventBean[]>(selectNewEvents, selectOldEvents));
        }