@PublicEvolving public class ProcessingTimeTrigger extends Trigger<Object,TimeWindow>
Trigger
that fires once the current system time passes the end of the window
to which a pane belongs.Trigger.TriggerContext
Modifier and Type | Method and Description |
---|---|
void |
clear(TimeWindow window,
Trigger.TriggerContext ctx)
Clears any state that the trigger might still hold for the given window.
|
static ProcessingTimeTrigger |
create()
Creates a new trigger that fires once system time passes the end of the window.
|
TriggerResult |
onElement(Object element,
long timestamp,
TimeWindow window,
Trigger.TriggerContext ctx)
Called for every element that gets added to a pane.
|
TriggerResult |
onEventTime(long time,
TimeWindow window,
Trigger.TriggerContext ctx)
Called when an event-time timer that was set using the trigger context fires.
|
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 TriggerResult onElement(Object element, long timestamp, TimeWindow window, Trigger.TriggerContext ctx)
Trigger
onElement
in class 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.public TriggerResult onEventTime(long time, TimeWindow window, Trigger.TriggerContext ctx) throws Exception
Trigger
onEventTime
in class Trigger<Object,TimeWindow>
time
- The timestamp at which the timer fired.ctx
- A context object that can be used to register timer callbacks.Exception
public TriggerResult onProcessingTime(long time, TimeWindow window, Trigger.TriggerContext ctx)
Trigger
onProcessingTime
in class Trigger<Object,TimeWindow>
time
- The timestamp at which the timer fired.ctx
- A context object that can be used to register timer callbacks.public void clear(TimeWindow window, Trigger.TriggerContext ctx) throws Exception
Trigger
Trigger.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.
clear
in class Trigger<Object,TimeWindow>
Exception
public static ProcessingTimeTrigger create()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.