T - The type of elements that this WindowAssigner can assign windows to.W - The type of Window that this assigner assigns.@PublicEvolving public abstract class WindowAssigner<T,W extends Window> extends Object implements Serializable
WindowAssigner assigns zero or more Windows to an element.
In a window operation, elements are grouped by their key (if available) and by the windows to
which it was assigned. The set of elements with the same key and window is called a pane.
When a Trigger decides that a certain pane should fire the
WindowFunction is applied
to produce output elements for that pane.
| Modifier and Type | Class and Description |
|---|---|
static class |
WindowAssigner.WindowAssignerContext
A context provided to the
WindowAssigner that allows it to query the
current processing time. |
| Constructor and Description |
|---|
WindowAssigner() |
| Modifier and Type | Method and Description |
|---|---|
abstract Collection<W> |
assignWindows(T element,
long timestamp,
WindowAssigner.WindowAssignerContext context)
Returns a
Collection of windows that should be assigned to the element. |
abstract Trigger<T,W> |
getDefaultTrigger(StreamExecutionEnvironment env)
Returns the default trigger associated with this
WindowAssigner. |
abstract org.apache.flink.api.common.typeutils.TypeSerializer<W> |
getWindowSerializer(org.apache.flink.api.common.ExecutionConfig executionConfig)
Returns a
TypeSerializer for serializing windows that are assigned by
this WindowAssigner. |
abstract boolean |
isEventTime()
Returns
true if elements are assigned to windows based on event time,
false otherwise. |
public abstract Collection<W> assignWindows(T element, long timestamp, WindowAssigner.WindowAssignerContext context)
Collection of windows that should be assigned to the element.element - The element to which windows should be assigned.timestamp - The timestamp of the element.context - The WindowAssigner.WindowAssignerContext in which the assigner operates.public abstract Trigger<T,W> getDefaultTrigger(StreamExecutionEnvironment env)
WindowAssigner.public abstract org.apache.flink.api.common.typeutils.TypeSerializer<W> getWindowSerializer(org.apache.flink.api.common.ExecutionConfig executionConfig)
TypeSerializer for serializing windows that are assigned by
this WindowAssigner.public abstract boolean isEventTime()
true if elements are assigned to windows based on event time,
false otherwise.Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.