public EvalInsertWildcardSSWrapperRevision(SelectExprContext selectExprContext,
                                            EventType resultEventType,
                                            ValueAddEventProcessor vaeProcessor)
     : base(selectExprContext, resultEventType)
 {
     _vaeProcessor = vaeProcessor;
 }
 public NamedWindowProcessor CreateProcessor(
     string name,
     NamedWindowMgmtServiceImpl namedWindowMgmtService,
     NamedWindowDispatchService namedWindowDispatchService,
     string contextName,
     EventType eventType,
     StatementResultService statementResultService,
     ValueAddEventProcessor revisionProcessor,
     string eplExpression,
     string statementName,
     bool isPrioritized,
     bool isEnableSubqueryIndexShare,
     bool enableQueryPlanLog,
     MetricReportingService metricReportingService,
     bool isBatchingDataWindow,
     bool isVirtualDataWindow,
     ICollection <string> optionalUniqueKeyProps,
     string eventTypeAsName,
     StatementContext statementContextCreateWindow)
 {
     return(new NamedWindowProcessor(
                name, namedWindowMgmtService, namedWindowDispatchService, contextName, eventType, statementResultService,
                revisionProcessor, eplExpression, statementName, isPrioritized, isEnableSubqueryIndexShare,
                enableQueryPlanLog, metricReportingService, isBatchingDataWindow, isVirtualDataWindow,
                optionalUniqueKeyProps, eventTypeAsName, statementContextCreateWindow));
 }
Example #3
0
 public EvalInsertNoWildcardSingleColCoercionBeanWrapVariant(
     SelectExprContext selectExprContext,
     EventType resultEventType,
     ValueAddEventProcessor vaeProcessor)
     : base(selectExprContext, resultEventType)
 {
     _vaeProcessor = vaeProcessor;
 }
 public EvalInsertNoWildcardSingleColCoercionRevisionBean(SelectExprContext selectExprContext,
                                                          EventType resultEventType,
                                                          ValueAddEventProcessor vaeProcessor,
                                                          EventType vaeInnerEventType)
     : base(selectExprContext, resultEventType)
 {
     _vaeProcessor      = vaeProcessor;
     _vaeInnerEventType = vaeInnerEventType;
 }
Example #5
0
 public EvalInsertWildcardJoinRevision(SelectExprContext selectExprContext,
                                       EventType resultEventType,
                                       SelectExprProcessor joinWildcardProcessor,
                                       ValueAddEventProcessor vaeProcessor)
     : base(selectExprContext, resultEventType)
 {
     _joinWildcardProcessor = joinWildcardProcessor;
     _vaeProcessor          = vaeProcessor;
 }
Example #6
0
        public NamedWindowProcessor AddProcessor(
            string name,
            string contextName,
            EventType eventType,
            StatementResultService statementResultService,
            ValueAddEventProcessor revisionProcessor,
            string eplExpression,
            string statementName,
            bool isPrioritized,
            bool isEnableSubqueryIndexShare,
            bool isBatchingDataWindow,
            bool isVirtualDataWindow,
            ICollection <string> optionalUniqueKeyProps,
            string eventTypeAsName,
            StatementContext statementContextCreateWindow,
            NamedWindowDispatchService namedWindowDispatchService,
            ILockManager lockManager)
        {
            if (_processors.ContainsKey(name))
            {
                throw new ViewProcessingException("A named window by name '" + name + "' has already been created");
            }

            var processor = namedWindowDispatchService.CreateProcessor(
                name, this,
                namedWindowDispatchService,
                contextName,
                eventType,
                statementResultService,
                revisionProcessor,
                eplExpression,
                statementName,
                isPrioritized,
                isEnableSubqueryIndexShare,
                _enableQueryPlanLog,
                _metricReportingService,
                isBatchingDataWindow,
                isVirtualDataWindow,
                optionalUniqueKeyProps,
                eventTypeAsName,
                statementContextCreateWindow,
                lockManager);

            _processors.Put(name, processor);

            if (!_observers.IsEmpty())
            {
                var theEvent = new NamedWindowLifecycleEvent(name, processor, NamedWindowLifecycleEvent.LifecycleEventType.CREATE);
                foreach (var observer in _observers)
                {
                    observer.Observe(theEvent);
                }
            }

            return(processor);
        }
        public bool IsVariantStreamExists(String name)
        {
            ValueAddEventProcessor processor = _valueAddEventService.GetValueAddProcessor(name);

            if (processor == null)
            {
                return(false);
            }
            return(processor.ValueAddEventType is VariantEventType);
        }
