在Esper中强制输出
我有一个非实时 Esper 配置,我在其中提供从文件读取的流。我正在尝试创建一个表达式来计算整个流的统计数据并在最后输出一个值。例如,Esper 具有强制视图每 X 秒输出一次的语义,但是当您知道没有更多事件可提供时,是否有要求视图或引擎“刷新”输出的语义。
I have a non real time Esper configuration where I feed a stream that I read from a file. I'm trying to create an expression that computes a statistic over the entire stream and outputs one value at the very end. Esper has semantics for forcing a view to output every X seconds, for instance, but is there a semantic for asking the view or the engine to "flush" the output when you know there are no more events to feed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实证明,至少有一种方法可以做到这一点,即使用带有变量触发器的输出子句。
表达式将是:
OutputSummary 变量将像这样初始化:
当您准备好刷新时,将变量设置为 true,如下所示:
有必要发送另一个时间事件来强制表达式求值。
Turns out that at least one way to do this is to use the output clause with a variable trigger.
The expression would be:
The OutputSummary variable would be initialized like so:
When you're ready to flush, set the variable to true like so:
It's necessary to send another time event to force the expression to evaluate.
当输出需要每 60 秒时,则表达式将为:
当输出需要每 10000 个事件时,表达式将为:
When output requires at every 60 sec then the expression would be:
and when the output requires at every 10000 events then the expression would be: