Esempio n. 1
0
        public TimeOrderView(
            AgentInstanceViewFactoryChainContext agentInstanceContext,
            TimeOrderViewFactory factory,
            IStreamSortRankRandomAccess optionalSortedRandomAccess,
            TimePeriodProvide timePeriodProvide)
        {
            this.agentInstanceContext = agentInstanceContext.AgentInstanceContext;
            this.factory = factory;
            this.optionalSortedRandomAccess = optionalSortedRandomAccess;
            scheduleSlot = agentInstanceContext.StatementContext.ScheduleBucket.AllocateSlot();
            this.timePeriodProvide = timePeriodProvide;

            sortedEvents = new OrderedListDictionary<object, object>();

            ScheduleHandleCallback callback = new ProxyScheduleHandleCallback {
                ProcScheduledTrigger = () => {
                    agentInstanceContext.AuditProvider.ScheduleFire(
                        agentInstanceContext.AgentInstanceContext,
                        ScheduleObjectType.view,
                        factory.ViewName);
                    agentInstanceContext.InstrumentationProvider.QViewScheduledEval(factory);
                    Expire();
                    agentInstanceContext.InstrumentationProvider.AViewScheduledEval();
                }
            };
            handle = new EPStatementHandleCallbackSchedule(
                agentInstanceContext.EpStatementAgentInstanceHandle,
                callback);
        }
Esempio n. 2
0
 public View MakeView(AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext)
 {
     int sortWindowSize = ViewFactoryUtil.EvaluateSizeParam(
         ViewName,
         SizeEvaluator,
         agentInstanceViewFactoryContext.AgentInstanceContext);
     IStreamSortRankRandomAccess rankedRandomAccess =
         agentInstanceViewFactoryContext.StatementContext.ViewServicePreviousFactory
             .GetOptPreviousExprSortedRankedAccess(agentInstanceViewFactoryContext);
     return new RankWindowView(this, sortWindowSize, rankedRandomAccess, agentInstanceViewFactoryContext);
 }
Esempio n. 3
0
        public IStreamSortRankRandomAccess GetOptPreviousExprSortedRankedAccess(
            AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext)
        {
            IStreamSortRankRandomAccess rankedRandomAccess = null;
            if (agentInstanceViewFactoryContext.PreviousNodeGetter != null) {
                var getter = (RandomAccessByIndexGetter) agentInstanceViewFactoryContext.PreviousNodeGetter;
                rankedRandomAccess = new IStreamSortRankRandomAccessImpl(getter);
                getter.Updated(rankedRandomAccess);
            }

            return rankedRandomAccess;
        }
Esempio n. 4
0
        public SortWindowView(
            SortWindowViewFactory factory,
            int sortWindowSize,
            IStreamSortRankRandomAccess optionalSortedRandomAccess,
            AgentInstanceViewFactoryChainContext agentInstanceViewFactoryContext)
        {
            this.factory = factory;
            this.sortWindowSize = sortWindowSize;
            this.optionalSortedRandomAccess = optionalSortedRandomAccess;
            agentInstanceContext = agentInstanceViewFactoryContext.AgentInstanceContext;

            sortedEvents = new OrderedListDictionary<object, object>(factory.IComparer);
        }
Esempio n. 5
0
        public RankWindowView(
            RankWindowViewFactory rankWindowViewFactory,
            int sortWindowSize,
            IStreamSortRankRandomAccess optionalRankedRandomAccess,
            AgentInstanceViewFactoryChainContext agentInstanceContext)
        {
            _rankWindowViewFactory = rankWindowViewFactory;
            _sortWindowSize = sortWindowSize;
            _optionalRankedRandomAccess = optionalRankedRandomAccess;
            _agentInstanceContext = agentInstanceContext.AgentInstanceContext;

            _sortedEvents = new OrderedListDictionary<object, object>(rankWindowViewFactory.Comparer);
            _uniqueKeySortKeys = new Dictionary<object, object>();
        }