use of org.wso2.siddhi.core.config.SiddhiAppContext in project siddhi by wso2.
the class AllAggregationPerSnapshotOutputRateLimiter method start.
@Override
public void start() {
scheduler = SchedulerParser.parse(scheduledExecutorService, this, siddhiAppContext);
scheduler.setStreamEventPool(new StreamEventPool(0, 0, 0, 5));
scheduler.init(lockWrapper, queryName);
long currentTime = System.currentTimeMillis();
scheduledTime = currentTime + value;
scheduler.notifyAt(scheduledTime);
}
use of org.wso2.siddhi.core.config.SiddhiAppContext in project siddhi by wso2.
the class GroupByPerSnapshotOutputRateLimiter method start.
@Override
public void start() {
scheduler = SchedulerParser.parse(scheduledExecutorService, this, siddhiAppContext);
scheduler.setStreamEventPool(new StreamEventPool(0, 0, 0, 5));
scheduler.init(lockWrapper, queryName);
long currentTime = System.currentTimeMillis();
scheduledTime = currentTime + value;
scheduler.notifyAt(scheduledTime);
}
use of org.wso2.siddhi.core.config.SiddhiAppContext in project siddhi by wso2.
the class JoinStreamRuntime method clone.
@Override
public StreamRuntime clone(String key) {
JoinStreamRuntime joinStreamRuntime = new JoinStreamRuntime(siddhiAppContext, metaStateEvent);
for (SingleStreamRuntime singleStreamRuntime : singleStreamRuntimeList) {
joinStreamRuntime.addRuntime((SingleStreamRuntime) singleStreamRuntime.clone(key));
}
SingleStreamRuntime leftSingleStreamRuntime = joinStreamRuntime.getSingleStreamRuntimes().get(0);
SingleStreamRuntime rightSingleStreamRuntime = joinStreamRuntime.getSingleStreamRuntimes().get(1);
Processor lastLeftProcessor = leftSingleStreamRuntime.getProcessorChain();
while (!(lastLeftProcessor instanceof JoinProcessor)) {
lastLeftProcessor = lastLeftProcessor.getNextProcessor();
}
JoinProcessor leftPreJoinProcessor = (JoinProcessor) lastLeftProcessor;
WindowProcessor leftWindowProcessor = (WindowProcessor) leftPreJoinProcessor.getNextProcessor();
JoinProcessor leftPostJoinProcessor = (JoinProcessor) leftWindowProcessor.getNextProcessor();
Processor lastRightProcessor = rightSingleStreamRuntime.getProcessorChain();
while (!(lastRightProcessor instanceof JoinProcessor)) {
lastRightProcessor = lastRightProcessor.getNextProcessor();
}
JoinProcessor rightPreJoinProcessor = (JoinProcessor) lastRightProcessor;
WindowProcessor rightWindowProcessor = (WindowProcessor) rightPreJoinProcessor.getNextProcessor();
JoinProcessor rightPostJoinProcessor = (JoinProcessor) rightWindowProcessor.getNextProcessor();
rightPostJoinProcessor.setFindableProcessor((FindableProcessor) leftWindowProcessor);
rightPreJoinProcessor.setFindableProcessor((FindableProcessor) leftWindowProcessor);
leftPreJoinProcessor.setFindableProcessor((FindableProcessor) rightWindowProcessor);
leftPostJoinProcessor.setFindableProcessor((FindableProcessor) rightWindowProcessor);
return joinStreamRuntime;
}
use of org.wso2.siddhi.core.config.SiddhiAppContext in project siddhi by wso2.
the class AbsentLogicalPreStateProcessor method cloneProcessor.
@Override
public PreStateProcessor cloneProcessor(String key) {
AbsentLogicalPreStateProcessor logicalPreStateProcessor = new AbsentLogicalPreStateProcessor(logicalType, stateType, withinStates, waitingTimeConstant);
cloneProperties(logicalPreStateProcessor, key);
logicalPreStateProcessor.init(siddhiAppContext, queryName);
// Set the scheduler
siddhiAppContext.addEternalReferencedHolder(logicalPreStateProcessor);
EntryValveProcessor entryValveProcessor = new EntryValveProcessor(siddhiAppContext);
entryValveProcessor.setToLast(logicalPreStateProcessor);
Scheduler scheduler = SchedulerParser.parse(siddhiAppContext.getScheduledExecutorService(), entryValveProcessor, siddhiAppContext);
logicalPreStateProcessor.setScheduler(scheduler);
return logicalPreStateProcessor;
}
use of org.wso2.siddhi.core.config.SiddhiAppContext in project siddhi by wso2.
the class AbsentStreamPreStateProcessor method cloneProcessor.
@Override
public PreStateProcessor cloneProcessor(String key) {
AbsentStreamPreStateProcessor streamPreStateProcessor = new AbsentStreamPreStateProcessor(stateType, withinStates, waitingTimeConstant);
cloneProperties(streamPreStateProcessor, key);
streamPreStateProcessor.init(siddhiAppContext, queryName);
// Set the scheduler
siddhiAppContext.addEternalReferencedHolder(streamPreStateProcessor);
EntryValveProcessor entryValveProcessor = new EntryValveProcessor(siddhiAppContext);
entryValveProcessor.setToLast(streamPreStateProcessor);
Scheduler scheduler = SchedulerParser.parse(siddhiAppContext.getScheduledExecutorService(), entryValveProcessor, siddhiAppContext);
streamPreStateProcessor.setScheduler(scheduler);
return streamPreStateProcessor;
}
Aggregations