public class EventTimeTrigger extends Object implements Trigger<Object,TimeWindow>
Trigger that fires once the watermark passes the end of the window
to which a pane belongs.Watermark,
Serialized FormTrigger.TriggerContext, Trigger.TriggerResult| Modifier and Type | Method and Description |
|---|---|
static EventTimeTrigger |
create()
Creates an event-time trigger that fires once the watermark passes the end of the window.
|
Trigger.TriggerResult |
onElement(Object element,
long timestamp,
TimeWindow window,
Trigger.TriggerContext ctx)
Called for every element that gets added to a pane.
|
Trigger.TriggerResult |
onEventTime(long time,
TimeWindow window,
Trigger.TriggerContext ctx)
Called when an event-time timer that was set using the trigger context fires.
|
Trigger.TriggerResult |
onProcessingTime(long time,
TimeWindow window,
Trigger.TriggerContext ctx)
Called when a processing-time timer that was set using the trigger context fires.
|
String |
toString() |
public Trigger.TriggerResult onElement(Object element, long timestamp, TimeWindow window, Trigger.TriggerContext ctx) throws Exception
TriggeronElement in interface Trigger<Object,TimeWindow>element - The element that arrived.timestamp - The timestamp of the element that arrived.window - The window to which this pane belongs.ctx - A context object that can be used to register timer callbacks.Exceptionpublic Trigger.TriggerResult onEventTime(long time, TimeWindow window, Trigger.TriggerContext ctx)
TriggeronEventTime in interface Trigger<Object,TimeWindow>time - The timestamp at which the timer fired.ctx - A context object that can be used to register timer callbacks.public Trigger.TriggerResult onProcessingTime(long time, TimeWindow window, Trigger.TriggerContext ctx) throws Exception
TriggeronProcessingTime in interface Trigger<Object,TimeWindow>time - The timestamp at which the timer fired.ctx - A context object that can be used to register timer callbacks.Exceptionpublic static EventTimeTrigger create()
Once the trigger fires all elements are discarded. Elements that arrive late immediately trigger window evaluation with just this one element.
Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.