/// <summary>
 /// Ctor.
 /// </summary>
 /// <param name="perLevelExpression">The per level expression.</param>
 /// <param name="groupKeyNodeExpressions">The group key node expressions.</param>
 /// <param name="groupKeyNodes">list of group-by expression nodes needed for building the group-by keysAggregation functions in the having node must have been pointed to the AggregationService for evaluation.</param>
 /// <param name="isSelectRStream">true if remove stream events should be generated</param>
 /// <param name="isUnidirectional">true if unidirectional join</param>
 /// <param name="outputLimitSpec">The output limit spec.</param>
 /// <param name="isSorting">if set to <c>true</c> [is sorting].</param>
 /// <param name="noDataWindowSingleStream">if set to <c>true</c> [no data window single stream].</param>
 /// <param name="groupByRollupDesc">The group by rollup desc.</param>
 /// <param name="isJoin">if set to <c>true</c> [is join].</param>
 /// <param name="isHistoricalOnly">if set to <c>true</c> [is historical only].</param>
 /// <param name="iterateUnbounded">if set to <c>true</c> [iterate unbounded].</param>
 /// <param name="optionalOutputFirstConditionFactory">The optional output first condition factory.</param>
 /// <param name="resultSetProcessorHelperFactory">The result set processor helper factory.</param>
 /// <param name="enableOutputLimitOpt">if set to <c>true</c> [enable output limit opt].</param>
 /// <param name="numStreams">The number streams.</param>
 public ResultSetProcessorRowPerGroupRollupFactory(
     GroupByRollupPerLevelExpression perLevelExpression,
     ExprNode[] groupKeyNodeExpressions,
     ExprEvaluator[] groupKeyNodes,
     bool isSelectRStream,
     bool isUnidirectional,
     OutputLimitSpec outputLimitSpec,
     bool isSorting,
     bool noDataWindowSingleStream,
     AggregationGroupByRollupDesc groupByRollupDesc,
     bool isJoin,
     bool isHistoricalOnly,
     bool iterateUnbounded,
     OutputConditionPolledFactory optionalOutputFirstConditionFactory,
     ResultSetProcessorHelperFactory resultSetProcessorHelperFactory,
     bool enableOutputLimitOpt,
     int numStreams)
 {
     GroupKeyNodeExpressions = groupKeyNodeExpressions;
     PerLevelExpression      = perLevelExpression;
     GroupKeyNodes           = groupKeyNodes;
     GroupKeyNode            = groupKeyNodes.Length == 1 ? groupKeyNodes[0] : null;
     IsSorting                   = isSorting;
     IsSelectRStream             = isSelectRStream;
     IsUnidirectional            = isUnidirectional;
     OutputLimitSpec             = outputLimitSpec;
     _noDataWindowSingleSnapshot = iterateUnbounded || (outputLimitSpec != null && outputLimitSpec.DisplayLimit == OutputLimitLimitType.SNAPSHOT && noDataWindowSingleStream);
     GroupByRollupDesc           = groupByRollupDesc;
     IsJoin           = isJoin;
     IsHistoricalOnly = isHistoricalOnly;
     OptionalOutputFirstConditionFactory = optionalOutputFirstConditionFactory;
     ResultSetProcessorHelperFactory     = resultSetProcessorHelperFactory;
     IsEnableOutputLimitOpt = enableOutputLimitOpt;
     NumStreams             = numStreams;
 }
예제 #2
0
 /// <summary>
 /// Ctor.
 /// </summary>
 /// <param name="selectExprProcessor">for processing the select expression and generting the readonly output rows</param>
 /// <param name="groupKeyNodeExpressions">The group key node expressions.</param>
 /// <param name="groupKeyNodes">list of group-by expression nodes needed for building the group-by keys</param>
 /// <param name="optionalHavingNode">expression node representing validated HAVING clause, or null if none given.Aggregation functions in the having node must have been pointed to the AggregationService for evaluation.</param>
 /// <param name="isSelectRStream">true if remove stream events should be generated</param>
 /// <param name="isUnidirectional">true if unidirectional join</param>
 /// <param name="outputLimitSpec">The output limit spec.</param>
 /// <param name="isSorting">if set to <c>true</c> [is sorting].</param>
 /// <param name="isHistoricalOnly">if set to <c>true</c> [is historical only].</param>
 /// <param name="resultSetProcessorHelperFactory">The result set processor helper factory.</param>
 /// <param name="optionalOutputFirstConditionFactory">The optional output first condition factory.</param>
 /// <param name="enableOutputLimitOpt">if set to <c>true</c> [enable output limit opt].</param>
 /// <param name="numStreams">The number streams.</param>
 public ResultSetProcessorAggregateGroupedFactory(
     SelectExprProcessor selectExprProcessor,
     ExprNode[] groupKeyNodeExpressions,
     ExprEvaluator[] groupKeyNodes,
     ExprEvaluator optionalHavingNode,
     bool isSelectRStream,
     bool isUnidirectional,
     OutputLimitSpec outputLimitSpec,
     bool isSorting,
     bool isHistoricalOnly,
     ResultSetProcessorHelperFactory resultSetProcessorHelperFactory,
     OutputConditionPolledFactory optionalOutputFirstConditionFactory,
     bool enableOutputLimitOpt,
     int numStreams)
 {
     _selectExprProcessor    = selectExprProcessor;
     GroupKeyNodeExpressions = groupKeyNodeExpressions;
     GroupKeyNode            = groupKeyNodes.Length == 1 ? groupKeyNodes[0] : null;
     GroupKeyNodes           = groupKeyNodes;
     OptionalHavingNode      = optionalHavingNode;
     IsSorting        = isSorting;
     IsSelectRStream  = isSelectRStream;
     IsUnidirectional = isUnidirectional;
     IsHistoricalOnly = isHistoricalOnly;
     OutputLimitSpec  = outputLimitSpec;
     ResultSetProcessorHelperFactory     = resultSetProcessorHelperFactory;
     OptionalOutputFirstConditionFactory = optionalOutputFirstConditionFactory;
     IsEnableOutputLimitOpt = enableOutputLimitOpt;
     NumStreams             = numStreams;
 }
 public OutputProcessViewConditionFactory(
     StatementContext statementContext,
     OutputStrategyPostProcessFactory postProcessFactory,
     bool distinct,
     ExprTimePeriod afterTimePeriod,
     int? afterConditionNumberOfEvents,
     EventType resultEventType,
     OutputConditionFactory outputConditionFactory,
     int streamCount,
     ConditionType conditionType,
     OutputLimitLimitType outputLimitLimitType,
     bool terminable,
     bool hasAfter,
     bool isUnaggregatedUngrouped,
     SelectClauseStreamSelectorEnum selectClauseStreamSelectorEnum,
     ResultSetProcessorHelperFactory resultSetProcessorHelperFactory)
     : base(
         statementContext, postProcessFactory, resultSetProcessorHelperFactory, distinct, afterTimePeriod,
         afterConditionNumberOfEvents, resultEventType)
 {
     _outputConditionFactory = outputConditionFactory;
     _streamCount = streamCount;
     _conditionType = conditionType;
     _outputLimitLimitType = outputLimitLimitType;
     _terminable = terminable;
     _hasAfter = hasAfter;
     _isUnaggregatedUngrouped = isUnaggregatedUngrouped;
     _selectClauseStreamSelectorEnum = selectClauseStreamSelectorEnum;
     _resultSetProcessorHelperFactory = resultSetProcessorHelperFactory;
 }
