use of org.ballerinalang.siddhi.core.executor.ExpressionExecutor in project ballerina by ballerina-lang.
the class IncrementalDataAggregator method process.
private void process(StreamEvent streamEvent, BaseIncrementalValueStore baseIncrementalValueStore) {
List<ExpressionExecutor> expressionExecutors = baseIncrementalValueStore.getExpressionExecutors();
for (int i = 0; i < expressionExecutors.size(); i++) {
// keeping timestamp value location as null
ExpressionExecutor expressionExecutor = expressionExecutors.get(i);
baseIncrementalValueStore.setValue(expressionExecutor.execute(streamEvent), i + 1);
}
baseIncrementalValueStore.setProcessed(true);
}
use of org.ballerinalang.siddhi.core.executor.ExpressionExecutor in project ballerina by ballerina-lang.
the class IncrementalExecutor method process.
private void process(StreamEvent streamEvent, BaseIncrementalValueStore baseIncrementalValueStore) {
List<ExpressionExecutor> expressionExecutors = baseIncrementalValueStore.getExpressionExecutors();
for (int i = 0; i < expressionExecutors.size(); i++) {
// keeping timestamp value location as null
ExpressionExecutor expressionExecutor = expressionExecutors.get(i);
baseIncrementalValueStore.setValue(expressionExecutor.execute(streamEvent), i + 1);
}
baseIncrementalValueStore.setProcessed(true);
}
use of org.ballerinalang.siddhi.core.executor.ExpressionExecutor in project ballerina by ballerina-lang.
the class WindowWindowProcessor method cloneProcessor.
@Override
public Processor cloneProcessor(String key) {
try {
WindowWindowProcessor streamProcessor = new WindowWindowProcessor(window);
streamProcessor.inputDefinition = inputDefinition;
ExpressionExecutor[] innerExpressionExecutors = new ExpressionExecutor[attributeExpressionLength];
ExpressionExecutor[] attributeExpressionExecutors1 = this.attributeExpressionExecutors;
for (int i = 0; i < attributeExpressionLength; i++) {
innerExpressionExecutors[i] = attributeExpressionExecutors1[i].cloneExecutor(key);
}
streamProcessor.attributeExpressionExecutors = innerExpressionExecutors;
streamProcessor.attributeExpressionLength = attributeExpressionLength;
streamProcessor.additionalAttributes = additionalAttributes;
streamProcessor.complexEventPopulater = complexEventPopulater;
streamProcessor.init(inputDefinition, attributeExpressionExecutors, configReader, siddhiAppContext, outputExpectsExpiredEvents);
streamProcessor.start();
return streamProcessor;
} catch (Exception e) {
throw new SiddhiAppRuntimeException("Exception in cloning " + this.getClass().getCanonicalName(), e);
}
}
use of org.ballerinalang.siddhi.core.executor.ExpressionExecutor in project ballerina by ballerina-lang.
the class AttributeAggregator method cloneAggregator.
public AttributeAggregator cloneAggregator(String key) {
try {
AttributeAggregator attributeAggregator = this.getClass().newInstance();
ExpressionExecutor[] innerExpressionExecutors = new ExpressionExecutor[attributeSize];
for (int i = 0; i < attributeSize; i++) {
innerExpressionExecutors[i] = attributeExpressionExecutors[i].cloneExecutor(key);
}
attributeAggregator.elementId = elementId + "-" + key;
attributeAggregator.initAggregator(innerExpressionExecutors, siddhiAppContext, configReader);
return attributeAggregator;
} catch (Exception e) {
throw new SiddhiAppRuntimeException("Exception in cloning " + this.getClass().getCanonicalName(), e);
}
}
use of org.ballerinalang.siddhi.core.executor.ExpressionExecutor in project ballerina by ballerina-lang.
the class TableWindowProcessor method cloneProcessor.
@Override
public Processor cloneProcessor(String key) {
try {
TableWindowProcessor streamProcessor = new TableWindowProcessor(table);
streamProcessor.inputDefinition = inputDefinition;
ExpressionExecutor[] innerExpressionExecutors = new ExpressionExecutor[attributeExpressionLength];
ExpressionExecutor[] attributeExpressionExecutors1 = this.attributeExpressionExecutors;
for (int i = 0; i < attributeExpressionLength; i++) {
innerExpressionExecutors[i] = attributeExpressionExecutors1[i].cloneExecutor(key);
}
streamProcessor.attributeExpressionExecutors = innerExpressionExecutors;
streamProcessor.attributeExpressionLength = attributeExpressionLength;
streamProcessor.additionalAttributes = additionalAttributes;
streamProcessor.complexEventPopulater = complexEventPopulater;
streamProcessor.init(inputDefinition, attributeExpressionExecutors, configReader, siddhiAppContext, outputExpectsExpiredEvents);
streamProcessor.start();
return streamProcessor;
} catch (Exception e) {
throw new SiddhiAppRuntimeException("Exception in cloning " + this.getClass().getCanonicalName(), e);
}
}
Aggregations