나는 time_length_batch에서 마지막 이벤트를 얻으려고하고 있지만이 방법은 손실 WRT입니다.시간과 길이가있는 Esper 윈도우의 마지막 이벤트
예를 들어 ... 인벤토리 이벤트가 있으며 사용 가능한 각 제품에서 최신 업데이트를 받고 싶습니다. 다음 쿼리는 주로 필요한 것을 대부분 제공합니다.
제외하고는 지난 이벤트에서 마지막 이벤트가 발생했습니다. 그 창에 대한 마지막 이벤트에만 관심이 있습니다. (2를 사용하면 결과를 쉽게 테스트 할 수 있습니다.)
결과적으로 UpdateListener에서 배열의 마지막 이벤트를 출력해야합니다. 그러나 나는이 사건들에 대한 필요성이 없기 때문에 궁극적으로 마지막 사건을 얻기 위해 찾고있는 가입자로 전환하고 싶어한다. 또한, 가입자는이 너무 대신 훨씬 더 성능이 좋은 있습니다 : 나는 시도
* Window received: 2 {product=A, inventory=-10}
** Explicit event received: A 20
** Explicit event received: A -10
...
public static class EveryListener implements UpdateListener {
public void update(EventBean[] newData, EventBean[] oldData) {
out.println("* Window received: " + " " +
newData.length + " " + newData[newData.length - 1].getUnderlying());
}
}
그냥
public void update(String product, int inventory) {
out.println("** Explicit event received: " + " " + product + " " + inventory);
}
하지만 결과는
SELECT product, inventory FROM
InventoryEvents.std:groupwin(name).win:time_length_batch(1 min, 1000)
.std:win:lastevent();
하지만 그건 expec을주지 않습니다. 테드 결과.
그룹화 된 창의 마지막 이벤트는 어떻게 만듭니 까?