Class PartitioningWindowFn<T,W extends BoundedWindow>
java.lang.Object
org.apache.beam.sdk.transforms.windowing.WindowFn<T,W>
org.apache.beam.sdk.transforms.windowing.NonMergingWindowFn<T,W>
org.apache.beam.sdk.transforms.windowing.PartitioningWindowFn<T,W>
- Type Parameters:
T- type of elements being windowedW- window type
- All Implemented Interfaces:
Serializable,HasDisplayData
- Direct Known Subclasses:
CalendarWindows.DaysWindows,CalendarWindows.MonthsWindows,CalendarWindows.YearsWindows,FixedWindows
public abstract class PartitioningWindowFn<T,W extends BoundedWindow>
extends NonMergingWindowFn<T,W>
A
WindowFn that places each value into exactly one window based on its timestamp and
never merges windows.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.beam.sdk.transforms.windowing.WindowFn
WindowFn.AssignContext, WindowFn.MergeContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanReturns true if thisWindowFnalways assigns an element to exactly one window.abstract WassignWindow(Instant timestamp) Returns the single window to which elements with this timestamp belong.final Collection<W> Given a timestamp and element, returns the set of windows into which it should be placed.Returns the defaultWindowMappingFnto use to map main input windows to side input windows.Methods inherited from class org.apache.beam.sdk.transforms.windowing.NonMergingWindowFn
isNonMerging, mergeWindowsMethods inherited from class org.apache.beam.sdk.transforms.windowing.WindowFn
getWindowTypeDescriptor, isCompatible, populateDisplayData, verifyCompatibility, windowCoder
-
Constructor Details
-
PartitioningWindowFn
public PartitioningWindowFn()
-
-
Method Details
-
assignWindow
Returns the single window to which elements with this timestamp belong. -
assignWindows
Description copied from class:WindowFnGiven a timestamp and element, returns the set of windows into which it should be placed.- Specified by:
assignWindowsin classWindowFn<T,W extends BoundedWindow>
-
getDefaultWindowMappingFn
Description copied from class:WindowFnReturns the defaultWindowMappingFnto use to map main input windows to side input windows. This should accept arbitrary main input windows, and produce aBoundedWindowthat can be produced by thisWindowFn.- Specified by:
getDefaultWindowMappingFnin classWindowFn<T,W extends BoundedWindow>
-
assignsToOneWindow
public final boolean assignsToOneWindow()Description copied from class:WindowFnReturns true if thisWindowFnalways assigns an element to exactly one window.If this varies per-element, or cannot be determined, conservatively return false.
By default, returns false.
- Overrides:
assignsToOneWindowin classWindowFn<T,W extends BoundedWindow>
-