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)); }
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) { // Long.MIN_VALUE is currently assigned when no timestamp is present 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 start = TimeWindow.GetWindowStartWithOffset(timestamp, Offset, Size); yield return(new TimeWindow(start, start + Size)); }