예제 #4
0
 /// <summary>
 /// Ctor.
 /// </summary>
 /// <param name="selectExprProcessor">for processing the select expression and generting the final output rows</param>
 /// <param name="groupKeyNodeExpressions">The group key node expressions.</param>
 /// <param name="groupKeyNodes">list of group-by expression nodes needed for building the group-by keys</param>
 /// <param name="optionalHavingNode">expression node representing validated HAVING clause, or null if none given.Aggregation functions in the having node must have been pointed to the AggregationService for evaluation.</param>
 /// <param name="isSelectRStream">true if remove stream events should be generated</param>
 /// <param name="isUnidirectional">true if unidirectional join</param>
 /// <param name="outputLimitSpec">The output limit spec.</param>
 /// <param name="isSorting">if set to <c>true</c> [is sorting].</param>
 /// <param name="noDataWindowSingleStream">if set to <c>true</c> [no data window single stream].</param>
 /// <param name="isHistoricalOnly">if set to <c>true</c> [is historical only].</param>
 /// <param name="iterateUnbounded">if set to <c>true</c> [iterate unbounded].</param>
 /// <param name="resultSetProcessorHelperFactory">The result set processor helper factory.</param>
 /// <param name="enableOutputLimitOpt">if set to <c>true</c> [enable output limit opt].</param>
 /// <param name="numStreams">The number streams.</param>
 /// <param name="optionalOutputFirstConditionFactory">The optional output first condition factory.</param>
 public ResultSetProcessorRowPerGroupFactory(
     SelectExprProcessor selectExprProcessor,
     ExprNode[] groupKeyNodeExpressions,
     ExprEvaluator[] groupKeyNodes,
     ExprEvaluator optionalHavingNode,
     bool isSelectRStream,
     bool isUnidirectional,
     OutputLimitSpec outputLimitSpec,
     bool isSorting,
     bool noDataWindowSingleStream,
     bool isHistoricalOnly,
     bool iterateUnbounded,
     ResultSetProcessorHelperFactory resultSetProcessorHelperFactory,
     bool enableOutputLimitOpt,
     int numStreams,
     OutputConditionPolledFactory optionalOutputFirstConditionFactory)
 {
     _groupKeyNodeExpressions = groupKeyNodeExpressions;
     _selectExprProcessor     = selectExprProcessor;
     _groupKeyNodes           = groupKeyNodes;
     _groupKeyNode            = groupKeyNodes.Length == 1 ? groupKeyNodes[0] : null;
     _optionalHavingNode      = optionalHavingNode;
     _isSorting                          = isSorting;
     _isSelectRStream                    = isSelectRStream;
     _isUnidirectional                   = isUnidirectional;
     _outputLimitSpec                    = outputLimitSpec;
     _noDataWindowSingleSnapshot         = iterateUnbounded || (outputLimitSpec != null && outputLimitSpec.DisplayLimit == OutputLimitLimitType.SNAPSHOT && noDataWindowSingleStream);
     _isHistoricalOnly                   = isHistoricalOnly;
     ResultSetProcessorHelperFactory     = resultSetProcessorHelperFactory;
     IsEnableOutputLimitOpt              = enableOutputLimitOpt;
     NumStreams                          = numStreams;
     OptionalOutputFirstConditionFactory = optionalOutputFirstConditionFactory;
 }
예제 #5
0
        public OutputProcessViewDirectDistinctOrAfterFactory(
            StatementContext statementContext,
            OutputStrategyPostProcessFactory postProcessFactory,
            ResultSetProcessorHelperFactory resultSetProcessorHelperFactory,
            bool distinct,
            ExprTimePeriod afterTimePeriod,
            int?afterConditionNumberOfEvents,
            EventType resultEventType)
            : base(statementContext, postProcessFactory, resultSetProcessorHelperFactory)
        {
            _isDistinct     = distinct;
            AfterTimePeriod = afterTimePeriod;
            AfterConditionNumberOfEvents = afterConditionNumberOfEvents;

            if (_isDistinct)
            {
                if (resultEventType is EventTypeSPI)
                {
                    EventTypeSPI eventTypeSPI = (EventTypeSPI)resultEventType;
                    _eventBeanReader = eventTypeSPI.Reader;
                }
                if (_eventBeanReader == null)
                {
                    _eventBeanReader = new EventBeanReaderDefaultImpl(resultEventType);
                }
            }
        }
예제 #6
0
        public OutputProcessViewConditionFirst(ResultSetProcessorHelperFactory resultSetProcessorHelperFactory, ResultSetProcessor resultSetProcessor, long?afterConditionTime, int?afterConditionNumberOfEvents, bool afterConditionSatisfied, OutputProcessViewConditionFactory parent, AgentInstanceContext agentInstanceContext)
            : base(resultSetProcessorHelperFactory, agentInstanceContext, resultSetProcessor, afterConditionTime, afterConditionNumberOfEvents, afterConditionSatisfied)
        {
            _parent = parent;

            OutputCallback outputCallback = GetCallbackToLocal(parent.StreamCount);

            _outputCondition = parent.OutputConditionFactory.Make(agentInstanceContext, outputCallback);
        }
 public OutputProcessViewDirectFactory(
     StatementContext statementContext,
     OutputStrategyPostProcessFactory postProcessFactory,
     ResultSetProcessorHelperFactory resultSetProcessorHelperFactory)
 {
     _statementContext               = statementContext;
     _statementResultService         = statementContext.StatementResultService;
     PostProcessFactory              = postProcessFactory;
     ResultSetProcessorHelperFactory = resultSetProcessorHelperFactory;
 }
예제 #8
0
 public OutputProcessViewDirectDistinctOrAfter(
     ResultSetProcessorHelperFactory resultSetProcessorHelperFactory,
     AgentInstanceContext agentInstanceContext,
     ResultSetProcessor resultSetProcessor,
     long?afterConditionTime,
     int?afterConditionNumberOfEvents,
     bool afterConditionSatisfied,
     OutputProcessViewDirectDistinctOrAfterFactory parent)
     : base(resultSetProcessorHelperFactory, agentInstanceContext, resultSetProcessor, afterConditionTime, afterConditionNumberOfEvents, afterConditionSatisfied)
 {
     _parent = parent;
 }
 public OutputProcessViewConditionSnapshotPostProcess(
     ResultSetProcessorHelperFactory resultSetProcessorHelperFactory,
     ResultSetProcessor resultSetProcessor,
     long?afterConditionTime,
     int?afterConditionNumberOfEvents,
     bool afterConditionSatisfied,
     OutputProcessViewConditionFactory parent,
     AgentInstanceContext agentInstanceContext,
     OutputStrategyPostProcess postProcessor)
     : base(resultSetProcessorHelperFactory, resultSetProcessor, afterConditionTime, afterConditionNumberOfEvents, afterConditionSatisfied, parent, agentInstanceContext)
 {
     _postProcessor = postProcessor;
 }
