C# StreamInsight InputAdapter在多个查询之间共享事件
我在StreamInsight应用程序中观察到一个非常奇怪的事件处理过程。 有一个InputAdapter将流分为Tumbling窗口。然后我同时运行多个查询。他们应该使用来自同一流的所有相同TumblingWindow。我使用此代码定义窗口:C# StreamInsight InputAdapter在多个查询之间共享事件,c#,.net,streaminsight,C#,.net,Streaminsight,我在StreamInsight应用程序中观察到一个非常奇怪的事件处理过程。 有一个InputAdapter将流分为Tumbling窗口。然后我同时运行多个查询。他们应该使用来自同一流的所有相同TumblingWindow。我使用此代码定义窗口: var atgs = new AdvanceTimeGenerationSettings(config.Input.EventCount, TimeSpan.FromSeconds(config.Input.De
var atgs = new AdvanceTimeGenerationSettings(config.Input.EventCount,
TimeSpan.FromSeconds(config.Input.Delay), true);
var ats = new AdvanceTimeSettings(atgs, null, AdvanceTimePolicy.Adjust);
var dstream = CepStream<Dataclass>.Create("Data Input Stream", typeof (InAdapterFactory),
config.Input, EventShape.Point, ats);
var unfilteredtumbling = dstream.TumblingWindow(TimeSpan.FromSeconds(processinginterval),HoppingWindowOutputPolicy.ClipToWindowEnd);
如下所示,将每个端口绑定到各自的输出适配器:
Query querycount = count.ToQuery(myApplication, "Count Output Query", "Output Count",
typeof (OutputAdapterFactory), config.Output, EventShape.Point, StreamEventOrder.FullyOrdered);
Query querycount2 = count2.ToQuery(myApplication, "Count Output Query2", "Output Count2",
typeof (OutputAdapterFactory), config.Output, EventShape.Point, StreamEventOrder.FullyOrdered);
下面的链接显示了我收到的输出
不幸的是,我收到的结果并不是我所期望的。
看起来每个查询都有自己的inputadapter。消息被分发到两个输入适配器。尽管数据流只创建了一次,但工厂调用了两次。但是为什么和什么时候?这怎么可能?如果我只使用一个查询,那么一切都会很完美
我使用了这个链接的解释
我想应该是这样的
欢迎任何帮助
向乔致以最良好的问候看看马克·西姆斯的这篇文章:
Query querycount = count.ToQuery(myApplication, "Count Output Query", "Output Count",
typeof (OutputAdapterFactory), config.Output, EventShape.Point, StreamEventOrder.FullyOrdered);
Query querycount2 = count2.ToQuery(myApplication, "Count Output Query2", "Output Count2",
typeof (OutputAdapterFactory), config.Output, EventShape.Point, StreamEventOrder.FullyOrdered);