use of org.ballerinalang.siddhi.query.api.execution.query.output.ratelimit.OutputRate in project ballerina by ballerina-lang.
the class SiddhiQLBaseVisitorImpl method visitOutput_rate.
/**
* {@inheritDoc}
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*
* @param ctx
*/
@Override
public OutputRate visitOutput_rate(@NotNull SiddhiQLParser.Output_rateContext ctx) {
if (ctx.SNAPSHOT() != null) {
SnapshotOutputRate snapshotOutputRate = new SnapshotOutputRate(((TimeConstant) visit(ctx.time_value())).value());
populateQueryContext(snapshotOutputRate, ctx);
return snapshotOutputRate;
} else if (ctx.time_value() != null) {
TimeOutputRate timeOutputRate = new TimeOutputRate(((TimeConstant) visit(ctx.time_value())).value());
if (ctx.output_rate_type() != null) {
timeOutputRate.output((OutputRate.Type) visit(ctx.output_rate_type()));
}
populateQueryContext(timeOutputRate, ctx);
return timeOutputRate;
} else if (ctx.EVENTS() != null) {
EventOutputRate eventOutputRate = new EventOutputRate(Integer.parseInt(ctx.INT_LITERAL().getText()));
if (ctx.output_rate_type() != null) {
eventOutputRate.output((OutputRate.Type) visit(ctx.output_rate_type()));
}
populateQueryContext(eventOutputRate, ctx);
return eventOutputRate;
} else {
throw newSiddhiParserException(ctx);
}
}
Aggregations