Beispiel #1
0
        public AnnotationPart CompileAnnotationToSODA(string annotationExpression)
        {
            var toCompile = annotationExpression + " select * from System.object";
            var raw       = EPAdministratorHelper.CompileEPL(toCompile, annotationExpression, false, null, _services, SelectClauseStreamSelectorEnum.ISTREAM_ONLY);

            return(StatementSpecMapper.Unmap(raw.Annotations[0]));
        }
Beispiel #2
0
        public MatchRecognizeRegEx CompileMatchRecognizePatternToSODA(string matchRecogPatternExpression)
        {
            var toCompile = "select * from System.object Match_recognize(measures a.b as c pattern (" + matchRecogPatternExpression + ") define A as true)";
            var raw       = EPAdministratorHelper.CompileEPL(toCompile, matchRecogPatternExpression, false, null, _services, SelectClauseStreamSelectorEnum.ISTREAM_ONLY);

            return(StatementSpecMapper.Unmap(raw.MatchRecognizeSpec.Pattern));
        }
Beispiel #3
0
        public ExprNode CompileExpression(string expression)
        {
            var toCompile = "select * from System.object#time(" + expression + ")";
            var raw       = EPAdministratorHelper.CompileEPL(toCompile, expression, false, null, _services, SelectClauseStreamSelectorEnum.ISTREAM_ONLY);

            return(raw.StreamSpecs[0].ViewSpecs[0].ObjectParameters[0]);
        }
Beispiel #4
0
        private EPStatement CreateEPLStmt(string eplStatement, string statementName, object userobject, int?optionalStatementId)
        {
            var statementSpec = EPAdministratorHelper.CompileEPL(eplStatement, eplStatement, true, statementName, _services, _defaultStreamSelector);
            var statement     = _services.StatementLifecycleSvc.CreateAndStart(statementSpec, eplStatement, false, statementName, userobject, null, optionalStatementId, null);

            Log.Debug(".createEPLStmt Statement created and started");
            return(statement);
        }
Beispiel #5
0
        public EPStatementObjectModel CompileEPL(string eplStatement)
        {
            var statementSpec = EPAdministratorHelper.CompileEPL(eplStatement, eplStatement, true, null, _services, _defaultStreamSelector);
            var unmapped      = StatementSpecMapper.Unmap(statementSpec);

            if (unmapped.SubstitutionParams.Count != 0)
            {
                throw new EPException(SUBS_PARAM_INVALID_USE);
            }
            return(unmapped.ObjectModel);
        }
Beispiel #6
0
        public EPPreparedStatement PreparePattern(string patternExpression)
        {
            var rawPattern = EPAdministratorHelper.CompilePattern(patternExpression, patternExpression, true, _services, SelectClauseStreamSelectorEnum.ISTREAM_ONLY);

            // map to object model thus finding all substitution parameters and their indexes
            var unmapped = StatementSpecMapper.Unmap(rawPattern);

            // the prepared statement is the object model plus a list of substitution parameters
            // map to specification will refuse any substitution parameters that are unfilled
            return(new EPPreparedStatementImpl(unmapped.ObjectModel, unmapped.SubstitutionParams, null));
        }
        public EPStatement CreateEPLStatementId(string eplStatement, string statementName, object userObject, int?optionalStatementId)
        {
            var defaultStreamSelector = _unisolatedServices.ConfigSnapshot.EngineDefaults.StreamSelectionConfig.DefaultStreamSelector.MapFromSODA();
            var statementSpec         = EPAdministratorHelper.CompileEPL(eplStatement, eplStatement, true, statementName, _unisolatedServices, defaultStreamSelector);
            var statement             = _unisolatedServices.StatementLifecycleSvc.CreateAndStart(statementSpec, eplStatement, false, statementName, userObject, _services, optionalStatementId, null);
            var stmtSpi = (EPStatementSPI)statement;

            stmtSpi.StatementContext.InternalEventEngineRouteDest = _isolatedRuntime;
            stmtSpi.ServiceIsolated = _isolatedServiceName;
            _statementNames.Add(stmtSpi.Name);
            return(statement);
        }
Beispiel #8
0
        public EPPreparedStatement PrepareEPL(string eplExpression)
        {
            // compile to specification
            var statementSpec = EPAdministratorHelper.CompileEPL(eplExpression, eplExpression, true, null, _services, _defaultStreamSelector);

            // map to object model thus finding all substitution parameters and their indexes
            var unmapped = StatementSpecMapper.Unmap(statementSpec);

            // the prepared statement is the object model plus a list of substitution parameters
            // map to specification will refuse any substitution parameters that are unfilled
            return(new EPPreparedStatementImpl(unmapped.ObjectModel, unmapped.SubstitutionParams, eplExpression));
        }
Beispiel #9
0
        public EPStatementObjectModel CompilePatternToSODAModel(string expression)
        {
            var rawPattern = EPAdministratorHelper.CompilePattern(expression, expression, true, _services, SelectClauseStreamSelectorEnum.ISTREAM_ONLY);

            return(MapRawToSODA(rawPattern));
        }
Beispiel #10
0
        public EvalFactoryNode CompilePatternToNode(string pattern)
        {
            var raw = EPAdministratorHelper.CompilePattern(pattern, pattern, false, _services, SelectClauseStreamSelectorEnum.ISTREAM_ONLY);

            return(((PatternStreamSpecRaw)raw.StreamSpecs[0]).EvalFactoryNode);
        }
Beispiel #11
0
 public StatementSpecRaw CompileEPLToRaw(string epl)
 {
     return(EPAdministratorHelper.CompileEPL(epl, epl, true, null, _services, _defaultStreamSelector));
 }
Beispiel #12
0
        private EPStatement CreatePatternStmt(string expression, string statementName, object userobject, int?optionalStatementId)
        {
            var rawPattern = EPAdministratorHelper.CompilePattern(expression, expression, true, _services, SelectClauseStreamSelectorEnum.ISTREAM_ONLY);

            return(_services.StatementLifecycleSvc.CreateAndStart(rawPattern, expression, true, statementName, userobject, null, optionalStatementId, null));
        }