简体   繁体   English

WSO2 CEP流计数功能重新启动

[英]WSO2 CEP Stream Count function restart

I have the following query: 我有以下查询:

from stream1
select count() as item insert into newStream;

Is it possible to restart the count() function of a stream? 是否可以重新启动流的count()函数?

If not, how can I circumvent this? 如果没有,我该如何规避? If possible. 如果可能的话。

If you use count() or any other aggregate function without a window, there's no way to reset the events that get accumulated within that aggregator. 如果您使用count()或任何其他没有窗口的聚合函数,则无法重置在该聚合器中累积的事件。 For example if you use a window like below, it will reset the counter after receiving 10 events. 例如,如果您使用如下所示的窗口,它将在收到10个事件后重置计数器。

from stream1#window.lengthBatch(10)
select count() as item insert into newStream;

However, If you need to reset the counter by sending an parameter to it, (ie count(bool reset) ) you may have to write your own custom aggregate function as described in the following documentation . 但是,如果您需要通过向其发送参数来重置计数器(即count(bool reset) ),则可能必须编写自己的自定义聚合函数,如以下文档所述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM