コード例 #1
0
 public SubordTableLookupStrategyQuadTreeBase(
     EventTableQuadTree index,
     SubordTableLookupStrategyFactoryQuadTree factory)
 {
     this.index = index;
     this.factory = factory;
 }
コード例 #2
0
 public SubordTableLookupStrategyQuadTreeSubq(
     EventTableQuadTree index,
     SubordTableLookupStrategyFactoryQuadTree factory,
     int numStreamsOuter)
     : base(
         index,
         factory)
 {
     events = new EventBean[numStreamsOuter + 1];
 }
コード例 #3
0
        protected ICollection<EventBean> LookupInternal(
            EventBean[] events,
            ExprEvaluatorContext context,
            EventTableQuadTree index,
            SubordTableLookupStrategy strategy)
        {
            var x = Eval(factory.X, events, context, "x");
            var y = Eval(factory.Y, events, context, "y");
            var width = Eval(factory.Width, events, context, "width");
            var height = Eval(factory.Height, events, context, "height");

            if (context.InstrumentationProvider.Activated()) {
                context.InstrumentationProvider.QIndexSubordLookup(strategy, index, null);
                var result = this.index.QueryRange(x, y, width, height);
                context.InstrumentationProvider.AIndexSubordLookup(result, null);
                return result;
            }

            return this.index.QueryRange(x, y, width, height);
        }
コード例 #4
0
        /// <summary>
        /// The SnapshotCustomIndex
        /// </summary>
        /// <param name="queryGraphValue">The <see cref="QueryGraphValue"/></param>
        /// <param name="indexRepository">The <see cref="EventTableIndexRepository"/></param>
        /// <param name="attributes">The <see cref="Attribute"/> array</param>
        /// <param name="agentInstanceContext">The <see cref="AgentInstanceContext"/></param>
        /// <param name="queryPlanLogging">The <see cref="bool"/></param>
        /// <param name="queryPlanLogDestination">The <see cref="ILog"/></param>
        /// <param name="objectName">The <see cref="string"/></param>
        /// <returns>The <see cref="ICollection{EventBean}"/></returns>
        private static NullableObject <ICollection <EventBean> > SnapshotCustomIndex(
            QueryGraphValue queryGraphValue,
            EventTableIndexRepository indexRepository,
            Attribute[] attributes,
            AgentInstanceContext agentInstanceContext,
            bool queryPlanLogging,
            ILog queryPlanLogDestination,
            string objectName)
        {
            EventTable table     = null;
            string     indexName = null;
            QueryGraphValueEntryCustomOperation values = null;

            // find matching index
            var found = false;

            foreach (var valueDesc in queryGraphValue.Items)
            {
                if (valueDesc.Entry is QueryGraphValueEntryCustom)
                {
                    var customIndex = (QueryGraphValueEntryCustom)valueDesc.Entry;

                    foreach (var entry in indexRepository.TableIndexesRefCount)
                    {
                        if (entry.Key.AdvancedIndexDesc == null)
                        {
                            continue;
                        }
                        var metadata = indexRepository.EventTableIndexMetadata.Indexes.Get(entry.Key);
                        if (metadata == null || metadata.ExplicitIndexNameIfExplicit == null)
                        {
                            continue;
                        }
                        EventAdvancedIndexProvisionDesc provision = metadata.QueryPlanIndexItem.AdvancedIndexProvisionDesc;
                        if (provision == null)
                        {
                            continue;
                        }
                        foreach (var op in customIndex.Operations)
                        {
                            if (!provision.Factory.ProvidesIndexForOperation(op.Key.OperationName, op.Value.PositionalExpressions))
                            {
                                continue;
                            }
                            if (ExprNodeUtility.DeepEquals(entry.Key.AdvancedIndexDesc.IndexedExpressions, op.Key.ExprNodes, true))
                            {
                                values    = op.Value;
                                table     = entry.Value.Table;
                                indexName = metadata.ExplicitIndexNameIfExplicit;
                                found     = true;
                                break;
                            }
                        }

                        if (found)
                        {
                            break;
                        }
                    }
                }

                if (found)
                {
                    break;
                }
            }

            if (table == null)
            {
                return(null);
            }

            // report
            queryPlanReport(indexName, table, attributes, agentInstanceContext, queryPlanLogging, queryPlanLogDestination, objectName);

            // execute
            EventTableQuadTree index = (EventTableQuadTree)table;
            var x      = Eval(values.PositionalExpressions.Get(0).ExprEvaluator, agentInstanceContext, "x");
            var y      = Eval(values.PositionalExpressions.Get(1).ExprEvaluator, agentInstanceContext, "y");
            var width  = Eval(values.PositionalExpressions.Get(2).ExprEvaluator, agentInstanceContext, "width");
            var height = Eval(values.PositionalExpressions.Get(3).ExprEvaluator, agentInstanceContext, "height");
            var result = index.QueryRange(x, y, width, height);

            return(new NullableObject <ICollection <EventBean> >(result));
        }
コード例 #5
0
 public SubordTableLookupStrategyQuadTreeNW(EventTableQuadTree index, SubordTableLookupStrategyFactoryQuadTree factory)
     : base(index, factory)
 {
 }