Example #8
0
        public ValueAddEventProcessor GetValueAddProcessor(String name)
        {
            ValueAddEventProcessor proc = ProcessorsByNamedWindow.Get(name);

            if (proc != null)
            {
                return(proc);
            }
            return(VariantProcessors.Get(name));
        }
Example #9
0
        private volatile IDictionary <EPStatementAgentInstanceHandle, IList <NamedWindowConsumerView> > _consumersNonContext;  // handles as copy-on-write

        public NamedWindowTailView(EventType eventType, NamedWindowService namedWindowService, StatementResultService statementResultService, ValueAddEventProcessor revisionProcessor, bool prioritized, bool parentBatchWindow)
        {
            _eventType              = eventType;
            _namedWindowService     = namedWindowService;
            _statementResultService = statementResultService;
            _revisionProcessor      = revisionProcessor;
            _isPrioritized          = prioritized;
            _isParentBatchWindow    = parentBatchWindow;
            _consumersNonContext    = NamedWindowUtil.CreateConsumerMap(_isPrioritized);
        }
 public EvalInsertNoWildcardSingleColCoercionRevisionFunc(
     SelectExprContext selectExprContext,
     EventType resultEventType,
     ValueAddEventProcessor vaeProcessor,
     EventType vaeInnerEventType,
     Func <EventAdapterService, object, EventType, EventBean> func)
     : base(selectExprContext, resultEventType)
 {
     _vaeProcessor      = vaeProcessor;
     _vaeInnerEventType = vaeInnerEventType;
     _func = func;
 }
 public NamedWindowTailView CreateTailView(
     EventType eventType,
     NamedWindowMgmtService namedWindowMgmtService,
     NamedWindowDispatchService namedWindowDispatchService,
     StatementResultService statementResultService,
     ValueAddEventProcessor revisionProcessor,
     bool prioritized,
     bool parentBatchWindow,
     string contextName,
     TimeSourceService timeSourceService,
     ConfigurationEngineDefaults.Threading threadingConfig)
 {
     return(new NamedWindowTailView(eventType, namedWindowMgmtService, namedWindowDispatchService, statementResultService, revisionProcessor, _isPrioritized, parentBatchWindow, timeSourceService, threadingConfig));
 }
Example #12
0
 public NamedWindowRootView(ValueAddEventProcessor revisionProcessor,
                            bool queryPlanLogging,
                            MetricReportingService metricReportingService,
                            EventType eventType,
                            bool childBatching,
                            bool isEnableIndexShare,
                            ICollection <string> optionalUniqueKeyProps)
 {
     RevisionProcessor      = revisionProcessor;
     IsQueryPlanLogging     = queryPlanLogging;
     EventType              = eventType;
     IsChildBatching        = childBatching;
     IsEnableIndexShare     = isEnableIndexShare;
     OptionalUniqueKeyProps = optionalUniqueKeyProps;
 }
