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 boolean
Returns true if thisWindowFn
always assigns an element to exactly one window.abstract W
assignWindow
(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 defaultWindowMappingFn
to use to map main input windows to side input windows.Methods inherited from class org.apache.beam.sdk.transforms.windowing.NonMergingWindowFn
isNonMerging, mergeWindows
Methods 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:WindowFn
Given a timestamp and element, returns the set of windows into which it should be placed.- Specified by:
assignWindows
in classWindowFn<T,
W extends BoundedWindow>
-
getDefaultWindowMappingFn
Description copied from class:WindowFn
Returns the defaultWindowMappingFn
to use to map main input windows to side input windows. This should accept arbitrary main input windows, and produce aBoundedWindow
that can be produced by thisWindowFn
.- Specified by:
getDefaultWindowMappingFn
in classWindowFn<T,
W extends BoundedWindow>
-
assignsToOneWindow
public final boolean assignsToOneWindow()Description copied from class:WindowFn
Returns true if thisWindowFn
always assigns an element to exactly one window.If this varies per-element, or cannot be determined, conservatively return false.
By default, returns false.
- Overrides:
assignsToOneWindow
in classWindowFn<T,
W extends BoundedWindow>
-