use of org.ballerinalang.siddhi.core.event.ComplexEvent in project ballerina by ballerina-lang.
the class StreamJunction method sendEvent.
public void sendEvent(ComplexEvent complexEvent) {
if (isTraceEnabled) {
log.trace("Event is received by streamJunction " + this);
}
ComplexEvent complexEventList = complexEvent;
if (disruptor != null) {
while (complexEventList != null) {
if (throughputTracker != null && siddhiAppContext.isStatsEnabled()) {
throughputTracker.eventIn();
}
long sequenceNo = ringBuffer.next();
try {
Event existingEvent = ringBuffer.get(sequenceNo);
existingEvent.copyFrom(complexEventList);
} finally {
ringBuffer.publish(sequenceNo);
}
complexEventList = complexEventList.getNext();
}
} else {
if (throughputTracker != null && siddhiAppContext.isStatsEnabled()) {
int messageCount = 0;
while (complexEventList != null) {
messageCount++;
complexEventList = complexEventList.getNext();
}
throughputTracker.eventsIn(messageCount);
}
for (Receiver receiver : receivers) {
receiver.receive(complexEvent);
}
}
}
use of org.ballerinalang.siddhi.core.event.ComplexEvent in project ballerina by ballerina-lang.
the class IndexEventHolder method add.
@Override
public void add(ComplexEventChunk<StreamEvent> addingEventChunk) {
addingEventChunk.reset();
while (addingEventChunk.hasNext()) {
ComplexEvent complexEvent = addingEventChunk.next();
StreamEvent streamEvent = tableStreamEventPool.borrowEvent();
eventConverter.convertComplexEvent(complexEvent, streamEvent);
add(streamEvent);
}
}
use of org.ballerinalang.siddhi.core.event.ComplexEvent in project ballerina by ballerina-lang.
the class ListEventHolder method add.
@Override
public void add(ComplexEventChunk<StreamEvent> addingEventChunk) {
addingEventChunk.reset();
while (addingEventChunk.hasNext()) {
ComplexEvent complexEvent = addingEventChunk.next();
StreamEvent streamEvent = tableStreamEventPool.borrowEvent();
eventConverter.convertComplexEvent(complexEvent, streamEvent);
this.add(streamEvent);
}
}
Aggregations