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));
        }
Example #3
0
 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));
            }
        }
Example #5
0
        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));
            }
        }
Example #6
0
 public override IEnumerable <TimeWindow> AssignWindows(TElement element, long timestamp, WindowAssignerContext context)
 {
     throw new System.NotImplementedException();
 }
Example #7
0
        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));
        }
Example #8
0
 /// <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);