public StatementAgentInstanceFactorySelect(
     int numStreams,
     ViewableActivator[] eventStreamParentViewableActivators,
     StatementContext statementContext,
     StatementSpecCompiled statementSpec,
     EPServicesContext services,
     StreamTypeService typeService,
     ViewFactoryChain[] unmaterializedViewChain,
     ResultSetProcessorFactoryDesc resultSetProcessorFactoryDesc,
     StreamJoinAnalysisResult joinAnalysisResult,
     bool recoveringResilient,
     JoinSetComposerPrototype joinSetComposerPrototype,
     SubSelectStrategyCollection subSelectStrategyCollection,
     ViewResourceDelegateVerified viewResourceDelegate,
     OutputProcessViewFactory outputProcessViewFactory) :
     base(statementSpec.Annotations)
 {
     _numStreams = numStreams;
     _eventStreamParentViewableActivators = eventStreamParentViewableActivators;
     _statementContext              = statementContext;
     _statementSpec                 = statementSpec;
     _services                      = services;
     _typeService                   = typeService;
     _unmaterializedViewChain       = unmaterializedViewChain;
     _resultSetProcessorFactoryDesc = resultSetProcessorFactoryDesc;
     _joinAnalysisResult            = joinAnalysisResult;
     _joinSetComposerPrototype      = joinSetComposerPrototype;
     _subSelectStrategyCollection   = subSelectStrategyCollection;
     _viewResourceDelegate          = viewResourceDelegate;
     _outputProcessViewFactory      = outputProcessViewFactory;
 }
Exemple #2
0
 public StatementAgentInstanceFactoryOnTriggerBase(StatementContext statementContext, StatementSpecCompiled statementSpec, EPServicesContext services, ViewableActivator activator, SubSelectStrategyCollection subSelectStrategyCollection)
 {
     this.StatementContext             = statementContext;
     this.StatementSpec                = statementSpec;
     this.Services                     = services;
     this._activator                   = activator;
     this._subSelectStrategyCollection = subSelectStrategyCollection;
 }
 public StatementAgentInstanceFactoryUpdate(StatementContext statementContext, EPServicesContext services, EventType streamEventType, UpdateDesc desc, InternalRoutePreprocessView onExprView, InternalEventRouterDesc routerDesc, SubSelectStrategyCollection subSelectStrategyCollection)
     : base(statementContext.Annotations)
 {
     _statementContext            = statementContext;
     _services                    = services;
     _streamEventType             = streamEventType;
     _desc                        = desc;
     _onExprView                  = onExprView;
     _subSelectStrategyCollection = subSelectStrategyCollection;
     _routerDesc                  = routerDesc;
 }
Exemple #4
0
 public StatementAgentInstanceFactoryOnTriggerSplit(
     StatementContext statementContext,
     StatementSpecCompiled statementSpec,
     EPServicesContext services,
     ViewableActivator activator,
     SubSelectStrategyCollection subSelectStrategyCollection,
     EPStatementStartMethodOnTriggerItem[] items,
     EventType activatorResultEventType)
     : base(statementContext, statementSpec, services, activator, subSelectStrategyCollection)
 {
     _items = items;
     _activatorResultEventType = activatorResultEventType;
 }
        public static void AssignSubqueryStrategies(
            SubSelectStrategyCollection subSelectStrategyCollection,
            IDictionary<ExprSubselectNode, SubSelectStrategyHolder> subselectStrategyInstances)
        {
            // initialize subselects expression nodes (strategy assignment)
            foreach (var subselectEntry in subselectStrategyInstances)
            {
                var subselectNode = subselectEntry.Key;
                var strategyInstance = subselectEntry.Value;

                subselectNode.Strategy = strategyInstance.Stategy;
                subselectNode.SubselectAggregationService = strategyInstance.SubselectAggregationService;

                // initialize aggregations in the subselect
                var factoryDesc = subSelectStrategyCollection.Subqueries.Get(subselectNode);
                if (factoryDesc.AggregationServiceFactoryDesc != null)
                {
                    foreach (var aggExpressionDesc in factoryDesc.AggregationServiceFactoryDesc.Expressions)
                    {
                        aggExpressionDesc.AssignFuture(subselectEntry.Value.SubselectAggregationService);
                    }
                    if (factoryDesc.AggregationServiceFactoryDesc.GroupKeyExpressions != null)
                    {
                        foreach (var groupKeyExpr in factoryDesc.AggregationServiceFactoryDesc.GroupKeyExpressions)
                        {
                            groupKeyExpr.AssignFuture(subselectEntry.Value.SubselectAggregationService);
                        }
                    }
                }

                // initialize "prior" nodes in the subselect
                if (strategyInstance.PriorStrategies != null)
                {
                    foreach (var entry in strategyInstance.PriorStrategies)
                    {
                        entry.Key.PriorStrategy = entry.Value;
                    }
                }

                // initialize "prev" nodes in the subselect
                if (strategyInstance.PreviousNodeStrategies != null)
                {
                    foreach (
                        var entry in
                            strategyInstance.PreviousNodeStrategies)
                    {
                        entry.Key.Evaluator = entry.Value;
                    }
                }
            }
        }
Exemple #6
0
 public EPStatementStartMethodSelectDesc(
     StatementAgentInstanceFactorySelect statementAgentInstanceFactorySelect,
     SubSelectStrategyCollection subSelectStrategyCollection,
     ViewResourceDelegateUnverified viewResourceDelegateUnverified,
     ResultSetProcessorFactoryDesc resultSetProcessorPrototypeDesc,
     EPStatementStopMethod stopMethod,
     EPStatementDestroyCallbackList destroyCallbacks)
 {
     StatementAgentInstanceFactorySelect = statementAgentInstanceFactorySelect;
     SubSelectStrategyCollection         = subSelectStrategyCollection;
     ViewResourceDelegateUnverified      = viewResourceDelegateUnverified;
     ResultSetProcessorPrototypeDesc     = resultSetProcessorPrototypeDesc;
     StopMethod       = stopMethod;
     DestroyCallbacks = destroyCallbacks;
 }
        public StatementAgentInstanceFactoryOnTriggerNamedWindow(StatementContext statementContext, StatementSpecCompiled statementSpec, EPServicesContext services, ViewableActivator activator, SubSelectStrategyCollection subSelectStrategyCollection, ResultSetProcessorFactoryDesc resultSetProcessorPrototype, ExprNode validatedJoin, ResultSetProcessorFactoryDesc outputResultSetProcessorPrototype, NamedWindowOnExprFactory onExprFactory, OutputProcessViewFactory outputProcessViewFactory, EventType activatorResultEventType, NamedWindowProcessor processor, IList <StopCallback> stopCallbacks)
            : base(statementContext, statementSpec, services, activator, subSelectStrategyCollection)
        {
            _resultSetProcessorPrototype       = resultSetProcessorPrototype;
            _outputResultSetProcessorPrototype = outputResultSetProcessorPrototype;
            _onExprFactory            = onExprFactory;
            _outputProcessViewFactory = outputProcessViewFactory;
            _processor = processor;

            IndexHintPair   pair            = GetIndexHintPair(statementContext, statementSpec);
            IndexHint       indexHint       = pair.IndexHint;
            ExcludePlanHint excludePlanHint = pair.ExcludePlanHint;

            _queryPlan = SubordinateQueryPlanner.PlanOnExpression(
                validatedJoin, activatorResultEventType, indexHint, processor.IsEnableSubqueryIndexShare, -1, excludePlanHint,
                processor.IsVirtualDataWindow, processor.EventTableIndexMetadataRepo, processor.NamedWindowType,
                processor.OptionalUniqueKeyProps, false, statementContext.StatementName, statementContext.StatementId, statementContext.Annotations);
            if (_queryPlan.IndexDescs != null)
            {
                SubordinateQueryPlannerUtil.AddIndexMetaAndRef(_queryPlan.IndexDescs, processor.EventTableIndexMetadataRepo, statementContext.StatementName);
                stopCallbacks.Add(new ProxyStopCallback(() =>
                {
                    for (int i = 0; i < _queryPlan.IndexDescs.Length; i++)
                    {
                        bool last = processor.EventTableIndexMetadataRepo.RemoveIndexReference(_queryPlan.IndexDescs[i].IndexMultiKey, statementContext.StatementName);
                        if (last)
                        {
                            processor.EventTableIndexMetadataRepo.RemoveIndex(_queryPlan.IndexDescs[i].IndexMultiKey);
                            processor.RemoveAllInstanceIndexes(_queryPlan.IndexDescs[i].IndexMultiKey);
                        }
                    }
                }));
            }
            SubordinateQueryPlannerUtil.QueryPlanLogOnExpr(processor.RootView.IsQueryPlanLogging, NamedWindowRootView.QueryPlanLog,
                                                           _queryPlan, statementContext.Annotations, statementContext.EngineImportService);
        }
 public StatementAgentInstanceFactoryOnTriggerSplit(StatementContext statementContext, StatementSpecCompiled statementSpec, EPServicesContext services, ViewableActivator activator, SubSelectStrategyCollection subSelectStrategyCollection, StatementAgentInstanceFactoryOnTriggerSplitDesc splitDesc, EventType activatorResultEventType, string[] insertIntoTableNames)
     : base(statementContext, statementSpec, services, activator, subSelectStrategyCollection)
 {
     _splitDesc = splitDesc;
     _activatorResultEventType = activatorResultEventType;
     _insertIntoTableNames     = insertIntoTableNames;
 }