예제 #10
0
 /// <summary>
 /// Ctor.
 /// </summary>
 /// <param name="selectExprProcessor">for processing the select expression and generting the readonly output rows</param>
 /// <param name="optionalHavingNode">having clause expression node</param>
 /// <param name="isSelectRStream">true if remove stream events should be generated</param>
 /// <param name="isUnidirectional">true if unidirectional join</param>
 /// <param name="isHistoricalOnly">if set to <c>true</c> [is historical only].</param>
 /// <param name="outputLimitSpec">The output limit spec.</param>
 /// <param name="resultSetProcessorHelperFactory">The result set processor helper factory.</param>
 public ResultSetProcessorRowForAllFactory(
     SelectExprProcessor selectExprProcessor,
     ExprEvaluator optionalHavingNode,
     bool isSelectRStream,
     bool isUnidirectional,
     bool isHistoricalOnly,
     OutputLimitSpec outputLimitSpec,
     ResultSetProcessorHelperFactory resultSetProcessorHelperFactory)
 {
     _selectExprProcessor            = selectExprProcessor;
     OutputLimitSpec                 = outputLimitSpec;
     OptionalHavingNode              = optionalHavingNode;
     IsSelectRStream                 = isSelectRStream;
     IsUnidirectional                = isUnidirectional;
     IsHistoricalOnly                = isHistoricalOnly;
     ResultSetProcessorHelperFactory = resultSetProcessorHelperFactory;
 }
예제 #11
0
 /// <summary>
 /// Ctor.
 /// </summary>
 /// <param name="selectExprProcessor">for processing the select expression and generting the readonly output rows</param>
 /// <param name="optionalHavingNode">having clause expression node</param>
 /// <param name="isSelectRStream">true if remove stream events should be generated</param>
 /// <param name="outputLimitSpec">The output limit spec.</param>
 /// <param name="enableOutputLimitOpt">if set to <c>true</c> [enable output limit opt].</param>
 /// <param name="resultSetProcessorHelperFactory">The result set processor helper factory.</param>
 /// <param name="numStreams">The number streams.</param>
 public ResultSetProcessorSimpleFactory(
     SelectExprProcessor selectExprProcessor,
     ExprEvaluator optionalHavingNode,
     bool isSelectRStream,
     OutputLimitSpec outputLimitSpec,
     bool enableOutputLimitOpt,
     ResultSetProcessorHelperFactory resultSetProcessorHelperFactory,
     int numStreams)
 {
     _selectExprProcessor            = selectExprProcessor;
     _optionalHavingExpr             = optionalHavingNode;
     _isSelectRStream                = isSelectRStream;
     _outputLimitSpec                = outputLimitSpec;
     IsEnableOutputLimitOpt          = enableOutputLimitOpt;
     ResultSetProcessorHelperFactory = resultSetProcessorHelperFactory;
     NumStreams = numStreams;
 }
예제 #12
0
        /// <summary>
        ///     NOTE: Code-generation-invoked method, method name and parameter order matters
        /// </summary>
        /// <param name="resultSetProcessorHelperFactory">helper factory</param>
        /// <param name="agentInstanceContext">context</param>
        /// <param name="groupKeyTypes">types</param>
        /// <param name="groupByRollupDesc">rollup into</param>
        /// <param name="outputConditionPolledFactory">condition factory</param>
        /// <returns>helpers</returns>
        public static ResultSetProcessorGroupedOutputFirstHelper[] InitializeOutputFirstHelpers(
            ResultSetProcessorHelperFactory resultSetProcessorHelperFactory,
            AgentInstanceContext agentInstanceContext,
            Type[] groupKeyTypes,
            AggregationGroupByRollupDesc groupByRollupDesc,
            OutputConditionPolledFactory outputConditionPolledFactory)
        {
            var outputFirstHelpers = new ResultSetProcessorGroupedOutputFirstHelper[groupByRollupDesc.Levels.Length];
            for (var i = 0; i < groupByRollupDesc.Levels.Length; i++) {
                outputFirstHelpers[i] = resultSetProcessorHelperFactory.MakeRSGroupedOutputFirst(
                    agentInstanceContext,
                    groupKeyTypes,
                    outputConditionPolledFactory,
                    groupByRollupDesc,
                    i,
                    null);
            }

            return outputFirstHelpers;
        }
예제 #13
0
        public static OutputConditionFactory CreateCondition(
            OutputLimitSpec outputLimitSpec,
            StatementContext statementContext,
            bool isGrouped,
            bool isWithHavingClause,
            bool isStartConditionOnCreation,
            ResultSetProcessorHelperFactory resultSetProcessorHelperFactory)
        {
            if (outputLimitSpec == null)
            {
                return new OutputConditionNullFactory();
            }

            // Check if a variable is present
            VariableMetaData variableMetaData = null;
            if (outputLimitSpec.VariableName != null)
            {
                variableMetaData = statementContext.VariableService.GetVariableMetaData(outputLimitSpec.VariableName);
                if (variableMetaData == null)
                {
                    throw new ExprValidationException(
                        "Variable named '" + outputLimitSpec.VariableName + "' has not been declared");
                }
                string message = VariableServiceUtil.CheckVariableContextName(
                    statementContext.ContextDescriptor, variableMetaData);
                if (message != null)
                {
                    throw new ExprValidationException(message);
                }
            }

            if (outputLimitSpec.DisplayLimit == OutputLimitLimitType.FIRST && isGrouped)
            {
                return new OutputConditionNullFactory();
            }

            if (outputLimitSpec.RateType == OutputLimitRateType.CRONTAB)
            {
                return resultSetProcessorHelperFactory.MakeOutputConditionCrontab(
                    outputLimitSpec.CrontabAtSchedule, statementContext, isStartConditionOnCreation);
            }
            else if (outputLimitSpec.RateType == OutputLimitRateType.WHEN_EXPRESSION)
            {
                return resultSetProcessorHelperFactory.MakeOutputConditionExpression(
                    outputLimitSpec.WhenExpressionNode, outputLimitSpec.ThenExpressions, statementContext,
                    outputLimitSpec.AndAfterTerminateExpr, outputLimitSpec.AndAfterTerminateThenExpressions,
                    isStartConditionOnCreation);
            }
            else if (outputLimitSpec.RateType == OutputLimitRateType.EVENTS)
            {
                if (Log.IsDebugEnabled)
                {
                    Log.Debug(".createCondition creating OutputConditionCount with event rate " + outputLimitSpec);
                }

                if ((variableMetaData != null) && (!variableMetaData.VariableType.IsNumericNonFP()))
                {
                    throw new ArgumentException(
                        "Variable named '" + outputLimitSpec.VariableName + "' must be type integer, long or short");
                }

                int rate = -1;
                if (outputLimitSpec.Rate != null)
                {
                    rate = outputLimitSpec.Rate.AsInt();
                }
                return resultSetProcessorHelperFactory.MakeOutputConditionCount(
                    rate, variableMetaData, statementContext);
            }
            else if (outputLimitSpec.RateType == OutputLimitRateType.TERM)
            {
                if (outputLimitSpec.AndAfterTerminateExpr == null &&
                    (outputLimitSpec.AndAfterTerminateThenExpressions == null ||
                     outputLimitSpec.AndAfterTerminateThenExpressions.IsEmpty()))
                {
                    return new OutputConditionTermFactory();
                }
                else
                {
                    return resultSetProcessorHelperFactory.MakeOutputConditionExpression(
                        new ExprConstantNodeImpl(false), Collections.GetEmptyList<OnTriggerSetAssignment>(),
                        statementContext, outputLimitSpec.AndAfterTerminateExpr,
                        outputLimitSpec.AndAfterTerminateThenExpressions, isStartConditionOnCreation);
                }
            }
            else
            {
                if (Log.IsDebugEnabled)
                {
                    Log.Debug(
                        ".createCondition creating OutputConditionTime with interval length " + outputLimitSpec.Rate);
                }
                if ((variableMetaData != null) && (!variableMetaData.VariableType.IsNumeric()))
                {
                    throw new ArgumentException(
                        "Variable named '" + outputLimitSpec.VariableName + "' must be of numeric type");
                }

                return resultSetProcessorHelperFactory.MakeOutputConditionTime(
                    outputLimitSpec.TimePeriodExpr, isStartConditionOnCreation);
            }
        }
