use of org.wso2.siddhi.core.event.stream.converter.ConversionStreamEventChunk in project siddhi by wso2.
the class ComplexEventChunkTestCase method eventChunkRemoveTest2.
@Test
public void eventChunkRemoveTest2() {
StreamEvent streamEvent1 = new StreamEvent(0, 0, 3);
streamEvent1.setOutputData(new Object[] { "IBM", 700L, 1L });
StreamEvent streamEvent2 = new StreamEvent(0, 0, 3);
streamEvent2.setOutputData(new Object[] { "WSO2", 700L, 2L });
StreamEvent streamEvent3 = new StreamEvent(0, 0, 3);
streamEvent3.setOutputData(new Object[] { "WSO2", 700L, 3L });
StreamEvent streamEvent4 = new StreamEvent(0, 0, 3);
streamEvent4.setOutputData(new Object[] { "WSO2", 700L, 4L });
streamEvent1.setNext(streamEvent2);
streamEvent2.setNext(streamEvent3);
streamEvent3.setNext(streamEvent4);
StreamEventPool streamEventPool = new StreamEventPool(0, 0, 3, 5);
ConversionStreamEventChunk streamEventChunk = new ConversionStreamEventChunk(streamEventConverter, streamEventPool);
streamEventChunk.convertAndAssign(streamEvent1);
while (streamEventChunk.hasNext()) {
count++;
streamEventChunk.next();
if (count == 1 || count == 2) {
streamEventChunk.remove();
}
}
StreamEvent streamEvent = streamEventChunk.getFirst();
AssertJUnit.assertEquals(streamEvent3, streamEvent);
AssertJUnit.assertEquals(streamEvent4, streamEvent.getNext());
}
use of org.wso2.siddhi.core.event.stream.converter.ConversionStreamEventChunk in project siddhi by wso2.
the class Scheduler method setStreamEventPool.
public void setStreamEventPool(StreamEventPool streamEventPool) {
this.streamEventPool = streamEventPool;
streamEventChunk = new ConversionStreamEventChunk((StreamEventConverter) null, streamEventPool);
}
Aggregations