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
A
WindowAssigner that assigns all elements to the same GlobalWindow.
Use this if you want to use a Trigger and Evictor to do flexible, policy based windows.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA trigger that fires iff the input stream reaches EndOfStream.static classA 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
Modifier and TypeMethodDescriptionassignWindows(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 GlobalWindowsCreates aWindowAssignerthat assigns all elements to the sameGlobalWindowand the window is triggered if and only if the input stream is ended.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.booleanReturnstrueif elements are assigned to windows based on event time,falseotherwise.toString()
-
Method Details
-
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
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>
-
toString
-
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
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>
-