예제 #14
0
        // Supplied after construction to avoid circular dependency

        /// <summary>
        /// Constructor - sets up new set of services.
        /// </summary>
        /// <param name="engineURI">is the engine URI</param>
        /// <param name="schedulingService">service to get time and schedule callbacks</param>
        /// <param name="eventAdapterService">service to resolve event types</param>
        /// <param name="engineImportService">is engine imported static func packages and aggregation functions</param>
        /// <param name="engineSettingsService">provides engine settings</param>
        /// <param name="databaseConfigService">service to resolve a database name to database connection factory and configs</param>
        /// <param name="plugInViews">resolves view namespace and name to view factory class</param>
        /// <param name="statementLockFactory">creates statement-level locks</param>
        /// <param name="eventProcessingRWLock">is the engine lock for statement management</param>
        /// <param name="extensionServicesContext">marker interface allows adding additional services</param>
        /// <param name="engineEnvContext">is engine environment/directory information for use with adapters and external env</param>
        /// <param name="statementContextFactory">is the factory to use to create statement context objects</param>
        /// <param name="plugInPatternObjects">resolves plug-in pattern objects</param>
        /// <param name="timerService">is the timer service</param>
        /// <param name="filterService">the filter service</param>
        /// <param name="streamFactoryService">is hooking up filters to streams</param>
        /// <param name="namedWindowMgmtService">The named window MGMT service.</param>
        /// <param name="namedWindowDispatchService">The named window dispatch service.</param>
        /// <param name="variableService">provides access to variable values</param>
        /// <param name="tableService">The table service.</param>
        /// <param name="timeSourceService">time source provider class</param>
        /// <param name="valueAddEventService">handles Update events</param>
        /// <param name="metricsReportingService">for metric reporting</param>
        /// <param name="statementEventTypeRef">statement to event type reference holding</param>
        /// <param name="statementVariableRef">statement to variabke reference holding</param>
        /// <param name="configSnapshot">configuration snapshot</param>
        /// <param name="threadingServiceImpl">engine-level threading services</param>
        /// <param name="internalEventRouter">routing of events</param>
        /// <param name="statementIsolationService">maintains isolation information per statement</param>
        /// <param name="schedulingMgmtService">schedule management for statements</param>
        /// <param name="deploymentStateService">The deployment state service.</param>
        /// <param name="exceptionHandlingService">The exception handling service.</param>
        /// <param name="patternNodeFactory">The pattern node factory.</param>
        /// <param name="eventTypeIdGenerator">The event type id generator.</param>
        /// <param name="statementMetadataFactory">The statement metadata factory.</param>
        /// <param name="contextManagementService">The context management service.</param>
        /// <param name="patternSubexpressionPoolSvc">The pattern subexpression pool SVC.</param>
        /// <param name="matchRecognizeStatePoolEngineSvc">The match recognize state pool engine SVC.</param>
        /// <param name="dataFlowService">The data flow service.</param>
        /// <param name="exprDeclaredService">The expr declared service.</param>
        /// <param name="contextControllerFactoryFactorySvc">The context controller factory factory SVC.</param>
        /// <param name="contextManagerFactoryService">The context manager factory service.</param>
        /// <param name="epStatementFactory">The ep statement factory.</param>
        /// <param name="regexHandlerFactory">The regex handler factory.</param>
        /// <param name="viewableActivatorFactory">The viewable activator factory.</param>
        /// <param name="filterNonPropertyRegisteryService">The filter non property registery service.</param>
        /// <param name="resultSetProcessorHelperFactory">The result set processor helper factory.</param>
        /// <param name="viewServicePreviousFactory">The view service previous factory.</param>
        /// <param name="eventTableIndexService">The event table index service.</param>
        /// <param name="epRuntimeIsolatedFactory">The ep runtime isolated factory.</param>
        /// <param name="filterBooleanExpressionFactory">The filter boolean expression factory.</param>
        /// <param name="dataCacheFactory">The data cache factory.</param>
        /// <param name="multiMatchHandlerFactory">The multi match handler factory.</param>
        /// <param name="namedWindowConsumerMgmtService">The named window consumer MGMT service.</param>
        /// <param name="aggregationFactoryFactory"></param>
        /// <param name="scriptingService">The scripting service.</param>
        public EPServicesContext(
            string engineURI,
            SchedulingServiceSPI schedulingService,
            EventAdapterService eventAdapterService,
            EngineImportService engineImportService,
            EngineSettingsService engineSettingsService,
            DatabaseConfigService databaseConfigService,
            PluggableObjectCollection plugInViews,
            StatementLockFactory statementLockFactory,
            IReaderWriterLock eventProcessingRWLock,
            EngineLevelExtensionServicesContext extensionServicesContext,
            Directory engineEnvContext,
            StatementContextFactory statementContextFactory,
            PluggableObjectCollection plugInPatternObjects,
            TimerService timerService,
            FilterServiceSPI filterService,
            StreamFactoryService streamFactoryService,
            NamedWindowMgmtService namedWindowMgmtService,
            NamedWindowDispatchService namedWindowDispatchService,
            VariableService variableService,
            TableService tableService,
            TimeSourceService timeSourceService,
            ValueAddEventService valueAddEventService,
            MetricReportingServiceSPI metricsReportingService,
            StatementEventTypeRef statementEventTypeRef,
            StatementVariableRef statementVariableRef,
            ConfigurationInformation configSnapshot,
            ThreadingService threadingServiceImpl,
            InternalEventRouterImpl internalEventRouter,
            StatementIsolationService statementIsolationService,
            SchedulingMgmtService schedulingMgmtService,
            DeploymentStateService deploymentStateService,
            ExceptionHandlingService exceptionHandlingService,
            PatternNodeFactory patternNodeFactory,
            EventTypeIdGenerator eventTypeIdGenerator,
            StatementMetadataFactory statementMetadataFactory,
            ContextManagementService contextManagementService,
            PatternSubexpressionPoolEngineSvc patternSubexpressionPoolSvc,
            MatchRecognizeStatePoolEngineSvc matchRecognizeStatePoolEngineSvc,
            DataFlowService dataFlowService,
            ExprDeclaredService exprDeclaredService,
            ContextControllerFactoryFactorySvc contextControllerFactoryFactorySvc,
            ContextManagerFactoryService contextManagerFactoryService,
            EPStatementFactory epStatementFactory,
            RegexHandlerFactory regexHandlerFactory,
            ViewableActivatorFactory viewableActivatorFactory,
            FilterNonPropertyRegisteryService filterNonPropertyRegisteryService,
            ResultSetProcessorHelperFactory resultSetProcessorHelperFactory,
            ViewServicePreviousFactory viewServicePreviousFactory,
            EventTableIndexService eventTableIndexService,
            EPRuntimeIsolatedFactory epRuntimeIsolatedFactory,
            FilterBooleanExpressionFactory filterBooleanExpressionFactory,
            DataCacheFactory dataCacheFactory,
            MultiMatchHandlerFactory multiMatchHandlerFactory,
            NamedWindowConsumerMgmtService namedWindowConsumerMgmtService,
            AggregationFactoryFactory aggregationFactoryFactory,
            ScriptingService scriptingService)
        {
            EngineURI             = engineURI;
            SchedulingService     = schedulingService;
            EventAdapterService   = eventAdapterService;
            EngineImportService   = engineImportService;
            EngineSettingsService = engineSettingsService;
            DatabaseRefService    = databaseConfigService;
            FilterService         = filterService;
            TimerService          = timerService;
            DispatchService       = DispatchServiceProvider.NewService();
            ViewService           = ViewServiceProvider.NewService();
            StreamService         = streamFactoryService;
            PlugInViews           = plugInViews;
            StatementLockFactory  = statementLockFactory;
            EventProcessingRWLock = eventProcessingRWLock;
            EngineLevelExtensionServicesContext = extensionServicesContext;
            EngineEnvContext           = engineEnvContext;
            StatementContextFactory    = statementContextFactory;
            PlugInPatternObjects       = plugInPatternObjects;
            NamedWindowMgmtService     = namedWindowMgmtService;
            NamedWindowDispatchService = namedWindowDispatchService;
            VariableService            = variableService;
            TableService                     = tableService;
            TimeSource                       = timeSourceService;
            ValueAddEventService             = valueAddEventService;
            MetricsReportingService          = metricsReportingService;
            StatementEventTypeRefService     = statementEventTypeRef;
            ConfigSnapshot                   = configSnapshot;
            ThreadingService                 = threadingServiceImpl;
            InternalEventRouter              = internalEventRouter;
            StatementIsolationService        = statementIsolationService;
            SchedulingMgmtService            = schedulingMgmtService;
            StatementVariableRefService      = statementVariableRef;
            DeploymentStateService           = deploymentStateService;
            ExceptionHandlingService         = exceptionHandlingService;
            PatternNodeFactory               = patternNodeFactory;
            EventTypeIdGenerator             = eventTypeIdGenerator;
            StatementMetadataFactory         = statementMetadataFactory;
            ContextManagementService         = contextManagementService;
            PatternSubexpressionPoolSvc      = patternSubexpressionPoolSvc;
            MatchRecognizeStatePoolEngineSvc = matchRecognizeStatePoolEngineSvc;
            DataFlowService                  = dataFlowService;
            ExprDeclaredService              = exprDeclaredService;
            ExpressionResultCacheSharable    = new ExpressionResultCacheService(
                configSnapshot.EngineDefaults.ExecutionConfig.DeclaredExprValueCacheSize);
            ContextControllerFactoryFactorySvc = contextControllerFactoryFactorySvc;
            ContextManagerFactoryService       = contextManagerFactoryService;
            EpStatementFactory                = epStatementFactory;
            RegexHandlerFactory               = regexHandlerFactory;
            ViewableActivatorFactory          = viewableActivatorFactory;
            FilterNonPropertyRegisteryService = filterNonPropertyRegisteryService;
            ResultSetProcessorHelperFactory   = resultSetProcessorHelperFactory;
            ViewServicePreviousFactory        = viewServicePreviousFactory;
            EventTableIndexService            = eventTableIndexService;
            EpRuntimeIsolatedFactory          = epRuntimeIsolatedFactory;
            FilterBooleanExpressionFactory    = filterBooleanExpressionFactory;
            DataCacheFactory               = dataCacheFactory;
            MultiMatchHandlerFactory       = multiMatchHandlerFactory;
            NamedWindowConsumerMgmtService = namedWindowConsumerMgmtService;
            AggregationFactoryFactory      = aggregationFactoryFactory;
            ScriptingService               = scriptingService;
        }
