Search in sources :

Example 1 with OutputRateLimitNode

use of org.ballerinalang.model.tree.clauses.OutputRateLimitNode in project ballerina by ballerina-lang.

the class SiddhiQueryBuilder method visit.

@Override
public void visit(BLangStreamingQueryStatement streamingQueryStatement) {
    siddhiQuery.append("from ");
    StreamingInput streamingInput = streamingQueryStatement.getStreamingInput();
    if (streamingInput != null) {
        ((BLangStreamingInput) streamingInput).accept(this);
        siddhiQuery.append(" ").append(streamingInputClause);
    }
    PatternClause patternClause = streamingQueryStatement.getPatternClause();
    if (patternClause != null) {
        patternStreamingClause = new StringBuilder();
        ((BLangPatternClause) patternClause).accept(this);
        siddhiQuery.append(" ").append(patternStreamingClause);
    }
    JoinStreamingInput joinStreamingInput = streamingQueryStatement.getJoiningInput();
    if (joinStreamingInput != null) {
        ((BLangJoinStreamingInput) joinStreamingInput).accept(this);
        siddhiQuery.append(" ").append(joinStreamingInputClause);
    }
    SelectClauseNode selectClauseNode = streamingQueryStatement.getSelectClause();
    if (selectClauseNode != null) {
        ((BLangSelectClause) selectClauseNode).accept(this);
        siddhiQuery.append(" ").append(selectExprClause);
    }
    OrderByNode orderByNode = streamingQueryStatement.getOrderbyClause();
    if (orderByNode != null) {
        ((BLangOrderBy) orderByNode).accept(this);
        siddhiQuery.append(" ").append(orderByClause);
    }
    OutputRateLimitNode outputRateLimitNode = streamingQueryStatement.getOutputRateLimitNode();
    if (outputRateLimitNode != null) {
        ((BLangOutputRateLimit) outputRateLimitNode).accept(this);
        siddhiQuery.append(" ").append(outputRateLimitClause);
    }
    BLangStreamAction streamActionNode = (BLangStreamAction) streamingQueryStatement.getStreamingAction();
    if (streamActionNode != null) {
        streamActionNode.accept(this);
        siddhiQuery.append(" ").append(streamActionClause);
        siddhiQuery.append(" ; ");
    }
}
Also used : OutputRateLimitNode(org.ballerinalang.model.tree.clauses.OutputRateLimitNode) OrderByNode(org.ballerinalang.model.tree.clauses.OrderByNode) BLangPatternClause(org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternClause) SelectClauseNode(org.ballerinalang.model.tree.clauses.SelectClauseNode) PatternClause(org.ballerinalang.model.tree.clauses.PatternClause) BLangPatternClause(org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternClause) BLangOutputRateLimit(org.wso2.ballerinalang.compiler.tree.clauses.BLangOutputRateLimit) BLangPatternStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternStreamingInput) JoinStreamingInput(org.ballerinalang.model.tree.clauses.JoinStreamingInput) BLangStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput) BLangJoinStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput) StreamingInput(org.ballerinalang.model.tree.clauses.StreamingInput) BLangSelectClause(org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectClause) BLangJoinStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput) JoinStreamingInput(org.ballerinalang.model.tree.clauses.JoinStreamingInput) BLangJoinStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput) BLangStreamAction(org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamAction) BLangOrderBy(org.wso2.ballerinalang.compiler.tree.clauses.BLangOrderBy) BLangStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput)

Example 2 with OutputRateLimitNode

use of org.ballerinalang.model.tree.clauses.OutputRateLimitNode in project ballerina by ballerina-lang.

the class BLangPackageBuilder method startOutputRateLimitNode.

public void startOutputRateLimitNode(DiagnosticPos pos, Set<Whitespace> ws) {
    OutputRateLimitNode outputRateLimit = TreeBuilder.createOutputRateLimitNode();
    ((BLangOutputRateLimit) outputRateLimit).pos = pos;
    outputRateLimit.addWS(ws);
    this.outputRateLimitStack.push(outputRateLimit);
}
Also used : OutputRateLimitNode(org.ballerinalang.model.tree.clauses.OutputRateLimitNode)

Example 3 with OutputRateLimitNode

use of org.ballerinalang.model.tree.clauses.OutputRateLimitNode in project ballerina by ballerina-lang.

the class BLangPackageBuilder method endOutputRateLimitNode.

public void endOutputRateLimitNode(DiagnosticPos pos, Set<Whitespace> ws, boolean isSnapshotOutputRateLimit, boolean isEventBasedOutputRateLimit, boolean isFirst, boolean isLast, boolean isAll, String timeScale, String rateLimitValue) {
    OutputRateLimitNode outputRateLimit = this.outputRateLimitStack.peek();
    ((BLangOutputRateLimit) outputRateLimit).pos = pos;
    outputRateLimit.addWS(ws);
    outputRateLimit.setSnapshot(isSnapshotOutputRateLimit);
    outputRateLimit.setEventBasedRateLimit(isEventBasedOutputRateLimit);
    outputRateLimit.setOutputRateType(isFirst, isLast, isAll);
    outputRateLimit.setTimeScale(timeScale);
    outputRateLimit.setRateLimitValue(rateLimitValue);
}
Also used : OutputRateLimitNode(org.ballerinalang.model.tree.clauses.OutputRateLimitNode)

Aggregations

OutputRateLimitNode (org.ballerinalang.model.tree.clauses.OutputRateLimitNode)3 JoinStreamingInput (org.ballerinalang.model.tree.clauses.JoinStreamingInput)1 OrderByNode (org.ballerinalang.model.tree.clauses.OrderByNode)1 PatternClause (org.ballerinalang.model.tree.clauses.PatternClause)1 SelectClauseNode (org.ballerinalang.model.tree.clauses.SelectClauseNode)1 StreamingInput (org.ballerinalang.model.tree.clauses.StreamingInput)1 BLangJoinStreamingInput (org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput)1 BLangOrderBy (org.wso2.ballerinalang.compiler.tree.clauses.BLangOrderBy)1 BLangOutputRateLimit (org.wso2.ballerinalang.compiler.tree.clauses.BLangOutputRateLimit)1 BLangPatternClause (org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternClause)1 BLangPatternStreamingInput (org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternStreamingInput)1 BLangSelectClause (org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectClause)1 BLangStreamAction (org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamAction)1 BLangStreamingInput (org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput)1