use of io.siddhi.core.event.stream.StreamEventFactory in project siddhi by wso2.
the class AggregationGroupByWindowedPerSnapshotOutputRateLimiter method init.
@Override
protected StateFactory<AggregationRateLimiterState> init() {
this.scheduler = SchedulerParser.parse(this, siddhiQueryContext);
this.scheduler.setStreamEventFactory(new StreamEventFactory(0, 0, 0));
this.scheduler.init(lockWrapper, siddhiQueryContext.getName());
return () -> new AggregationGroupByRateLimiterState();
}
use of io.siddhi.core.event.stream.StreamEventFactory in project siddhi by wso2.
the class AllAggregationGroupByWindowedPerSnapshotOutputRateLimiter method init.
@Override
protected StateFactory<RateLimiterState> init() {
this.scheduler = SchedulerParser.parse(this, siddhiQueryContext);
this.scheduler.setStreamEventFactory(new StreamEventFactory(0, 0, 0));
this.scheduler.init(lockWrapper, siddhiQueryContext.getName());
return () -> new RateLimiterState();
}
use of io.siddhi.core.event.stream.StreamEventFactory in project siddhi by wso2.
the class GroupByPerSnapshotOutputRateLimiter method init.
@Override
protected StateFactory<RateLimiterState> init() {
this.scheduler = SchedulerParser.parse(this, siddhiQueryContext);
this.scheduler.setStreamEventFactory(new StreamEventFactory(0, 0, 0));
this.scheduler.init(lockWrapper, siddhiQueryContext.getName());
return () -> new RateLimiterState();
}
use of io.siddhi.core.event.stream.StreamEventFactory in project siddhi by wso2.
the class WrappedSnapshotOutputRateLimiter method init.
public void init(int outPutAttributeSize, List<AttributeProcessor> attributeProcessorList, MetaComplexEvent metaComplexEvent) {
for (AttributeProcessor attributeProcessor : attributeProcessorList) {
if (attributeProcessor.getExpressionExecutor() instanceof AttributeAggregatorExecutor<?>) {
aggregateAttributePositionList.add(attributeProcessor.getOutputPosition());
}
}
if (windowed) {
if (groupBy) {
if (outPutAttributeSize == aggregateAttributePositionList.size()) {
// All Aggregation
outputRateLimiter = new AllAggregationGroupByWindowedPerSnapshotOutputRateLimiter(value, this, groupBy, siddhiQueryContext);
} else if (aggregateAttributePositionList.size() > 0) {
// Some Aggregation
outputRateLimiter = new AggregationGroupByWindowedPerSnapshotOutputRateLimiter(value, aggregateAttributePositionList, this, groupBy, siddhiQueryContext);
} else {
// No aggregation
// GroupBy is same as Non GroupBy
outputRateLimiter = new WindowedPerSnapshotOutputRateLimiter(value, this, groupBy, siddhiQueryContext);
}
} else {
if (outPutAttributeSize == aggregateAttributePositionList.size()) {
// All Aggregation
outputRateLimiter = new AllAggregationPerSnapshotOutputRateLimiter(value, this, groupBy, siddhiQueryContext);
} else if (aggregateAttributePositionList.size() > 0) {
// Some Aggregation
outputRateLimiter = new AggregationWindowedPerSnapshotOutputRateLimiter(value, aggregateAttributePositionList, this, groupBy, siddhiQueryContext);
} else {
// No aggregation
outputRateLimiter = new WindowedPerSnapshotOutputRateLimiter(value, this, groupBy, siddhiQueryContext);
}
}
} else {
if (groupBy) {
outputRateLimiter = new GroupByPerSnapshotOutputRateLimiter(value, this, groupBy, siddhiQueryContext);
} else {
outputRateLimiter = new PerSnapshotOutputRateLimiter(value, this, groupBy, siddhiQueryContext);
}
}
if (metaComplexEvent instanceof MetaStateEvent) {
StateEventFactory stateEventFactory = new StateEventFactory((MetaStateEvent) metaComplexEvent);
outputRateLimiter.setStateEventCloner(new StateEventCloner((MetaStateEvent) metaComplexEvent, stateEventFactory));
} else {
StreamEventFactory streamEventFactory = new StreamEventFactory((MetaStreamEvent) metaComplexEvent);
outputRateLimiter.setStreamEventCloner(new StreamEventCloner((MetaStreamEvent) metaComplexEvent, streamEventFactory));
}
}
use of io.siddhi.core.event.stream.StreamEventFactory in project siddhi by wso2.
the class AggregationWindowedPerSnapshotOutputRateLimiter method init.
@Override
protected StateFactory<AggregationRateLimiterState> init() {
this.scheduler = SchedulerParser.parse(this, siddhiQueryContext);
this.scheduler.setStreamEventFactory(new StreamEventFactory(0, 0, 0));
this.scheduler.init(lockWrapper, siddhiQueryContext.getName());
return () -> new AggregationRateLimiterState();
}
Aggregations