Example #13
0
        private volatile IDictionary <EPStatementAgentInstanceHandle, IList <NamedWindowConsumerView> > _consumersNonContext;  // handles as copy-on-write

        public NamedWindowTailView(
            EventType eventType,
            NamedWindowMgmtService namedWindowMgmtService,
            NamedWindowDispatchService namedWindowDispatchService,
            StatementResultService statementResultService,
            ValueAddEventProcessor revisionProcessor,
            bool prioritized,
            bool parentBatchWindow,
            TimeSourceService timeSourceService,
            ConfigurationEngineDefaults.ThreadingConfig threadingConfig)
        {
            EventType = eventType;
            NamedWindowMgmtService     = namedWindowMgmtService;
            NamedWindowDispatchService = namedWindowDispatchService;
            StatementResultService     = statementResultService;
            RevisionProcessor          = revisionProcessor;
            IsPrioritized        = prioritized;
            IsParentBatchWindow  = parentBatchWindow;
            _consumersNonContext = NamedWindowUtil.CreateConsumerMap(IsPrioritized);
            ThreadingConfig      = threadingConfig;
            TimeSourceService    = timeSourceService;
        }
Example #14
0
        /// <summary>
        /// Ctor.
        /// </summary>
        /// <param name="namedWindowName">Name of the named window.</param>
        /// <param name="namedWindowMgmtService">service for dispatching results</param>
        /// <param name="namedWindowDispatchService">The named window dispatch service.</param>
        /// <param name="contextName">Name of the context.</param>
        /// <param name="eventType">the type of event held by the named window</param>
        /// <param name="statementResultService">for coordinating on whether insert and remove stream events should be posted</param>
        /// <param name="revisionProcessor">for revision processing</param>
        /// <param name="eplExpression">epl expression</param>
        /// <param name="statementName">statement name</param>
        /// <param name="isPrioritized">if the engine is running with prioritized execution</param>
        /// <param name="isEnableSubqueryIndexShare">if set to <c>true</c> [is enable subquery index share].</param>
        /// <param name="enableQueryPlanLog">if set to <c>true</c> [enable query plan log].</param>
        /// <param name="metricReportingService">The metric reporting service.</param>
        /// <param name="isBatchingDataWindow">if set to <c>true</c> [is batching data window].</param>
        /// <param name="isVirtualDataWindow">if set to <c>true</c> [is virtual data window].</param>
        /// <param name="optionalUniqueKeyProps">The optional unique key props.</param>
        /// <param name="eventTypeAsName">Name of the event type as.</param>
        /// <param name="statementContextCreateWindow">The statement context create window.</param>
        /// <param name="lockManager">The lock manager.</param>
        public NamedWindowProcessor(
            string namedWindowName,
            NamedWindowMgmtService namedWindowMgmtService,
            NamedWindowDispatchService namedWindowDispatchService,
            string contextName,
            EventType eventType,
            StatementResultService statementResultService,
            ValueAddEventProcessor revisionProcessor,
            string eplExpression,
            string statementName,
            bool isPrioritized,
            bool isEnableSubqueryIndexShare,
            bool enableQueryPlanLog,
            MetricReportingService metricReportingService,
            bool isBatchingDataWindow,
            bool isVirtualDataWindow,
            ICollection <string> optionalUniqueKeyProps,
            string eventTypeAsName,
            StatementContext statementContextCreateWindow, ILockManager lockManager)
        {
            _namedWindowName              = namedWindowName;
            _contextName                  = contextName;
            _eventType                    = eventType;
            _eplExpression                = eplExpression;
            _statementName                = statementName;
            _isEnableSubqueryIndexShare   = isEnableSubqueryIndexShare;
            _isVirtualDataWindow          = isVirtualDataWindow;
            _optionalUniqueKeyProps       = optionalUniqueKeyProps;
            _eventTypeAsName              = eventTypeAsName;
            _statementContextCreateWindow = statementContextCreateWindow;

            _rootView = new NamedWindowRootView(revisionProcessor, enableQueryPlanLog, metricReportingService, eventType, isBatchingDataWindow, isEnableSubqueryIndexShare, optionalUniqueKeyProps);
            _tailView = namedWindowDispatchService.CreateTailView(
                eventType, namedWindowMgmtService, namedWindowDispatchService, statementResultService, revisionProcessor,
                isPrioritized, isBatchingDataWindow, contextName, statementContextCreateWindow.TimeSourceService,
                statementContextCreateWindow.ConfigSnapshot.EngineDefaults.Threading);
            _lock = lockManager.CreateLock(MethodBase.GetCurrentMethod().DeclaringType);
        }
