public override IEnumerable <TimeWindow> AssignWindows(TElement element, long timestamp, WindowAssignerContext context) { var processingTime = context.CurrentProcessingTime; yield return(new TimeWindow(processingTime, processingTime + SessionTimeout)); }
public override IEnumerable <TimeWindow> AssignWindows(TElement element, long timestamp, WindowAssignerContext context) { var currentProcessingTime = context.CurrentProcessingTime; var sessionTimeout = SessionWindowTimeGapExtractor.Extract(element); if (sessionTimeout <= 0) { throw new IllegalArgumentException("Dynamic session time gap must satisfy 0 < gap"); } yield return(new TimeWindow(currentProcessingTime, currentProcessingTime + sessionTimeout)); }
public override IEnumerable <TimeWindow> AssignWindows(TElement element, long timestamp, WindowAssignerContext context) { yield return(new TimeWindow(timestamp, timestamp + SessionTimeout)); }
public override IEnumerable <TimeWindow> AssignWindows(TElement element, long timestamp, WindowAssignerContext context) { if (timestamp <= long.MinValue) { throw new RuntimeException("Record has Long.MIN_VALUE timestamp (= no timestamp marker). " + "Is the time characteristic set to 'ProcessingTime', or did you forget to call " + "'DataStream.assignTimestampsAndWatermarks(...)'?"); } var lastStart = TimeWindow.GetWindowStartWithOffset(timestamp, Offset, Slide); for (var start = lastStart; start > timestamp - Size; start -= Slide) { yield return(new TimeWindow(start, start + Size)); } }
public override IEnumerable <TimeWindow> AssignWindows(TElement element, long timestamp, WindowAssignerContext context) { timestamp = context.CurrentProcessingTime; var lastStart = TimeWindow.GetWindowStartWithOffset(timestamp, Offset, Slide); for (var start = lastStart; start > timestamp - Size; start -= Slide) { yield return(new TimeWindow(start, start + Size)); } }
public override IEnumerable <TimeWindow> AssignWindows(TElement element, long timestamp, WindowAssignerContext context) { throw new System.NotImplementedException(); }
public override IEnumerable <TimeWindow> AssignWindows(TElement element, long timestamp, WindowAssignerContext context) { var now = context.CurrentProcessingTime; var start = TimeWindow.GetWindowStartWithOffset(now, Offset, Size); yield return(new TimeWindow(start, start + Size)); }
/// <summary> /// Gets a Collection of windows that should be assigned to the element. /// </summary> /// <param name="element">The element to which windows should be assigned.</param> /// <param name="timestamp">The timestamp of the element.</param> /// <param name="context">The <see cref="WindowAssignerContext"/> in which the assigner operates.</param> public abstract IEnumerable <TWindow> AssignWindows(TElement element, long timestamp, WindowAssignerContext context);