Hopping Count Windows in StreamInsight

让人想犯罪 __ 提交于 2019-12-12 06:58:17

问题


I am developing a StreamInsight application which is supposed to compute a function of every N inputs i.e. if N=10 then I want to compute:

x_1, x_2, ..., x_10  ---> output_1
x_11, x_12, ..., x_20 ---> output_2

etc.

So what I want is a Hopping Window, except parameterized on Count rather than Time stamp.

I can't use a Count Window because those produce output every time the count changes.

I am looking for suggestions on how to get around the lack of a "Hopping Count Window".


回答1:


Take a look at using a User-defined Stream Operator. Events will come into your operator one by one which will make it easy to maintain a collection of the last N events/inputs. Once you've received your Nth event, do the computation, clear your events/inputs collection, and return the result.



来源:https://stackoverflow.com/questions/17144066/hopping-count-windows-in-streaminsight

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!