Beispiel #1
0
        private static string ResolveDeploymentId(
            string tableName,
            NameAccessModifier visibility,
            string optionalModuleName,
            EPStatementInitServices services)
        {
            string deploymentId;
            switch (visibility) {
                case NameAccessModifier.PRIVATE:
                    deploymentId = services.DeploymentId;
                    break;

                case NameAccessModifier.PUBLIC:
                case NameAccessModifier.INTERNAL:
                {
                    deploymentId = services.NamedWindowPathRegistry.GetDeploymentId(tableName, optionalModuleName);
                    if (deploymentId == null) {
                        throw new EPException("Failed to resolve path named window '" + tableName + "'");
                    }

                    break;
                }

                default:
                    throw new ArgumentException("Unrecognized visibility " + visibility);
            }

            return deploymentId;
        }
Beispiel #2
0
 public void Init(
     ViewFactoryContext viewFactoryContext,
     EPStatementInitServices services)
 {
     try {
         eventBeanFactory = EventTypeUtility.GetFactoryForType(
             EventType,
             services.EventBeanTypedEventFactory,
             services.EventTypeAvroHandler);
         var factoryContext = new VirtualDataWindowFactoryContext(
             EventType,
             Parameters,
             ParameterExpressions,
             NamedWindowName,
             CompileTimeConfiguration,
             viewFactoryContext,
             services);
         Factory.Initialize(factoryContext);
     }
     catch (Exception ex) {
         throw new EPException(
             "Validation exception initializing virtual data window '" + NamedWindowName + "': " + ex.Message,
             ex);
     }
 }
Beispiel #3
0
        /// <summary>
        /// NOTE: Code-generation-invoked method, method name and parameter order matters
        /// </summary>
        /// <param name="expressionName">name</param>
        /// <param name="visibility">visibility</param>
        /// <param name="optionalModuleName">module name</param>
        /// <param name="services">services</param>
        /// <returns>deployment id</returns>
        public static string ResolveDeploymentId(
            string expressionName,
            NameAccessModifier visibility,
            string optionalModuleName,
            EPStatementInitServices services)
        {
            string deploymentId;
            if (visibility == NameAccessModifier.PRECONFIGURED) {
                deploymentId = null;
            }
            else if (visibility == NameAccessModifier.PRIVATE) {
                deploymentId = services.DeploymentId;
            }
            else if (visibility == NameAccessModifier.PUBLIC) {
                deploymentId = services.ExprDeclaredPathRegistry.GetDeploymentId(expressionName, optionalModuleName);
                if (deploymentId == null) {
                    throw new EPException("Failed to resolve path expression '" + expressionName + "'");
                }
            }
            else {
                throw new ArgumentException("Unrecognized visibility " + visibility);
            }

            return deploymentId;
        }
Beispiel #4
0
 public void Init(
     ViewFactoryContext viewFactoryContext,
     EPStatementInitServices services)
 {
     foreach (ViewFactory factory in unioned) {
         factory.Init(viewFactoryContext, services);
     }
 }
Beispiel #5
0
 public NamedWindowTailView CreateNamedWindowTailView(
     EventType eventType,
     bool isParentBatchWindow,
     EPStatementInitServices services,
     string contextNameWindow)
 {
     return new NamedWindowTailViewImpl(eventType, isParentBatchWindow, services);
 }
Beispiel #6
0
 public void Init(
     ViewFactoryContext viewFactoryContext,
     EPStatementInitServices services)
 {
     if (eventType == null) {
         throw new IllegalStateException("Event type not provided");
     }
 }
Beispiel #7
0
            consumersNonContext; // handles as copy-on-write

        public NamedWindowTailViewImpl(
            EventType eventType,
            bool isParentBatchWindow,
            EPStatementInitServices services)
            : base(eventType, isParentBatchWindow, services)
        {
            this.consumersNonContext = NamedWindowUtil.CreateConsumerMap(isPrioritized);
        }
Beispiel #8
0
 public void Init(
     ViewFactoryContext viewFactoryContext,
     EPStatementInitServices services)
 {
     Comparer = ExprNodeUtilityMake.GetComparatorHashableMultiKeys(
         SortCriteriaTypes,
         IsUseCollatorSort,
         IsDescendingValues); // hashable-key comparator since we may remove sort keys
 }
Beispiel #9
0
 public ContainedEventEvalExprNode(
     ExprEvaluator evaluator,
     EventType eventType,
     EPStatementInitServices initServices)
 {
     this.evaluator = evaluator;
     this.eventBeanFactory = EventTypeUtility.GetFactoryForType(
         eventType,
         initServices.EventBeanTypedEventFactory,
         initServices.EventTypeAvroHandler);
 }
Beispiel #10
0
        public void Init(
            ViewFactoryContext viewFactoryContext,
            EPStatementInitServices services)
        {
            if (Groupeds == null) {
                throw new IllegalStateException("Grouped views not provided");
            }

            foreach (var grouped in Groupeds) {
                grouped.Init(viewFactoryContext, services);
            }
        }
Beispiel #11
0
 public NamedWindowImpl(
     NamedWindowMetaData metadata,
     EPStatementInitServices services)
 {
     rootView = new NamedWindowRootView(metadata);
     eventTableIndexMetadataRepo = metadata.IndexMetadata;
     tailView = services.NamedWindowFactoryService.CreateNamedWindowTailView(
         metadata.EventType,
         metadata.IsChildBatching,
         services,
         metadata.ContextName);
 }
Beispiel #12
0
        public void AddContext(
            ContextDefinition contextDefinition,
            EPStatementInitServices services)
        {
            var deployment = deployments.Get(services.DeploymentId);
            if (deployment == null) {
                deployment = new ContextDeployment();
                deployments.Put(services.DeploymentId, deployment);
            }

            deployment.Add(contextDefinition, services);
        }
Beispiel #13
0
        public void Add(
            string windowName,
            NamedWindowMetaData metadata,
            EPStatementInitServices services)
        {
            NamedWindow existing = namedWindows.Get(windowName);
            if (existing != null) {
                throw new IllegalStateException("Named window processor already found for name '" + windowName + "'");
            }

            NamedWindow namedWindow = services.NamedWindowFactoryService.CreateNamedWindow(metadata, services);
            namedWindows.Put(windowName, namedWindow);
        }
Beispiel #14
0
        public void Add(
            ContextDefinition contextDefinition,
            EPStatementInitServices services)
        {
            var contextName = contextDefinition.ContextName;
            var mgr = contexts.Get(contextName);
            if (mgr != null) {
                throw new EPException("Context by name '" + contextDefinition.ContextName + "' already exists");
            }

            var contextManager = new ContextManagerResident(services.DeploymentId, contextDefinition);
            contexts.Put(contextName, contextManager);
        }
Beispiel #15
0
        public void Add(
            string tableName,
            TableMetaData metadata,
            EPStatementInitServices services)
        {
            Table existing = tables.Get(tableName);
            if (existing != null) {
                throw new IllegalStateException("Table already found for name '" + tableName + "'");
            }

            Table table = services.TableManagementService.AllocateTable(metadata);
            tables.Put(tableName, table);
        }
Beispiel #16
0
        public void AddTable(
            string tableName,
            TableMetaData tableMetaData,
            EPStatementInitServices services)
        {
            var deployment = deployments.Get(services.DeploymentId);
            if (deployment == null) {
                deployment = new TableDeployment();
                deployments.Put(services.DeploymentId, deployment);
            }

            deployment.Add(tableName, tableMetaData, services);
        }
        public void AddNamedWindow(
            string windowName,
            NamedWindowMetaData metadata,
            EPStatementInitServices services)
        {
            NamedWindowDeployment deployment = deployments.Get(services.DeploymentId);
            if (deployment == null) {
                deployment = new NamedWindowDeployment();
                deployments.Put(services.DeploymentId, deployment);
            }

            deployment.Add(windowName, metadata, services);
        }
Beispiel #18
0
 public NamedWindowTailViewBase(
     EventType eventType,
     bool isParentBatchWindow,
     EPStatementInitServices services)
 {
     this.eventType = eventType;
     namedWindowManagementService = services.NamedWindowManagementService;
     namedWindowDispatchService = services.NamedWindowDispatchService;
     statementResultService = services.StatementResultService;
     isPrioritized = services.RuntimeSettingsService.ConfigurationRuntime.Execution.IsPrioritized;
     this.isParentBatchWindow = isParentBatchWindow;
     threadingConfig = services.RuntimeSettingsService.ConfigurationRuntime.Threading;
     timeSourceService = services.TimeSourceService;
 }