예제 #15
0
 public EPServicesContext(
     IContainer container,
     AggregationServiceFactoryService aggregationServiceFactoryService,
     BeanEventTypeFactoryPrivate beanEventTypeFactoryPrivate,
     BeanEventTypeStemService beanEventTypeStemService,
     ClassForNameProvider classForNameProvider,
     ParentClassLoader classLoaderParent,
     PathRegistry <string, ClassProvided> classProvidedPathRegistry,
     Configuration configSnapshot,
     ContextManagementService contextManagementService,
     PathRegistry <string, ContextMetaData> contextPathRegistry,
     ContextServiceFactory contextServiceFactory,
     EPDataFlowServiceImpl dataflowService,
     DataFlowFilterServiceAdapter dataFlowFilterServiceAdapter,
     DatabaseConfigServiceRuntime databaseConfigServiceRuntime,
     DeploymentLifecycleService deploymentLifecycleService,
     DispatchService dispatchService,
     RuntimeEnvContext runtimeEnvContext,
     RuntimeSettingsService runtimeSettingsService,
     string runtimeURI,
     ImportServiceRuntime importServiceRuntime,
     EPStatementFactory epStatementFactory,
     PathRegistry <string, ExpressionDeclItem> exprDeclaredPathRegistry,
     IReaderWriterLock eventProcessingRWLock,
     EPServicesHA epServicesHA,
     EPRuntimeSPI epRuntime,
     EventBeanService eventBeanService,
     EventBeanTypedEventFactory eventBeanTypedEventFactory,
     EPRenderEventServiceImpl eventRenderer,
     EventSerdeFactory eventSerdeFactory,
     EventTableIndexService eventTableIndexService,
     EventTypeAvroHandler eventTypeAvroHandler,
     EventTypeFactory eventTypeFactory,
     EventTypeIdResolver eventTypeIdResolver,
     PathRegistry <string, EventType> eventTypePathRegistry,
     EventTypeRepositoryImpl eventTypeRepositoryBus,
     EventTypeResolvingBeanFactory eventTypeResolvingBeanFactory,
     EventTypeSerdeRepository eventTypeSerdeRepository,
     ExceptionHandlingService exceptionHandlingService,
     ExpressionResultCacheService expressionResultCacheService,
     FilterBooleanExpressionFactory filterBooleanExpressionFactory,
     FilterServiceSPI filterService,
     FilterSharedBoolExprRepository filterSharedBoolExprRepository,
     FilterSharedLookupableRepository filterSharedLookupableRepository,
     HistoricalDataCacheFactory historicalDataCacheFactory,
     InternalEventRouterImpl internalEventRouter,
     MetricReportingService metricReportingService,
     MultiMatchHandlerFactory multiMatchHandlerFactory,
     NamedWindowConsumerManagementService namedWindowConsumerManagementService,
     NamedWindowDispatchService namedWindowDispatchService,
     NamedWindowFactoryService namedWindowFactoryService,
     NamedWindowManagementService namedWindowManagementService,
     PathRegistry <string, NamedWindowMetaData> namedWindowPathRegistry,
     PatternFactoryService patternFactoryService,
     PatternSubexpressionPoolRuntimeSvc patternSubexpressionPoolEngineSvc,
     ResultSetProcessorHelperFactory resultSetProcessorHelperFactory,
     RowRecogStateRepoFactory rowRecogStateRepoFactory,
     RowRecogStatePoolRuntimeSvc rowRecogStatePoolEngineSvc,
     SchedulingServiceSPI schedulingService,
     PathRegistry <NameAndParamNum, ExpressionScriptProvided> scriptPathRegistry,
     ScriptCompiler scriptCompiler,
     StageRecoveryService stageRecoveryService,
     StatementLifecycleService statementLifecycleService,
     StatementAgentInstanceLockFactory statementAgentInstanceLockFactory,
     StatementResourceHolderBuilder statementResourceHolderBuilder,
     TableExprEvaluatorContext tableExprEvaluatorContext,
     TableManagementService tableManagementService,
     PathRegistry <string, TableMetaData> tablePathRegistry,
     ThreadingService threadingService,
     TimeAbacus timeAbacus,
     TimeSourceService timeSourceService,
     TimerService timerService,
     VariableManagementService variableManagementService,
     PathRegistry <string, VariableMetaData> variablePathRegistry,
     ViewableActivatorFactory viewableActivatorFactory,
     ViewFactoryService viewFactoryService,
     ViewServicePreviousFactory viewServicePreviousFactory,
     XMLFragmentEventTypeFactory xmlFragmentEventTypeFactory)
 {
     _container = container;
     _aggregationServiceFactoryService = aggregationServiceFactoryService;
     _beanEventTypeFactoryPrivate      = beanEventTypeFactoryPrivate;
     _beanEventTypeStemService         = beanEventTypeStemService;
     _classForNameProvider             = classForNameProvider;
     _classLoaderParent            = classLoaderParent;
     _classProvidedPathRegistry    = classProvidedPathRegistry;
     _configSnapshot               = configSnapshot;
     _contextManagementService     = contextManagementService;
     _contextPathRegistry          = contextPathRegistry;
     _contextServiceFactory        = contextServiceFactory;
     _dataflowService              = dataflowService;
     _dataFlowFilterServiceAdapter = dataFlowFilterServiceAdapter;
     _databaseConfigServiceRuntime = databaseConfigServiceRuntime;
     _deploymentLifecycleService   = deploymentLifecycleService;
     _dispatchService              = dispatchService;
     _runtimeEnvContext            = runtimeEnvContext;
     _runtimeSettingsService       = runtimeSettingsService;
     _runtimeUri               = runtimeURI;
     _importServiceRuntime     = importServiceRuntime;
     _epStatementFactory       = epStatementFactory;
     _exprDeclaredPathRegistry = exprDeclaredPathRegistry;
     _eventProcessingRWLock    = eventProcessingRWLock;
     _epServicesHA             = epServicesHA;
     _epRuntime                            = epRuntime;
     _eventBeanService                     = eventBeanService;
     _eventBeanTypedEventFactory           = eventBeanTypedEventFactory;
     _eventRenderer                        = eventRenderer;
     _eventSerdeFactory                    = eventSerdeFactory;
     _eventTableIndexService               = eventTableIndexService;
     _eventTypeAvroHandler                 = eventTypeAvroHandler;
     _eventTypeFactory                     = eventTypeFactory;
     _eventTypeIdResolver                  = eventTypeIdResolver;
     _eventTypePathRegistry                = eventTypePathRegistry;
     _eventTypeRepositoryBus               = eventTypeRepositoryBus;
     _eventTypeResolvingBeanFactory        = eventTypeResolvingBeanFactory;
     _eventTypeSerdeRepository             = eventTypeSerdeRepository;
     _exceptionHandlingService             = exceptionHandlingService;
     _expressionResultCacheService         = expressionResultCacheService;
     _filterBooleanExpressionFactory       = filterBooleanExpressionFactory;
     _filterService                        = filterService;
     _filterSharedBoolExprRepository       = filterSharedBoolExprRepository;
     _filterSharedLookupableRepository     = filterSharedLookupableRepository;
     _historicalDataCacheFactory           = historicalDataCacheFactory;
     _internalEventRouter                  = internalEventRouter;
     _metricReportingService               = metricReportingService;
     _multiMatchHandlerFactory             = multiMatchHandlerFactory;
     _namedWindowConsumerManagementService = namedWindowConsumerManagementService;
     _namedWindowDispatchService           = namedWindowDispatchService;
     _namedWindowFactoryService            = namedWindowFactoryService;
     _namedWindowManagementService         = namedWindowManagementService;
     _namedWindowPathRegistry              = namedWindowPathRegistry;
     _patternFactoryService                = patternFactoryService;
     _patternSubexpressionPoolEngineSvc    = patternSubexpressionPoolEngineSvc;
     _resultSetProcessorHelperFactory      = resultSetProcessorHelperFactory;
     _rowRecogStateRepoFactory             = rowRecogStateRepoFactory;
     _rowRecogStatePoolEngineSvc           = rowRecogStatePoolEngineSvc;
     _schedulingService                    = schedulingService;
     _scriptPathRegistry                   = scriptPathRegistry;
     _stageRecoveryService                 = stageRecoveryService;
     _statementLifecycleService            = statementLifecycleService;
     _statementAgentInstanceLockFactory    = statementAgentInstanceLockFactory;
     _statementResourceHolderBuilder       = statementResourceHolderBuilder;
     _tableExprEvaluatorContext            = tableExprEvaluatorContext;
     _tableManagementService               = tableManagementService;
     _tablePathRegistry                    = tablePathRegistry;
     _threadingService                     = threadingService;
     _timeAbacus                           = timeAbacus;
     _timeSourceService                    = timeSourceService;
     _timerService                         = timerService;
     _variableManagementService            = variableManagementService;
     _variablePathRegistry                 = variablePathRegistry;
     _viewableActivatorFactory             = viewableActivatorFactory;
     _viewFactoryService                   = viewFactoryService;
     _viewServicePreviousFactory           = viewServicePreviousFactory;
     _xmlFragmentEventTypeFactory          = xmlFragmentEventTypeFactory;
     _scriptCompiler                       = scriptCompiler;
 }
 protected OutputProcessViewBaseWAfter(ResultSetProcessorHelperFactory resultSetProcessorHelperFactory, AgentInstanceContext agentInstanceContext, ResultSetProcessor resultSetProcessor, long?afterConditionTime, int?afterConditionNumberOfEvents, bool afterConditionSatisfied)
     : base(resultSetProcessor)
 {
     _afterConditionState = resultSetProcessorHelperFactory.MakeOutputConditionAfter(afterConditionTime, afterConditionNumberOfEvents, afterConditionSatisfied, agentInstanceContext);
 }
