Class GlobalWindows
- java.lang.Object
-
- org.apache.flink.streaming.api.windowing.assigners.WindowAssigner<Object,GlobalWindow>
-
- org.apache.flink.streaming.api.windowing.assigners.GlobalWindows
-
- All Implemented Interfaces:
Serializable
@PublicEvolving public class GlobalWindows extends WindowAssigner<Object,GlobalWindow>
AWindowAssignerthat assigns all elements to the sameGlobalWindow.Use this if you want to use a
TriggerandEvictorto do flexible, policy based windows.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGlobalWindows.EndOfStreamTriggerA trigger that fires iff the input stream reaches EndOfStream.static classGlobalWindows.NeverTriggerA trigger that never fires, as default Trigger for GlobalWindows.-
Nested classes/interfaces inherited from class org.apache.flink.streaming.api.windowing.assigners.WindowAssigner
WindowAssigner.WindowAssignerContext
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<GlobalWindow>assignWindows(Object element, long timestamp, WindowAssigner.WindowAssignerContext context)Returns aCollectionof windows that should be assigned to the element.static GlobalWindowscreate()Creates aWindowAssignerthat assigns all elements to the sameGlobalWindow.static GlobalWindowscreateWithEndOfStreamTrigger()Creates aWindowAssignerthat assigns all elements to the sameGlobalWindowand the window is triggered if and only if the input stream is ended.Trigger<Object,GlobalWindow>getDefaultTrigger()Returns the default trigger associated with thisWindowAssigner.org.apache.flink.api.common.typeutils.TypeSerializer<GlobalWindow>getWindowSerializer(org.apache.flink.api.common.ExecutionConfig executionConfig)Returns aTypeSerializerfor serializing windows that are assigned by thisWindowAssigner.booleanisEventTime()Returnstrueif elements are assigned to windows based on event time,falseotherwise.StringtoString()
-
-
-
Method Detail
-
assignWindows
public Collection<GlobalWindow> assignWindows(Object element, long timestamp, WindowAssigner.WindowAssignerContext context)
Description copied from class:WindowAssignerReturns aCollectionof windows that should be assigned to the element.- Specified by:
assignWindowsin classWindowAssigner<Object,GlobalWindow>- Parameters:
element- The element to which windows should be assigned.timestamp- The timestamp of the element.context- TheWindowAssigner.WindowAssignerContextin which the assigner operates.
-
getDefaultTrigger
public Trigger<Object,GlobalWindow> getDefaultTrigger()
Description copied from class:WindowAssignerReturns the default trigger associated with thisWindowAssigner.1. If you override
getDefaultTrigger(), thegetDefaultTrigger()will be invoked and thegetDefaultTrigger(StreamExecutionEnvironment env)won't be invoked. 2. If you don't overridegetDefaultTrigger(), thegetDefaultTrigger(StreamExecutionEnvironment env)will be invoked in the default implementation of thegetDefaultTrigger().- Specified by:
getDefaultTriggerin classWindowAssigner<Object,GlobalWindow>
-
create
public static GlobalWindows create()
Creates aWindowAssignerthat assigns all elements to the sameGlobalWindow. The window is only useful if you also specify a custom trigger. Otherwise, the window will never be triggered and no computation will be performed.
-
createWithEndOfStreamTrigger
public static GlobalWindows createWithEndOfStreamTrigger()
Creates aWindowAssignerthat assigns all elements to the sameGlobalWindowand the window is triggered if and only if the input stream is ended.
-
getWindowSerializer
public org.apache.flink.api.common.typeutils.TypeSerializer<GlobalWindow> getWindowSerializer(org.apache.flink.api.common.ExecutionConfig executionConfig)
Description copied from class:WindowAssignerReturns aTypeSerializerfor serializing windows that are assigned by thisWindowAssigner.- Specified by:
getWindowSerializerin classWindowAssigner<Object,GlobalWindow>
-
isEventTime
public boolean isEventTime()
Description copied from class:WindowAssignerReturnstrueif elements are assigned to windows based on event time,falseotherwise.- Specified by:
isEventTimein classWindowAssigner<Object,GlobalWindow>
-
-