Exemplo n.º 1
0
 public override void Clear(TWindow window, IWindowTriggerContext ctx) => NestedTrigger.Clear(window, ctx);
Exemplo n.º 2
0
 public override void Clear(TWindow window, IWindowTriggerContext ctx) => ctx.GetPartitionedState(_stateDesc).Clear();
Exemplo n.º 3
0
        public override WindowTriggerResult OnElement(TElement element, long timestamp, TWindow window, IWindowTriggerContext ctx)
        {
            var count = ctx.GetPartitionedState(_stateDesc);

            count.Add(1L);

            if (count.Get() < Limit)
            {
                return(WindowTriggerResult.Continue);
            }

            count.Clear();
            return(WindowTriggerResult.Fire);
        }
 public override WindowTriggerResult OnEventTime(long time, TimeWindow window, IWindowTriggerContext ctx) =>
 WindowTriggerResult.Continue;
 public override WindowTriggerResult OnProcessingTime(long time, TWindow window, IWindowTriggerContext ctx)
 {
     throw new NotImplementedException();
 }
 public override WindowTriggerResult OnElement(TElement element, long timestamp, TWindow window, IWindowTriggerContext ctx)
 {
     throw new System.NotImplementedException();
 }
 public override WindowTriggerResult OnEventTime(long time, TWindow window, IWindowTriggerContext ctx)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 8
0
 /// <summary>
 /// Called when an event-time timer that was set using the trigger context fires.
 /// Note: This method is not called in case the window does not contain any elements.
 /// </summary>
 /// <param name="time">The timestamp at which the timer fired.</param>
 /// <param name="window">The window for which the timer fired.</param>
 /// <param name="ctx">A context object that can be used to register timer callbacks.</param>
 /// <returns>the triggered result.</returns>
 public abstract WindowTriggerResult OnEventTime(long time, TWindow window, IWindowTriggerContext ctx);
Exemplo n.º 9
0
 /// <summary>
 /// Clears any state that the trigger might still hold for the given window. This is called when a window is purged.
 /// </summary>
 /// <param name="window"></param>
 /// <param name="ctx"></param>
 public abstract void Clear(TWindow window, IWindowTriggerContext ctx);
Exemplo n.º 10
0
 /// <summary>
 /// Called for every element that gets added to a pane. The result of this will determine whether the pane is evaluated to emit results.
 /// This method is not called in case the window does not contain any elements.
 /// </summary>
 /// <param name="element">The element that arrived.</param>
 /// <param name="timestamp">The timestamp of the element that arrived.</param>
 /// <param name="window">The window to which the element is being added.</param>
 /// <param name="ctx">A context object that can be used to register timer callbacks.</param>
 /// <returns>the triggered result.</returns>
 public abstract WindowTriggerResult OnElement(TElement element, long timestamp, TWindow window, IWindowTriggerContext ctx);
Exemplo n.º 11
0
 /// <summary>
 /// Called when a processing-time timer that was set using the trigger context fires.
 /// This method is not called in case the window does not contain any elements.
 /// </summary>
 /// <param name="time">The timestamp at which the timer fired.</param>
 /// <param name="window">The window for which the timer fired.</param>
 /// <param name="ctx">A context object that can be used to register timer callbacks.</param>
 /// <returns>the triggered result.</returns>
 public abstract WindowTriggerResult OnProcessingTime(long time, TWindow window, IWindowTriggerContext ctx);
Exemplo n.º 12
0
 public override WindowTriggerResult OnEventTime(long time, TimeWindow window, IWindowTriggerContext ctx) =>
 time == window.MaxTimestamp ? WindowTriggerResult.Fire : WindowTriggerResult.Continue;
Exemplo n.º 13
0
        public override WindowTriggerResult OnElement(TElement element, long timestamp, TimeWindow window, IWindowTriggerContext ctx)
        {
            // if the watermark is already past the window fire immediately
            if (window.MaxTimestamp <= ctx.CurrentWatermark)
            {
                return(WindowTriggerResult.Fire);
            }

            ctx.RegisterEventTimeTimer(window.MaxTimestamp);
            return(WindowTriggerResult.Continue);
        }
Exemplo n.º 14
0
 public override void Clear(TimeWindow window, IWindowTriggerContext ctx) =>
 ctx.DeleteEventTimeTimer(window.MaxTimestamp);
Exemplo n.º 15
0
        public override WindowTriggerResult OnElement(TElement element, long timestamp, TWindow window, IWindowTriggerContext ctx)
        {
            var triggerResult = NestedTrigger.OnElement(element, timestamp, window, ctx);

            return(triggerResult.IsFire ? WindowTriggerResult.FireAndPurge : triggerResult);
        }
Exemplo n.º 16
0
 public override WindowTriggerResult OnElement(TElement element, long timestamp, GlobalWindow window, IWindowTriggerContext ctx)
 {
     return(WindowTriggerResult.Continue);
 }
Exemplo n.º 17
0
        public override WindowTriggerResult OnProcessingTime(long time, TWindow window, IWindowTriggerContext ctx)
        {
            var triggerResult = NestedTrigger.OnProcessingTime(time, window, ctx);

            return(triggerResult.IsFire ? WindowTriggerResult.FireAndPurge : triggerResult);
        }
Exemplo n.º 18
0
 public override WindowTriggerResult OnEventTime(long time, GlobalWindow window, IWindowTriggerContext ctx)
 {
     return(WindowTriggerResult.Continue);
 }
 public override WindowTriggerResult OnProcessingTime(long time, TWindow window, IWindowTriggerContext ctx) => WindowTriggerResult.Continue;
Exemplo n.º 20
0
        public override WindowTriggerResult OnElement(TElement element, long timestamp, TWindow window, IWindowTriggerContext ctx)
        {
            var lastElementState = ctx.GetPartitionedState(_stateDesc);

            if (lastElementState.Value == null)
            {
                lastElementState.Value = element;
                return(WindowTriggerResult.Continue);
            }

            if (DeltaFunction.GetDelta(lastElementState.Value, element) <= Threshold)
            {
                return(WindowTriggerResult.Continue);
            }

            lastElementState.Value = element;
            return(WindowTriggerResult.Fire);
        }
 public override void Clear(TWindow window, IWindowTriggerContext ctx)
 {
     throw new System.NotImplementedException();
 }
 public override WindowTriggerResult OnElement(TElement element, long timestamp, TimeWindow window, IWindowTriggerContext ctx)
 {
     ctx.RegisterProcessingTimeTimer(window.MaxTimestamp);
     return(WindowTriggerResult.Continue);
 }