Given a very basic LINQ Query, I wrote a helloworld sreaminsight application. basically I’d like to generate some raw data in the inputPointAdapter, and dump out the data by filtering to outputadapter.
where p.Price > 30
select p;
when I run the application and turn on the event flow debugger, I get the following dilemma. Events are generated and push to the CEP engine, but the OutputAdpater get no events. specifically, the OutputAdapter_Cleanse has no events.
the other two operations get no result.
Why?
the short answer is CTI(Current Time Increment)
CTI behaves like a Commit flag in SQL Server, Which tells the system It’s safe to process those data I marked . without CTI, all the data are waiting to be committed then it will be able to picked up by the OutputAdapter.
How to Inject the CTI in your adapter. either by Configuration or Enque the CTI events by yourself.
Here is one code snippet to tell the the Adapter to inject CTI Every time it get 10 events.
AdvanceTimeGenerationSettings gs = new AdvanceTimeGenerationSettings(10, TimeSpan.FromTicks(-1), true); AdvanceTimeSettings ats = new AdvanceTimeSettings(gs, null, AdvanceTimePolicy.Adjust); qb.BindProducer<Stock>("stockinput", input, config, EventShape.Point); |
Or eject in your InputAdapter
this.EnqueueCtiEvent(DateTime.Now); |
Then you fixed the problem
Hope it helps:)
No comments:
Post a Comment