2016-11-09 6 views
0

Esper에서 시간 윈도우를 사용하면 윈도우의 이전 이벤트 또는 제거 된 이벤트가 명령문에 첨부 된 UpdateListener에 대한 출력으로 보내집니다. 이것은 문서에 따라 일어나는 일입니다. 그러나 아래 코드를 실행하면 새로운 슬라이딩 윈도우가 시작 되어도 oldEvents에 이벤트가 없습니다. 길이 창이있는 경우에도 발생합니다. 나는이 쿼리에 이벤트를 전송Esper. 리스너에서 이벤트 제거를 수신 할 수 없습니다.

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"); 
     } 
    }); 

는 UpdateListener는 newEvents가 newEvents에 창에 입력 만 이벤트가 더 슬라이딩 창에서 제거 될 때, 그것은 oldEvents에 존재해야하지만 그것으로 이벤트를하지 않았다 도착 .

청취자 나 문장을 만드는 동안 내가하고있는 실수가 있습니까?

답변

0

select 절에 "irstream"이 없으면 기본적으로 엔진에서 스트림을 제거하지 않습니다.

select irstream current_timestamp, ....