none
TimeSensitive UDO

    Question

  • Hi,

    I'm using a time-sensitive UDO. Based on the input events I want to be able to generate one/many output events and I want to set the start time of the output events myself (that's why I'm using time-sensitive UDO). However, no matter what I do inside the UDO, the window output policy will overwrite the timestamps of the output events. If the window output policy is going to overwrite these timestamps, what's the use of using a time-sensitive UDO?

    Tuesday, January 21, 2014 8:34 PM

All replies

  • I am changing the StartTime and getting the output changed, here is  a sample:


    public override IEnumerable<IntervalEvent<TPayload>> GenerateOutput(IEnumerable<IntervalEvent<TPayload>> events, WindowDescriptor win) 
    {
    var cacheList = new List<IntervalEvent<TPayload>>();
    foreach (var eventItem in events)
    {
    bool matched = false;
    foreach (var cacheOrder in cacheList)
    {
    if (eventItem.StartTime.Subtract(cacheOrder.StartTime) < _globalConfig.Limit 
    && eventItem.Payload.Equals(cacheOrder.Payload)
    )
    {
    matched = true;
    }
    }

    if (!matched)
    {
    // I am changing the Start Time for demo, the output reflects the change
    eventItem.StartTime= eventItem.StartTime.AddMinutes(1);
    cacheList.Add(eventItem);
    }
    }
    return cacheList;
    }

    Thursday, January 23, 2014 9:35 PM
  • Can we get an idea of the context where you are calling the UDO? Also, what do your CTIs look like? And the UDO will need to output events that are within the CTI Span. Since your UDO doesn't get the CTIs, you can't adjust those, so you can't adjust your span. If that's what you need to do ... manipulate the entire timeline ... a subject may work best for you as you'll get all of the events (CTIs and Inserts) and can adjust them appropriately.


    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.

    Friday, February 14, 2014 3:26 PM