예제 #17
0
        public static OutputProcessViewFactory Make(
            StatementSpecCompiled statementSpec,
            InternalEventRouter internalEventRouter,
            StatementContext statementContext,
            EventType resultEventType,
            OutputProcessViewCallback optionalOutputProcessViewCallback,
            TableService tableService,
            ResultSetProcessorType resultSetProcessorType,
            ResultSetProcessorHelperFactory resultSetProcessorHelperFactory,
            StatementVariableRef statementVariableRef)
        {
            // determine direct-callback
            if (optionalOutputProcessViewCallback != null)
            {
                return(new OutputProcessViewFactoryCallback(optionalOutputProcessViewCallback));
            }

            // determine routing
            bool isRouted     = false;
            bool routeToFront = false;

            if (statementSpec.InsertIntoDesc != null)
            {
                isRouted     = true;
                routeToFront =
                    statementContext.NamedWindowMgmtService.IsNamedWindow(statementSpec.InsertIntoDesc.EventTypeName);
            }

            OutputStrategyPostProcessFactory outputStrategyPostProcessFactory = null;

            if ((statementSpec.InsertIntoDesc != null) ||
                (statementSpec.SelectStreamSelectorEnum == SelectClauseStreamSelectorEnum.RSTREAM_ONLY))
            {
                SelectClauseStreamSelectorEnum?insertIntoStreamSelector = null;
                string tableName = null;

                if (statementSpec.InsertIntoDesc != null)
                {
                    insertIntoStreamSelector = statementSpec.InsertIntoDesc.StreamSelector;
                    TableMetadata tableMetadata =
                        tableService.GetTableMetadata(statementSpec.InsertIntoDesc.EventTypeName);
                    if (tableMetadata != null)
                    {
                        tableName = tableMetadata.TableName;
                        EPLValidationUtil.ValidateContextName(
                            true, tableName, tableMetadata.ContextName, statementSpec.OptionalContextName, true);
                        statementVariableRef.AddReferences(statementContext.StatementName, tableMetadata.TableName);
                    }
                }

                outputStrategyPostProcessFactory = new OutputStrategyPostProcessFactory(
                    isRouted, insertIntoStreamSelector, statementSpec.SelectStreamSelectorEnum, internalEventRouter,
                    statementContext.EpStatementHandle, routeToFront, tableService, tableName);
            }

            // Do we need to enforce an output policy?
            int             streamCount     = statementSpec.StreamSpecs.Length;
            OutputLimitSpec outputLimitSpec = statementSpec.OutputLimitSpec;
            bool            isDistinct      = statementSpec.SelectClauseSpec.IsDistinct;
            bool            isGrouped       = statementSpec.GroupByExpressions != null &&
                                              statementSpec.GroupByExpressions.GroupByNodes.Length > 0;

            OutputProcessViewFactory outputProcessViewFactory;

            if (outputLimitSpec == null)
            {
                if (!isDistinct)
                {
                    outputProcessViewFactory = new OutputProcessViewDirectFactory(
                        statementContext, outputStrategyPostProcessFactory, resultSetProcessorHelperFactory);
                }
                else
                {
                    outputProcessViewFactory = new OutputProcessViewDirectDistinctOrAfterFactory(
                        statementContext, outputStrategyPostProcessFactory, resultSetProcessorHelperFactory, isDistinct,
                        null, null, resultEventType);
                }
            }
            else if (outputLimitSpec.RateType == OutputLimitRateType.AFTER)
            {
                outputProcessViewFactory = new OutputProcessViewDirectDistinctOrAfterFactory(
                    statementContext, outputStrategyPostProcessFactory, resultSetProcessorHelperFactory, isDistinct,
                    outputLimitSpec.AfterTimePeriodExpr, outputLimitSpec.AfterNumberOfEvents, resultEventType);
            }
            else
            {
                try
                {
                    bool isWithHavingClause         = statementSpec.HavingExprRootNode != null;
                    bool isStartConditionOnCreation = HasOnlyTables(statementSpec.StreamSpecs);
                    OutputConditionFactory outputConditionFactory =
                        OutputConditionFactoryFactory.CreateCondition(
                            outputLimitSpec, statementContext, isGrouped, isWithHavingClause, isStartConditionOnCreation,
                            resultSetProcessorHelperFactory);
                    bool hasOrderBy = statementSpec.OrderByList != null && statementSpec.OrderByList.Length > 0;
                    OutputProcessViewConditionFactory.ConditionType conditionType;
                    bool hasAfter = outputLimitSpec.AfterNumberOfEvents != null ||
                                    outputLimitSpec.AfterTimePeriodExpr != null;
                    bool isUnaggregatedUngrouped = resultSetProcessorType == ResultSetProcessorType.HANDTHROUGH ||
                                                   resultSetProcessorType ==
                                                   ResultSetProcessorType.UNAGGREGATED_UNGROUPED;

                    // hint checking with order-by
                    bool hasOptHint = HintEnum.ENABLE_OUTPUTLIMIT_OPT.GetHint(statementSpec.Annotations) != null;
                    if (hasOptHint && hasOrderBy)
                    {
                        throw new ExprValidationException(
                                  "The " + HintEnum.ENABLE_OUTPUTLIMIT_OPT + " hint is not supported with order-by");
                    }

                    if (outputLimitSpec.DisplayLimit == OutputLimitLimitType.SNAPSHOT)
                    {
                        conditionType = OutputProcessViewConditionFactory.ConditionType.SNAPSHOT;
                    }
                    else if (outputLimitSpec.DisplayLimit == OutputLimitLimitType.FIRST &&
                             statementSpec.GroupByExpressions == null)
                    {
                        // For FIRST without groups we are using a special logic that integrates the first-flag, in order to still conveniently use all sorts of output conditions.
                        // FIRST with group-by is handled by setting the output condition to null (OutputConditionNull) and letting the ResultSetProcessor handle first-per-group.
                        // Without having-clause there is no required order of processing, thus also use regular policy.
                        conditionType = OutputProcessViewConditionFactory.ConditionType.POLICY_FIRST;
                    }
                    else if (isUnaggregatedUngrouped && outputLimitSpec.DisplayLimit == OutputLimitLimitType.LAST)
                    {
                        conditionType = OutputProcessViewConditionFactory.ConditionType.POLICY_LASTALL_UNORDERED;
                    }
                    else if (hasOptHint && outputLimitSpec.DisplayLimit == OutputLimitLimitType.ALL && !hasOrderBy)
                    {
                        conditionType = OutputProcessViewConditionFactory.ConditionType.POLICY_LASTALL_UNORDERED;
                    }
                    else if (hasOptHint && outputLimitSpec.DisplayLimit == OutputLimitLimitType.LAST && !hasOrderBy)
                    {
                        conditionType = OutputProcessViewConditionFactory.ConditionType.POLICY_LASTALL_UNORDERED;
                    }
                    else
                    {
                        conditionType = OutputProcessViewConditionFactory.ConditionType.POLICY_NONFIRST;
                    }

                    SelectClauseStreamSelectorEnum selectClauseStreamSelectorEnum =
                        statementSpec.SelectStreamSelectorEnum;
                    bool terminable = outputLimitSpec.RateType == OutputLimitRateType.TERM ||
                                      outputLimitSpec.IsAndAfterTerminate;
                    outputProcessViewFactory = new OutputProcessViewConditionFactory(
                        statementContext, outputStrategyPostProcessFactory, isDistinct,
                        outputLimitSpec.AfterTimePeriodExpr, outputLimitSpec.AfterNumberOfEvents, resultEventType,
                        outputConditionFactory, streamCount, conditionType, outputLimitSpec.DisplayLimit, terminable,
                        hasAfter, isUnaggregatedUngrouped, selectClauseStreamSelectorEnum,
                        resultSetProcessorHelperFactory);
                }
                catch (Exception ex)
                {
                    throw new ExprValidationException("Error in the output rate limiting clause: " + ex.Message, ex);
                }
            }

            return(outputProcessViewFactory);
        }