Beispiel #19
0
        public static Table ResolveTable(
            string tableName,
            NameAccessModifier visibility,
            string optionalModuleName,
            EPStatementInitServices services)
        {
            string deploymentId = ResolveDeploymentId(tableName, visibility, optionalModuleName, services);
            Table table = services.TableManagementService.GetTable(deploymentId, tableName);
            if (table == null) {
                throw new EPException("Failed to resolve table '" + tableName + "'");
            }

            return table;
        }
        public static Variable ResolveVariable(
            string variableName,
            NameAccessModifier visibility,
            string optionalModuleName,
            EPStatementInitServices services)
        {
            var deploymentId = ResolveDeploymentId(variableName, visibility, optionalModuleName, services);
            var variable = services.VariableManagementService.GetVariableMetaData(deploymentId, variableName);
            if (variable == null) {
                throw new EPException("Failed to resolve variable '" + variableName + "'");
            }

            return variable;
        }
Beispiel #21
0
        public static NamedWindow ResolveNamedWindow(
            string namedWindowName,
            NameAccessModifier visibility,
            string optionalModuleName,
            EPStatementInitServices services)
        {
            string deploymentId = ResolveDeploymentId(namedWindowName, visibility, optionalModuleName, services);
            NamedWindow namedWindow =
                services.NamedWindowManagementService.GetNamedWindow(deploymentId, namedWindowName);
            if (namedWindow == null) {
                throw new EPException("Failed to resolve named window '" + namedWindowName + "'");
            }

            return namedWindow;
        }
 /// <summary>
 ///     Ctor.
 /// </summary>
 /// <param name="eventType">event type</param>
 /// <param name="parameters">parameter values</param>
 /// <param name="parameterExpressions">parameter expressions</param>
 /// <param name="namedWindowName">named window name</param>
 /// <param name="customConfiguration">custom configuration object that is passed along</param>
 /// <param name="viewFactoryContext">view context</param>
 /// <param name="services">services</param>
 public VirtualDataWindowFactoryContext(
     EventType eventType,
     object[] parameters,
     ExprEvaluator[] parameterExpressions,
     string namedWindowName,
     object customConfiguration,
     ViewFactoryContext viewFactoryContext,
     EPStatementInitServices services)
 {
     EventType = eventType;
     Parameters = parameters;
     ParameterExpressions = parameterExpressions;
     NamedWindowName = namedWindowName;
     CustomConfiguration = customConfiguration;
     ViewFactoryContext = viewFactoryContext;
     Services = services;
 }
        public static IDictionary<int, VariableReader> ResolveVariableReaderPerCP(
            string variableName,
            NameAccessModifier visibility,
            string optionalModuleName,
            string optionalContextName,
            EPStatementInitServices services)
        {
            if (optionalContextName == null) {
                throw new ArgumentException("No context name");
            }

            var deploymentId = ResolveDeploymentId(variableName, visibility, optionalModuleName, services);
            IDictionary<int, VariableReader> reader =
                services.VariableManagementService.GetReadersPerCP(deploymentId, variableName);
            if (reader == null) {
                throw new EPException("Failed to resolve variable '" + variableName + "'");
            }

            return reader;
        }
Beispiel #24
0
        private static string ResolveDeploymentId(
            string tableName,
            NameAccessModifier visibility,
            string optionalModuleName,
            EPStatementInitServices services)
        {
            string deploymentId;
            if (visibility == NameAccessModifier.PRIVATE) {
                deploymentId = services.DeploymentId;
            }
            else if (visibility == NameAccessModifier.PUBLIC || visibility == NameAccessModifier.INTERNAL) {
                deploymentId = services.TablePathRegistry.GetDeploymentId(tableName, optionalModuleName);
                if (deploymentId == null) {
                    throw new EPException("Failed to resolve path table '" + tableName + "'");
                }
            }
            else {
                throw new ArgumentException("Unrecognized visibility " + visibility);
            }

            return deploymentId;
        }
        public static VariableReader ResolveVariableReader(
            string variableName,
            NameAccessModifier visibility,
            string optionalModuleName,
            string optionalContextName,
            EPStatementInitServices services)
        {
            if (optionalContextName != null) {
                throw new ArgumentException("Expected null context name");
            }

            var deploymentId = ResolveDeploymentId(variableName, visibility, optionalModuleName, services);
            var reader = services.VariableManagementService.GetReader(
                deploymentId,
                variableName,
                DEFAULT_AGENT_INSTANCE_ID);
            if (reader == null) {
                throw new EPException("Failed to resolve variable '" + variableName + "'");
            }

            return reader;
        }
 public void Init(
     ViewFactoryContext viewFactoryContext,
     EPStatementInitServices services)
 {
 }
Beispiel #27
0
 public NamedWindow CreateNamedWindow(
     NamedWindowMetaData metadata,
     EPStatementInitServices services)
 {
     return new NamedWindowImpl(metadata, services);
 }