Exemple #9
0
 public ContextManagedStatementSelectDesc(StatementSpecCompiled statementSpec, StatementContext statementContext, ContextMergeView mergeView, StatementAgentInstanceFactory factory, IList <AggregationServiceAggExpressionDesc> aggregationExpressions, SubSelectStrategyCollection subSelectPrototypeCollection)
     : base(statementSpec, statementContext, mergeView, factory)
 {
     AggregationExpressions       = aggregationExpressions;
     SubSelectPrototypeCollection = subSelectPrototypeCollection;
 }
 public StatementAgentInstanceFactoryOnTriggerSetVariable(StatementContext statementContext, StatementSpecCompiled statementSpec, EPServicesContext services, ViewableActivator activator, SubSelectStrategyCollection subSelectStrategyCollection, OnSetVariableViewFactory onSetVariableViewFactory, ResultSetProcessorFactoryDesc outputResultSetProcessorPrototype, OutputProcessViewFactory outputProcessViewFactory)
     : base(statementContext, statementSpec, services, activator, subSelectStrategyCollection)
 {
     _onSetVariableViewFactory          = onSetVariableViewFactory;
     _outputResultSetProcessorPrototype = outputResultSetProcessorPrototype;
     _outputProcessViewFactory          = outputProcessViewFactory;
 }
Exemple #11
0
        public StatementAgentInstanceFactoryOnTriggerTable(StatementContext statementContext, StatementSpecCompiled statementSpec, EPServicesContext services, ViewableActivator activator, SubSelectStrategyCollection subSelectStrategyCollection, ResultSetProcessorFactoryDesc resultSetProcessorPrototype, ExprNode validatedJoin, TableOnViewFactory onExprFactory, EventType activatorResultEventType, TableMetadata tableMetadata, ResultSetProcessorFactoryDesc outputResultSetProcessorPrototype, OutputProcessViewFactory outputProcessViewFactory)
            : base(statementContext, statementSpec, services, activator, subSelectStrategyCollection)
        {
            _resultSetProcessorPrototype = resultSetProcessorPrototype;
            _onExprFactory = onExprFactory;
            _outputResultSetProcessorPrototype = outputResultSetProcessorPrototype;
            _outputProcessViewFactory          = outputProcessViewFactory;

            var pair            = StatementAgentInstanceFactoryOnTriggerNamedWindow.GetIndexHintPair(statementContext, statementSpec);
            var indexHint       = pair.IndexHint;
            var excludePlanHint = pair.ExcludePlanHint;

            _queryPlanResult = SubordinateQueryPlanner.PlanOnExpression(
                validatedJoin, activatorResultEventType, indexHint, true, -1, excludePlanHint,
                false, tableMetadata.EventTableIndexMetadataRepo, tableMetadata.InternalEventType,
                tableMetadata.UniqueKeyProps, true, statementContext.StatementName, statementContext.StatementId, statementContext.Annotations);
            if (_queryPlanResult.IndexDescs != null)
            {
                for (var i = 0; i < _queryPlanResult.IndexDescs.Length; i++)
                {
                    tableMetadata.AddIndexReference(_queryPlanResult.IndexDescs[i].IndexName, statementContext.StatementName);
                }
            }
            SubordinateQueryPlannerUtil.QueryPlanLogOnExpr(tableMetadata.IsQueryPlanLogging, TableServiceImpl.QueryPlanLog,
                                                           _queryPlanResult, statementContext.Annotations);
        }