Beispiel #1
0
        public bool Filter(int streamLookup, int streamIndexed, ExcludePlanFilterOperatorType opType, params ExprNode[] exprNodes)
        {
            EventBean @event = ExcludePlanHintExprUtil.ToEvent(streamLookup,
                                                               streamIndexed, _streamNames[streamLookup], _streamNames[streamIndexed],
                                                               opType.GetName().ToLower(), exprNodes);

            if (_queryPlanLogging && QueryPlanLog.IsInfoEnabled)
            {
                QueryPlanLog.Info("Exclude-plan-hint combination " + EventBeanUtility.PrintEvent(@event));
            }
            EventBean[] eventsPerStream = new EventBean[] { @event };

            var evaluateParams = new EvaluateParams(eventsPerStream, true, _exprEvaluatorContext);

            foreach (ExprEvaluator evaluator in _evaluators)
            {
                var pass = evaluator.Evaluate(evaluateParams);
                if (pass != null && true.Equals(pass))
                {
                    if (_queryPlanLogging && QueryPlanLog.IsInfoEnabled)
                    {
                        QueryPlanLog.Info("Exclude-plan-hint combination : true");
                    }
                    return(true);
                }
            }
            if (_queryPlanLogging && QueryPlanLog.IsInfoEnabled)
            {
                QueryPlanLog.Info("Exclude-plan-hint combination : false");
            }
            return(false);
        }
Beispiel #2
0
        public bool Filter(
            int streamLookup,
            int streamIndexed,
            ExcludePlanFilterOperatorType opType,
            params ExprNode[] exprNodes)
        {
            EventBean @event = ExcludePlanHintExprUtil.ToEvent(
                streamLookup,
                streamIndexed,
                streamNames[streamLookup],
                streamNames[streamIndexed],
                opType.GetName().ToLowerInvariant(),
                exprNodes);
            if (queryPlanLogging && QUERY_PLAN_LOG.IsInfoEnabled) {
                QUERY_PLAN_LOG.Info("Exclude-plan-hint combination " + EventBeanUtility.PrintEvent(@event));
            }

            EventBean[] eventsPerStream = new EventBean[] {@event};

            foreach (ExprEvaluator evaluator in evaluators) {
                var pass = evaluator.Evaluate(eventsPerStream, true, null);
                if (pass != null && true.Equals(pass)) {
                    if (queryPlanLogging && QUERY_PLAN_LOG.IsInfoEnabled) {
                        QUERY_PLAN_LOG.Info("Exclude-plan-hint combination : true");
                    }

                    return true;
                }
            }

            if (queryPlanLogging && QUERY_PLAN_LOG.IsInfoEnabled) {
                QUERY_PLAN_LOG.Info("Exclude-plan-hint combination : false");
            }

            return false;
        }