public ICollection <EventBean> Get(EventBean theEvent, DataMap parent, ExprEvaluatorContext context)
        {
            _events[_lookupStream] = theEvent;
            var mk         = EventBeanUtility.GetMultiKey(_events, _evaluators, context, _keyCoercionTypes);
            var innerIndex = (DataMap)parent.Get(mk);

            if (innerIndex == null)
            {
                return(null);
            }
            return(_next.Get(theEvent, innerIndex, context));
        }
Example #2
0
        public ICollection<EventBean> Get(
            EventBean theEvent,
            IDictionary<object, CompositeIndexEntry> parent,
            ExprEvaluatorContext context,
            CompositeIndexQueryResultPostProcessor postProcessor)
        {
            _events[_lookupStream] = theEvent;
            var mk = _hashGetter.Evaluate(_events, true, context);
            var innerEntry = parent.Get(mk);
            if (innerEntry == null) {
                return null;
            }

            var innerIndex = innerEntry.AssertIndex();
            return _next.Get(theEvent, innerIndex, context, postProcessor);
        }
        public ICollection <EventBean> Lookup(EventBean[] eventsPerStream, ExprEvaluatorContext context)
        {
            if (InstrumentationHelper.ENABLED)
            {
                InstrumentationHelper.Get().QIndexSubordLookup(this, _index, null);
                IList <Object>   keys   = new List <Object>(2); // can collect nulls
                ISet <EventBean> result = _innerIndexQuery.GetCollectKeys(eventsPerStream, _index.MapIndex, context, keys);
                InstrumentationHelper.Get().AIndexSubordLookup(result, keys.Count > 1 ? keys.ToArray() : keys[0]);
                return(result);
            }

            return(_innerIndexQuery.Get(eventsPerStream, _index.MapIndex, context));
        }
Example #4
0
        public IEnumerator <EventBean> Lookup(EventBean lookupEvent, EventTable[] indexTable, ExprEvaluatorContext context)
        {
            // The table may not be indexed as the cache may not actively cache, in which case indexing doesn't makes sense
            if (indexTable[0] is PropertyCompositeEventTable)
            {
                var table = (PropertyCompositeEventTable)indexTable[0];
                var index = table.IndexTable;

                var events = _chain.Get(lookupEvent, index, context, table.PostProcessor);
                if (events != null)
                {
                    return(events.GetEnumerator());
                }
                return(null);
            }

            return(indexTable[0].GetEnumerator());
        }
        public ICollection <EventBean> Lookup(EventBean theEvent, Cursor cursor, ExprEvaluatorContext context)
        {
            if (InstrumentationHelper.ENABLED)
            {
                InstrumentationHelper.Get().QIndexJoinLookup(this, _index);
                var keys = new List <Object>(2);
                ICollection <EventBean> resultX = _chain.GetCollectKeys(theEvent, _index.MapIndex, context, keys, _index.PostProcessor);
                InstrumentationHelper.Get().AIndexJoinLookup(resultX, keys.Count > 1 ? keys.ToArray() : keys[0]);
                return(resultX);
            }

            ICollection <EventBean> result = _chain.Get(theEvent, _index.MapIndex, context, _index.PostProcessor);

            if (result != null && result.IsEmpty())
            {
                return(null);
            }
            return(result);
        }