When using Time windows in Esper, the old or removed events from the window is sent as output to UpdateListener attached to the statement. This is what should be occurring according to the document. But when I execute the code like below, it doesn't has any events in oldEvents even a new sliding window starts. It even happens with length window.
EPStatement statement1 = epAdmin.createEPL("select current_timestamp, sum(price)" + " from StockTick.win:time(5 sec)");
statement1.addListener(new UpdateListener() {
@Override
public void update(EventBean[] newEvents, EventBean[] oldEvents) {
System.out.println("sum \t" + newEvents[0].getUnderlying() + "\n");
System.out.println("old sum \t" + oldEvents[0].getUnderlying() + "\n");
}
});
When I send events into this query, the UpdateListener gets newEvents entering into windows in newEvents but when a event is removed from further sliding windows, it should be present in oldEvents but I did not get any events into it.
Is there any mistake I am doing while constructing listeners or statements.
By default engine does not output remove stream unless the select clause has "irstream".
select irstream current_timestamp, ....