Package com.espertech.esper.epl.spec

Examples of com.espertech.esper.epl.spec.FireAndForgetSpecUpdate


    public EPPreparedExecuteSingleStreamUpdate(StatementSpecCompiled statementSpec, EPServicesContext services, StatementContext statementContext) throws ExprValidationException {
        super(statementSpec, services, statementContext);
    }

    public EPPreparedExecuteSingleStreamExec getExecutor(FilterSpecCompiled filter, String aliasName) {
        FireAndForgetSpecUpdate updateSpec = (FireAndForgetSpecUpdate) statementSpec.getFireAndForgetSpec();

        StreamTypeServiceImpl assignmentTypeService = new StreamTypeServiceImpl(
                new EventType[] {processor.getNamedWindowType(), null, processor.getNamedWindowType()},
                new String[] {aliasName, "", EPStatementStartMethodOnTrigger.INITIAL_VALUE_STREAM_NAME},
                new boolean[] {true, true, true}, services.getEngineURI(), true);
        assignmentTypeService.setStreamZeroUnambigous(true);
        ExprEvaluatorContextStatement evaluatorContextStmt = new ExprEvaluatorContextStatement(statementContext);
        ExprValidationContext validationContext = new ExprValidationContext(assignmentTypeService, statementContext.getMethodResolutionService(), null, statementContext.getSchedulingService(), statementContext.getVariableService(), evaluatorContextStmt, statementContext.getEventAdapterService(), statementContext.getStatementName(), statementContext.getStatementId(), statementContext.getAnnotations(), statementContext.getContextDescriptor(), false);

        // validate update expressions
        try {
            for (OnTriggerSetAssignment assignment : updateSpec.getAssignments())
            {
                ExprNode validated = ExprNodeUtility.getValidatedSubtree(assignment.getExpression(), validationContext);
                assignment.setExpression(validated);
                EPStatementStartMethodHelperValidate.validateNoAggregations(validated, "Aggregation functions may not be used within an update-clause");
            }
        }
        catch (ExprValidationException e) {
            throw new EPException(e.getMessage(), e);
        }

        // make updater
        NamedWindowUpdateHelper updateHelper;
        try {
            updateHelper = NamedWindowUpdateHelper.make(processor.getNamedWindowName(),
                    (EventTypeSPI) processor.getNamedWindowType(), updateSpec.getAssignments(), aliasName, null);
        }
        catch (ExprValidationException e) {
            throw new EPException(e.getMessage(), e);
        }
View Full Code Here


    public EPPreparedExecuteSingleStreamUpdate(StatementSpecCompiled statementSpec, EPServicesContext services, StatementContext statementContext) throws ExprValidationException {
        super(statementSpec, services, statementContext);
    }

    public EPPreparedExecuteSingleStreamExec getExecutor(FilterSpecCompiled filter, String aliasName) {
        FireAndForgetSpecUpdate updateSpec = (FireAndForgetSpecUpdate) statementSpec.getFireAndForgetSpec();

        StreamTypeServiceImpl assignmentTypeService = new StreamTypeServiceImpl(
                new EventType[] {processor.getNamedWindowType(), null, processor.getNamedWindowType()},
                new String[] {aliasName, "", EPStatementStartMethodOnTrigger.INITIAL_VALUE_STREAM_NAME},
                new boolean[] {true, true, true}, services.getEngineURI(), true);
        assignmentTypeService.setStreamZeroUnambigous(true);
        ExprEvaluatorContextStatement evaluatorContextStmt = new ExprEvaluatorContextStatement(statementContext);
        ExprValidationContext validationContext = new ExprValidationContext(assignmentTypeService, statementContext.getMethodResolutionService(), null, statementContext.getSchedulingService(), statementContext.getVariableService(), evaluatorContextStmt, statementContext.getEventAdapterService(), statementContext.getStatementName(), statementContext.getStatementId(), statementContext.getAnnotations(), statementContext.getContextDescriptor(), false, false);

        // validate update expressions
        try {
            for (OnTriggerSetAssignment assignment : updateSpec.getAssignments())
            {
                ExprNode validated = ExprNodeUtility.getValidatedSubtree(ExprNodeOrigin.UPDATEASSIGN, assignment.getExpression(), validationContext);
                assignment.setExpression(validated);
                EPStatementStartMethodHelperValidate.validateNoAggregations(validated, "Aggregation functions may not be used within an update-clause");
            }
        }
        catch (ExprValidationException e) {
            throw new EPException(e.getMessage(), e);
        }

        // make updater
        NamedWindowUpdateHelper updateHelper;
        try {
            updateHelper = NamedWindowUpdateHelper.make(processor.getNamedWindowName(),
                    (EventTypeSPI) processor.getNamedWindowType(), updateSpec.getAssignments(), aliasName, null);
        }
        catch (ExprValidationException e) {
            throw new EPException(e.getMessage(), e);
        }
View Full Code Here

    public EPPreparedExecuteSingleStreamUpdate(StatementSpecCompiled statementSpec, EPServicesContext services, StatementContext statementContext) throws ExprValidationException {
        super(statementSpec, services, statementContext);
    }

    public EPPreparedExecuteSingleStreamExec getExecutor(FilterSpecCompiled filter, String aliasName) {
        FireAndForgetSpecUpdate updateSpec = (FireAndForgetSpecUpdate) statementSpec.getFireAndForgetSpec();

        StreamTypeServiceImpl assignmentTypeService = new StreamTypeServiceImpl(
                new EventType[] {processor.getNamedWindowType(), null, processor.getNamedWindowType()},
                new String[] {aliasName, "", EPStatementStartMethodOnTrigger.INITIAL_VALUE_STREAM_NAME},
                new boolean[] {true, true, true}, services.getEngineURI(), true);
        assignmentTypeService.setStreamZeroUnambigous(true);
        ExprEvaluatorContextStatement evaluatorContextStmt = new ExprEvaluatorContextStatement(statementContext);
        ExprValidationContext validationContext = new ExprValidationContext(assignmentTypeService, statementContext.getMethodResolutionService(), null, statementContext.getSchedulingService(), statementContext.getVariableService(), evaluatorContextStmt, statementContext.getEventAdapterService(), statementContext.getStatementName(), statementContext.getStatementId(), statementContext.getAnnotations(), statementContext.getContextDescriptor());

        // validate update expressions
        try {
            for (OnTriggerSetAssignment assignment : updateSpec.getAssignments())
            {
                ExprNode validated = ExprNodeUtility.getValidatedSubtree(assignment.getExpression(), validationContext);
                assignment.setExpression(validated);
                EPStatementStartMethodHelperValidate.validateNoAggregations(validated, "Aggregation functions may not be used within an update-clause");
            }
        }
        catch (ExprValidationException e) {
            throw new EPException(e.getMessage(), e);
        }

        // make updater
        NamedWindowUpdateHelper updateHelper;
        try {
            updateHelper = NamedWindowUpdateHelper.make(processor.getNamedWindowName(),
                    (EventTypeSPI) processor.getNamedWindowType(), updateSpec.getAssignments(), aliasName);
        }
        catch (ExprValidationException e) {
            throw new EPException(e.getMessage(), e);
        }
View Full Code Here

TOP

Related Classes of com.espertech.esper.epl.spec.FireAndForgetSpecUpdate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.