use of io.siddhi.core.event.ComplexEvent in project siddhi by wso2.
the class FindOnDemandQueryRuntime method generateResetComplexEventChunk.
private ComplexEventChunk<ComplexEvent> generateResetComplexEventChunk(MetaStreamEvent metaStreamEvent) {
StreamEvent streamEvent = new StreamEvent(metaStreamEvent.getBeforeWindowData().size(), metaStreamEvent.getOnAfterWindowData().size(), metaStreamEvent.getOutputData().size());
streamEvent.setType(ComplexEvent.Type.RESET);
StateEvent stateEvent = stateEventFactory.newInstance();
if (eventType == MetaStreamEvent.EventType.AGGREGATE) {
stateEvent.addEvent(1, streamEvent);
} else {
stateEvent.addEvent(0, streamEvent);
}
stateEvent.setType(ComplexEvent.Type.RESET);
ComplexEventChunk<ComplexEvent> complexEventChunk = new ComplexEventChunk<>();
complexEventChunk.add(stateEvent);
return complexEventChunk;
}
use of io.siddhi.core.event.ComplexEvent in project siddhi by wso2.
the class UpdateOnDemandQueryRuntime method generateResetComplexEventChunk.
private ComplexEventChunk<ComplexEvent> generateResetComplexEventChunk(MetaStreamEvent metaStreamEvent) {
StreamEvent streamEvent = new StreamEvent(metaStreamEvent.getBeforeWindowData().size(), metaStreamEvent.getOnAfterWindowData().size(), metaStreamEvent.getOutputData().size());
streamEvent.setType(ComplexEvent.Type.RESET);
StateEvent stateEvent = stateEventFactory.newInstance();
stateEvent.addEvent(0, streamEvent);
stateEvent.setType(ComplexEvent.Type.RESET);
ComplexEventChunk<ComplexEvent> complexEventChunk = new ComplexEventChunk<>();
complexEventChunk.add(stateEvent);
return complexEventChunk;
}
use of io.siddhi.core.event.ComplexEvent in project siddhi by wso2.
the class MultiProcessStreamReceiver method receive.
@Override
public void receive(ComplexEvent complexEvent) {
ComplexEvent aComplexEvent = complexEvent;
List<ReturnEventHolder> returnEventHolderList = new ArrayList<>(eventSequence.length);
synchronized (patternSyncObject) {
while (aComplexEvent != null) {
try {
multiProcessReturn.set(new ReturnEventHolder());
stabilizeStates(aComplexEvent.getTimestamp());
for (int anEventSequence : eventSequence) {
StreamEventConverter aStreamEventConverter = streamEventConverters[anEventSequence];
StreamEventFactory aStreamEventFactory = streamEventFactorys[anEventSequence];
StreamEvent newEvent = aStreamEventFactory.newInstance();
aStreamEventConverter.convertComplexEvent(aComplexEvent, newEvent);
process(anEventSequence, newEvent);
if (multiProcessReturn.get() != null && multiProcessReturn.get().complexEventChunk != null) {
returnEventHolderList.add(multiProcessReturn.get());
multiProcessReturn.set(new ReturnEventHolder());
}
}
} finally {
multiProcessReturn.set(null);
}
aComplexEvent = aComplexEvent.getNext();
}
for (ReturnEventHolder returnEventHolder : returnEventHolderList) {
outputRateLimiter.sendToCallBacks(returnEventHolder.complexEventChunk);
}
}
}
use of io.siddhi.core.event.ComplexEvent in project siddhi by wso2.
the class SelectOnDemandQueryRuntime method generateResetComplexEventChunk.
private ComplexEventChunk<ComplexEvent> generateResetComplexEventChunk(MetaStreamEvent metaStreamEvent) {
StreamEvent streamEvent = new StreamEvent(metaStreamEvent.getOutputData().size(), metaStreamEvent.getOnAfterWindowData().size(), metaStreamEvent.getOutputData().size());
streamEvent.setType(ComplexEvent.Type.RESET);
StateEvent stateEvent = stateEventFactory.newInstance();
if (eventType == MetaStreamEvent.EventType.AGGREGATE) {
stateEvent.addEvent(1, streamEvent);
} else {
stateEvent.addEvent(0, streamEvent);
}
stateEvent.setType(ComplexEvent.Type.RESET);
ComplexEventChunk<ComplexEvent> complexEventChunk = new ComplexEventChunk<>();
complexEventChunk.add(stateEvent);
return complexEventChunk;
}
use of io.siddhi.core.event.ComplexEvent in project siddhi by wso2.
the class UpdateOrInsertOnDemandQueryRuntime method generateResetComplexEventChunk.
private ComplexEventChunk<ComplexEvent> generateResetComplexEventChunk(MetaStreamEvent metaStreamEvent) {
StreamEvent streamEvent = new StreamEvent(metaStreamEvent.getBeforeWindowData().size(), metaStreamEvent.getOnAfterWindowData().size(), metaStreamEvent.getOutputData().size());
streamEvent.setType(ComplexEvent.Type.RESET);
StateEvent stateEvent = stateEventFactory.newInstance();
stateEvent.addEvent(0, streamEvent);
stateEvent.setType(ComplexEvent.Type.RESET);
ComplexEventChunk<ComplexEvent> complexEventChunk = new ComplexEventChunk<>();
complexEventChunk.add(stateEvent);
return complexEventChunk;
}
Aggregations