AdvanceTimeImportSettings in StreamInsight 2.1

Respondido AdvanceTimeImportSettings in StreamInsight 2.1

  • Monday, July 23, 2012 9:01 PM
     
      Has Code

    How to import settings from IQStreambale<Payload> stream?

    var inputStream = myApp.DefineStreamable<GeneratedEvent>(typeof(GeneratorFactory), generatorConfig, EventShape.Point, null);

    I can't pass name in DefineStremable method. Earlier version of streaminsight we pass name when we create the stream & supply the same name when we import it. How does that work with 2.1?


All Replies

  • Monday, July 30, 2012 1:42 AM
     
     

    anyone can help?

  • Monday, July 30, 2012 5:04 PM
     
     Answered Has Code

    I'm working on a code sample and plan on blogging about it.

    Here's what I wound up doing:

    1.) Reference source as an IObservable. NOT defined with DefineObservable.

    2.) Data source as IQStreamable. Get an IQbservable from the IQStreamable data stream. Like so:

    var ctis = dataSource.Where(e => e.IsCti == true).Select(e => e.Start);

    3.) Create a "MergeSubject" that takes the IObservable reference source and the IQbservable CTI stream and merges them together into a single IObservable.

    4.) Define the merged observables with DefineObservable/ToStreamable.

    Chirag is actually on my team and we've been working on it together here @ the office. I apologize for not posting a response earlier, yaphets.


    DevBiker (aka J Sawyer)
    Microsoft MVP - Sql Server (StreamInsight)


    Ruminations of J.net


    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

  • Tuesday, July 31, 2012 7:59 PM
     
     Answered
    Code sample and blog entry posted: http://www.devbiker.net/post/Importing-CTIs-with-IQStreamableIQbservable-in-StreamInsight-21.aspx

    DevBiker (aka J Sawyer)
    Microsoft MVP - Sql Server (StreamInsight)


    Ruminations of J.net


    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

    • Marked As Answer by Chirag Pro Thursday, August 02, 2012 8:01 PM
    •  
  • Thursday, December 13, 2012 11:48 AM
     
     

    thanks a mil for this! I have started looking at your example and reading up on subjects and you are right, they offer much more.  Just a quick question - i have written quite a few adapters (<2.1) prior to the SI upgrade - do you know if subjects offer the same level of tolerance/ performance.  Also, existing queries created from slow moving reference streams, can they be converted to work with Subjects ie. ToPointObservable or is it a rewrite?

    // older query passed in re < 2.1

    varpurchaseStream = purchaseQueryDQC.ToStream<CepTradeAccountEvent>(ats);

    varpurchaseSource = purchaseStream.ToPointObservable();

    varpurchases = from p in purchaseSource where p > 50 select p;

    var purchaseSink = cepApplication.DefineObserver(() => Observer.Create<PurchaseEvent>(x => Console.WriteLine("Purchase Orders {0}", x.Id)));

    ... etc

    Regards

    Craig

  • Thursday, December 13, 2012 12:54 PM
     
     

    From a performance standpoint, yes, they perform comparably to adapters. We've not seen any performance issues with them at all. In some respects, because of the way that processes allow for better sharing of operators, I would suspect that, in a complex system, you'd wind up with somewhat better throughput than if you were using pre-2.1 queries and DQC. The new API has full support for checkpointing (for resiliency) and, because you don't have the limitation where checkpointing doesn't work with DQC, you can use it with complex query trees.

    You can use your adapters natively in the 2.1 model. DefineStreamable and DefineStreamableSink both have overloads that take the adapter-centric arguments. If you look at some of my recent blog articles, you'll also see a pattern where your data sources can natively expose both IObservable and adapters from the same baseline code.


    DevBiker (aka J Sawyer)
    Microsoft MVP - Sql Server (StreamInsight)


    Ruminations of J.net


    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.