W - The type of Windows on which this trigger can operate.@PublicEvolving public class ContinuousEventTimeTrigger<W extends Window> extends Trigger<Object,W>
Trigger that continuously fires based on a given time interval. This fires based
on Watermarks.Watermark,
Serialized FormTrigger.OnMergeContext, Trigger.TriggerContext| Modifier and Type | Method and Description |
|---|---|
boolean |
canMerge()
Returns true if this trigger supports merging of trigger state and can therefore
be used with a
MergingWindowAssigner. |
void |
clear(W window,
Trigger.TriggerContext ctx)
Clears any state that the trigger might still hold for the given window.
|
long |
getInterval() |
static <W extends Window> |
of(Time interval)
Creates a trigger that continuously fires based on the given interval.
|
TriggerResult |
onElement(Object element,
long timestamp,
W window,
Trigger.TriggerContext ctx)
Called for every element that gets added to a pane.
|
TriggerResult |
onEventTime(long time,
W window,
Trigger.TriggerContext ctx)
Called when an event-time timer that was set using the trigger context fires.
|
TriggerResult |
onMerge(W window,
Trigger.OnMergeContext ctx)
Called when several windows have been merged into one window by the
WindowAssigner. |
TriggerResult |
onProcessingTime(long time,
W window,
Trigger.TriggerContext ctx)
Called when a processing-time timer that was set using the trigger context fires.
|
String |
toString() |
public TriggerResult onElement(Object element, long timestamp, W window, Trigger.TriggerContext ctx) throws Exception
TriggeronElement in class Trigger<Object,W extends Window>element - The element that arrived.timestamp - The timestamp of the element that arrived.window - The window to which the element is being added.ctx - A context object that can be used to register timer callbacks.Exceptionpublic TriggerResult onEventTime(long time, W window, Trigger.TriggerContext ctx) throws Exception
Triggerpublic TriggerResult onProcessingTime(long time, W window, Trigger.TriggerContext ctx) throws Exception
Triggerpublic void clear(W window, Trigger.TriggerContext ctx) throws Exception
TriggerTrigger.TriggerContext.registerEventTimeTimer(long)
and Trigger.TriggerContext.registerProcessingTimeTimer(long) should be deleted here as
well as state acquired using Trigger.TriggerContext.getPartitionedState(StateDescriptor).
By default, this method does nothing.
public boolean canMerge()
TriggerMergingWindowAssigner.
If this returns true you must properly implement
Trigger.onMerge(Window, OnMergeContext)
public TriggerResult onMerge(W window, Trigger.OnMergeContext ctx)
TriggerWindowAssigner.public long getInterval()
public static <W extends Window> ContinuousEventTimeTrigger<W> of(Time interval)
W - The type of Windows on which this trigger can operate.interval - The time interval at which to fire.Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.