Example #15
0
        /// <summary>
        /// Ctor.
        /// </summary>
        /// <param name="namedWindowName">Name of the named window.</param>
        /// <param name="namedWindowService">service for dispatching results</param>
        /// <param name="contextName">Name of the context.</param>
        /// <param name="singleInstanceContext">if set to <c>true</c> [single instance context].</param>
        /// <param name="eventType">the type of event held by the named window</param>
        /// <param name="statementResultService">for coordinating on whether insert and remove stream events should be posted</param>
        /// <param name="revisionProcessor">for revision processing</param>
        /// <param name="eplExpression">epl expression</param>
        /// <param name="statementName">statement name</param>
        /// <param name="isPrioritized">if the engine is running with prioritized execution</param>
        /// <param name="isEnableSubqueryIndexShare">if set to <c>true</c> [is enable subquery index share].</param>
        /// <param name="enableQueryPlanLog">if set to <c>true</c> [enable query plan log].</param>
        /// <param name="metricReportingService">The metric reporting service.</param>
        /// <param name="isBatchingDataWindow">if set to <c>true</c> [is batching data window].</param>
        /// <param name="isVirtualDataWindow">if set to <c>true</c> [is virtual data window].</param>
        /// <param name="statementMetricHandle">The statement metric handle.</param>
        /// <param name="optionalUniqueKeyProps">The optional unique key props.</param>
        /// <param name="eventTypeAsName">Name of the event type as.</param>
        public NamedWindowProcessor(
            string namedWindowName,
            NamedWindowService namedWindowService,
            string contextName,
            EventType eventType,
            StatementResultService statementResultService,
            ValueAddEventProcessor revisionProcessor,
            string eplExpression,
            string statementName,
            bool isPrioritized,
            bool isEnableSubqueryIndexShare,
            bool enableQueryPlanLog,
            MetricReportingService metricReportingService,
            bool isBatchingDataWindow,
            bool isVirtualDataWindow,
            StatementMetricHandle statementMetricHandle,
            ICollection <string> optionalUniqueKeyProps,
            string eventTypeAsName,
            StatementResourceService statementResourceService)
        {
            _namedWindowName            = namedWindowName;
            _contextName                = contextName;
            _eventType                  = eventType;
            _eplExpression              = eplExpression;
            _statementName              = statementName;
            _isEnableSubqueryIndexShare = isEnableSubqueryIndexShare;
            _isVirtualDataWindow        = isVirtualDataWindow;
            _statementMetricHandle      = statementMetricHandle;
            _optionalUniqueKeyProps     = optionalUniqueKeyProps;
            _eventTypeAsName            = eventTypeAsName;
            _statementResourceService   = statementResourceService;
            _lock = LockManager.CreateLock(GetType());

            _rootView = new NamedWindowRootView(revisionProcessor, enableQueryPlanLog, metricReportingService, eventType, isBatchingDataWindow, isEnableSubqueryIndexShare, optionalUniqueKeyProps);
            _tailView = new NamedWindowTailView(eventType, namedWindowService, statementResultService, revisionProcessor, isPrioritized, isBatchingDataWindow);
        }
Example #16
0
 public EvalInsertWildcardRevisionWrapper(SelectExprContext selectExprContext, EventType resultEventType, ValueAddEventProcessor vaeProcessor, EventType wrappingEventType)
     : base(selectExprContext, resultEventType)
 {
     _vaeProcessor      = vaeProcessor;
     _wrappingEventType = wrappingEventType;
 }