0

我有一个元组:

public class mytuple
{
    private int status;

    private int userid;
    private int location;

    private int count1;
    private int count2;

    // corresponding getter settrs included.
}

我创建了两个 esper 语句 EPL:

select mytuple.userid as userid, sum(count1) as count1, sum(count2) as count2
from eventStream where mytuple.status = -1
group by userid, location;

and another EPL statement:

select mytuple.userid as userid, sum(count1) as count1, sum(count2) as count2
from eventStream where mytuple.status = 1
group by userid, location;

事件流在配置中注册。

我面临的问题是,在发送的两个事件中.. 一个作为状态 = -1,另一个作为状态 = +1,我在第一个 EPL 语句中得到 +2 的增量计数。

但是,如果只发送一个事件,则流可以完美运行。有什么我在这里想念的吗?

假设我对创建的 Esper 视图有一个单独的侦听器。

4

1 回答 1

0

最好由 Esper 用户邮件列表运行,如http://esper.codehaus.org/about/esper/mailinglist.html中所述 创建一个小测试用例并将其发送,确保使用最新版本。

对于过滤,将条件放在括号中,这是首选符号:

选择 ....from eventStream(mytuple.status = 1) ....

于 2013-08-12T14:26:52.833 回答