예제 #18
0
        public OutputConditionFirstFactory(OutputLimitSpec outputLimitSpec, StatementContext statementContext, bool isGrouped, bool isWithHavingClause, ResultSetProcessorHelperFactory resultSetProcessorHelperFactory)
        {
            var innerSpec = new OutputLimitSpec(outputLimitSpec.Rate,
                                                outputLimitSpec.VariableName,
                                                outputLimitSpec.RateType, OutputLimitLimitType.DEFAULT,
                                                outputLimitSpec.WhenExpressionNode,
                                                outputLimitSpec.ThenExpressions,
                                                outputLimitSpec.CrontabAtSchedule,
                                                outputLimitSpec.TimePeriodExpr,
                                                outputLimitSpec.AfterTimePeriodExpr,
                                                outputLimitSpec.AfterNumberOfEvents,
                                                outputLimitSpec.IsAndAfterTerminate,
                                                outputLimitSpec.AndAfterTerminateExpr,
                                                outputLimitSpec.AndAfterTerminateThenExpressions);

            _innerConditionFactory = OutputConditionFactoryFactory.CreateCondition(innerSpec, statementContext, isGrouped, isWithHavingClause, false, resultSetProcessorHelperFactory);
        }
 public StatementContextRuntimeServices(
     IContainer container,
     ContextManagementService contextManagementService,
     ContextServiceFactory contextServiceFactory,
     DatabaseConfigServiceRuntime databaseConfigService,
     DataFlowFilterServiceAdapter dataFlowFilterServiceAdapter,
     EPDataFlowServiceImpl dataflowService,
     string runtimeURI,
     INamingContext runtimeEnvContext,
     ImportServiceRuntime importServiceRuntime,
     RuntimeSettingsService runtimeSettingsService,
     RuntimeExtensionServices runtimeExtensionServices,
     object epRuntime,
     EPRenderEventService epRuntimeRenderEvent,
     EventServiceSendEventCommon eventServiceSendEventInternal,
     EPRuntimeEventProcessWrapped epRuntimeEventProcessWrapped,
     EventBeanService eventBeanService,
     EventBeanTypedEventFactory eventBeanTypedEventFactory,
     EventTableIndexService eventTableIndexService,
     EventTypeAvroHandler eventTypeAvroHandler,
     PathRegistry<string, EventType> eventTypePathRegistry,
     EventTypeRepositoryImpl eventTypeRepositoryPreconfigured,
     EventTypeResolvingBeanFactory eventTypeResolvingBeanFactory,
     ExceptionHandlingService exceptionHandlingService,
     ExpressionResultCacheService expressionResultCacheService,
     FilterBooleanExpressionFactory filterBooleanExpressionFactory,
     FilterSharedBoolExprRepository filterSharedBoolExprRepository,
     FilterSharedLookupableRepository filterSharedLookupableRepository,
     HistoricalDataCacheFactory historicalDataCacheFactory,
     InternalEventRouter internalEventRouter,
     MetricReportingService metricReportingService,
     NamedWindowConsumerManagementService namedWindowConsumerManagementService,
     NamedWindowManagementService namedWindowManagementService,
     PathRegistry<string, ContextMetaData> pathContextRegistry,
     PathRegistry<string, NamedWindowMetaData> pathNamedWindowRegistry,
     RowRecogStateRepoFactory rowRecogStateRepoFactory,
     ResultSetProcessorHelperFactory resultSetProcessorHelperFactory,
     StatementAgentInstanceLockFactory statementAgentInstanceLockFactory,
     StatementResourceHolderBuilder statementResourceHolderBuilder,
     TableExprEvaluatorContext tableExprEvaluatorContext,
     TableManagementService tableManagementService,
     VariableManagementService variableManagementService,
     ViewFactoryService viewFactoryService,
     ViewServicePreviousFactory viewServicePreviousFactory)
 {
     Container = container;
     ContextManagementService = contextManagementService;
     ContextServiceFactory = contextServiceFactory;
     DatabaseConfigService = databaseConfigService;
     DataFlowFilterServiceAdapter = dataFlowFilterServiceAdapter;
     DataflowService = dataflowService;
     RuntimeURI = runtimeURI;
     RuntimeEnvContext = runtimeEnvContext;
     ImportServiceRuntime = importServiceRuntime;
     RuntimeSettingsService = runtimeSettingsService;
     RuntimeExtensionServices = runtimeExtensionServices;
     Runtime = epRuntime;
     EPRuntimeRenderEvent = epRuntimeRenderEvent;
     EventServiceSendEventInternal = eventServiceSendEventInternal;
     EPRuntimeEventProcessWrapped = epRuntimeEventProcessWrapped;
     EventBeanService = eventBeanService;
     EventBeanTypedEventFactory = eventBeanTypedEventFactory;
     EventTableIndexService = eventTableIndexService;
     EventTypeAvroHandler = eventTypeAvroHandler;
     EventTypePathRegistry = eventTypePathRegistry;
     EventTypeRepositoryPreconfigured = eventTypeRepositoryPreconfigured;
     EventTypeResolvingBeanFactory = eventTypeResolvingBeanFactory;
     ExceptionHandlingService = exceptionHandlingService;
     ExpressionResultCacheService = expressionResultCacheService;
     FilterBooleanExpressionFactory = filterBooleanExpressionFactory;
     FilterSharedBoolExprRepository = filterSharedBoolExprRepository;
     FilterSharedLookupableRepository = filterSharedLookupableRepository;
     HistoricalDataCacheFactory = historicalDataCacheFactory;
     InternalEventRouter = internalEventRouter;
     MetricReportingService = metricReportingService;
     NamedWindowConsumerManagementService = namedWindowConsumerManagementService;
     NamedWindowManagementService = namedWindowManagementService;
     PathContextRegistry = pathContextRegistry;
     PathNamedWindowRegistry = pathNamedWindowRegistry;
     RowRecogStateRepoFactory = rowRecogStateRepoFactory;
     ResultSetProcessorHelperFactory = resultSetProcessorHelperFactory;
     StatementAgentInstanceLockFactory = statementAgentInstanceLockFactory;
     StatementResourceHolderBuilder = statementResourceHolderBuilder;
     TableExprEvaluatorContext = tableExprEvaluatorContext;
     TableManagementService = tableManagementService;
     VariableManagementService = variableManagementService;
     ViewFactoryService = viewFactoryService;
     ViewServicePreviousFactory = viewServicePreviousFactory;
 }