0

StreamInsight アプリケーションで、非常に奇妙なイベント処理が見られます。Stream を TumblingWindows に分割する 1 つの InputAdapter があります。次に、複数のクエリを同時に実行しています。同じ Stream からすべて同じ TumblingWindows を使用する必要があります。このコードを使用してウィンドウを定義しました。

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);

次に、このストリームから 2 つの異なるクエリを実行します。このコードの使用:

var count = from row in unfilteredtumbling 
                         select new
                         {
                             value= row.Count(),
                             qind = 10,
                             stat = "Calculated Count"

                         };
var count2 = from row in unfilteredtumbling 
                         select new
                         {
                             value= row.Count()*2,
                             qind = 10,
                             stat = "Calculated Count2"
                         };

次のように、それぞれを独自の OutputAdapter にバインドします。

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);

次のリンクは、私が受け取った出力を示しています。

https://dl.dropboxusercontent.com/u/15482726/outputissue.jpg

残念ながら、私が受け取る出力は、私が期待するものではありません。すべてのクエリが独自の入力アダプターを取得するようです。そして、メッセージは両方の入力アダプターに配布されます。dstream は 1 回しか作成されませんが、ファクトリは 2 回呼び出されます。しかし、なぜ、いつ?そんなことがあるものか?クエリを 1 つだけ使用すると、すべてが完璧に機能します。

このリンクの説明を使用しましたhttp://technet.microsoft.com/en-us/library/ff518536.aspx そのように動作するはずだと思いました。

どんな助けでも大歓迎です。

よろしくジョー

4

1 に答える 1

1

Mark Simms の投稿 ( http://blogs.msdn.com/b/appfabriccat/archive/2010/11/22/streaminsight-understanding-dynamic-query-composition.aspx ) をご覧ください。

于 2014-05-20T16:22:44.237 に答える