public ICollection <EventBean> Lookup(EventBean[] eventPerStream, Map parent, ICollection <EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context, IList <object> optionalKeyCollector, CompositeIndexQueryResultPostProcessor postProcessor)
        {
            var comparableStart = base.EvaluatePerStreamStart(eventPerStream, context);

            if (optionalKeyCollector != null)
            {
                optionalKeyCollector.Add(comparableStart);
            }
            if (comparableStart == null)
            {
                return(null);
            }
            var comparableEnd = base.EvaluatePerStreamEnd(eventPerStream, context);

            if (optionalKeyCollector != null)
            {
                optionalKeyCollector.Add(comparableEnd);
            }
            if (comparableEnd == null)
            {
                return(null);
            }
            comparableStart = EventBeanUtility.Coerce(comparableStart, CoercionType);
            comparableEnd   = EventBeanUtility.Coerce(comparableEnd, CoercionType);

            var index     = (TreeMap)parent;
            var submapOne = index.Head(comparableStart, !IncludeStart);
            var submapTwo = index.Tail(comparableEnd, !IncludeEnd);

            return(CompositeIndexQueryRange.Handle(eventPerStream, submapOne, submapTwo, result, next, postProcessor));
        }
예제 #2
0
        public ISet <EventBean> Lookup(EventBean theEvent, Map parent, ISet <EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context, IList <object> optionalKeyCollector)
        {
            var comparableStart = base.EvaluateLookupStart(theEvent, context);

            if (optionalKeyCollector != null)
            {
                optionalKeyCollector.Add(comparableStart);
            }
            if (comparableStart == null)
            {
                return(null);
            }
            var comparableEnd = base.EvaluateLookupEnd(theEvent, context);

            if (optionalKeyCollector != null)
            {
                optionalKeyCollector.Add(comparableEnd);
            }
            if (comparableEnd == null)
            {
                return(null);
            }
            comparableStart = EventBeanUtility.Coerce(comparableStart, CoercionType);
            comparableEnd   = EventBeanUtility.Coerce(comparableEnd, CoercionType);

            var index     = (TreeMap)parent;
            var submapOne = index.Head(comparableStart, !IncludeStart);
            var submapTwo = index.Tail(comparableEnd, !IncludeEnd);

            return(CompositeIndexQueryRange.Handle(theEvent, submapOne, submapTwo, result, next));
        }
예제 #3
0
        public ISet <EventBean> Lookup(EventBean[] eventPerStream, DataMap parent, ISet <EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context, IList <object> optionalKeyCollector)
        {
            var index      = (OrderedDictionary <object, object>)parent;
            var comparable = EvaluatePerStream(eventPerStream, context);

            if (optionalKeyCollector != null)
            {
                optionalKeyCollector.Add(comparable);
            }
            if (comparable == null)
            {
                return(null);
            }
            comparable = EventBeanUtility.Coerce(comparable, CoercionType);
            return(CompositeIndexQueryRange.Handle(eventPerStream, index.Tail(comparable, false), null, result, next));
        }
        public ICollection <EventBean> Lookup(EventBean[] eventPerStream, Map parent, ICollection <EventBean> result, CompositeIndexQuery next, ExprEvaluatorContext context, IList <object> optionalKeyCollector, CompositeIndexQueryResultPostProcessor postProcessor)
        {
            var comparableStart = base.EvaluatePerStreamStart(eventPerStream, context);

            if (optionalKeyCollector != null)
            {
                optionalKeyCollector.Add(comparableStart);
            }
            if (comparableStart == null)
            {
                return(null);
            }
            var comparableEnd = base.EvaluatePerStreamEnd(eventPerStream, context);

            if (optionalKeyCollector != null)
            {
                optionalKeyCollector.Add(comparableEnd);
            }
            if (comparableEnd == null)
            {
                return(null);
            }
            var index = (OrderedDictionary <object, object>)parent;

            comparableStart = EventBeanUtility.Coerce(comparableStart, CoercionType);
            comparableEnd   = EventBeanUtility.Coerce(comparableEnd, CoercionType);

            IDictionary <object, object> submap;

            try
            {
                submap = index.Between(comparableStart, IncludeStart, comparableEnd, IncludeEnd);
            }
            catch (ArgumentException)
            {
                if (_allowReverseRange)
                {
                    submap = index.Between(comparableEnd, IncludeStart, comparableStart, IncludeEnd);
                }
                else
                {
                    return(null);
                }
            }

            return(CompositeIndexQueryRange.Handle(eventPerStream, submap, null, result, next, postProcessor));
        }
예제 #5
0
        public ICollection <EventBean> Lookup(
            EventBean theEvent,
            DataMap parent,
            ICollection <EventBean> result,
            CompositeIndexQuery next,
            ExprEvaluatorContext context,
            IList <object> optionalKeyCollector,
            CompositeIndexQueryResultPostProcessor postProcessor)
        {
            var index      = (OrderedDictionary <object, object>)parent;
            var comparable = EvaluateLookup(theEvent, context);

            if (optionalKeyCollector != null)
            {
                optionalKeyCollector.Add(comparable);
            }
            if (comparable == null)
            {
                return(null);
            }
            comparable = EventBeanUtility.Coerce(comparable, CoercionType);
            return(CompositeIndexQueryRange.Handle(theEvent, index.Tail(comparable, false), null, result, next, postProcessor));
        }