AdvanceTimePolicy and Point Event Streams In StreamInsight.
        Posted  
        
        on SQLIS
        
        See other posts from SQLIS
        
        
        
        Published on Mon, 02 Aug 2010 23:30:50 +0100
        Indexed on 
            2010/12/06
            16:59 UTC
        
        
        Read the original article
        Hit count: 333
        
StreamInsight
There are a number of ways to issues CTIs (Current Time Increments) into your StreamInsight streams but a quite useful way is to do it declaratively on your source factory like this
public AdapterAdvanceTimeSettings DeclareAdvanceTimeProperties<TPayload>(InputConfig configInfo, EventShape eventShape)      
{       
    return new AdapterAdvanceTimeSettings(       
        new AdvanceTimeGenerationSettings(configInfo.CtiFrequency, TimeSpan.FromTicks(-1)),       
        AdvanceTimePolicy.Adjust);       
}
This will issue a CTI after every event and allows no delay (for delayed events) by stamping the CTI with the timestamp of the last event minus 1 tick. The very last statement "AdvanceTimePolicy.Adjust" tells the adapter what to do with events that violate the policy (arrive late). From BOL
"Events that violate the inserted CTI are moved in time if their lifetime overlaps with the CTI timestamp. That is, the start timestamp of the events is set to the most recent CTI timestamp, which renders those events valid. If both start and end time of an event fall before the CTI timestamp, then the event is dropped."
This means that if you are using this method of inserting CTIs for a Point event stream and have specified "AdvanceTimePolicy.Adjust" for the violation policy, this setting will be ignored and instead it will use "AdvanceTimePolicy.Drop" because a Point event can never straddle a CTI.
© SQLIS or respective owner