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:
java.io.Serializable
,HasDisplayData
- Direct Known Subclasses:
CalendarWindows.DaysWindows
,CalendarWindows.MonthsWindows
,CalendarWindows.YearsWindows
,FixedWindows
public abstract class PartitioningWindowFn<T,W extends BoundedWindow> extends NonMergingWindowFn<T,W>
AWindowFn
that places each value into exactly one window based on its timestamp and never merges windows.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.beam.sdk.transforms.windowing.WindowFn
WindowFn.AssignContext, WindowFn.MergeContext
-
-
Constructor Summary
Constructors Constructor Description PartitioningWindowFn()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
assignsToOneWindow()
Returns true if thisWindowFn
always assigns an element to exactly one window.abstract W
assignWindow(org.joda.time.Instant timestamp)
Returns the single window to which elements with this timestamp belong.java.util.Collection<W>
assignWindows(WindowFn.AssignContext c)
Given a timestamp and element, returns the set of windows into which it should be placed.WindowMappingFn<W>
getDefaultWindowMappingFn()
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
-
-
-
-
Method Detail
-
assignWindow
public abstract W assignWindow(org.joda.time.Instant timestamp)
Returns the single window to which elements with this timestamp belong.
-
assignWindows
public final java.util.Collection<W> assignWindows(WindowFn.AssignContext c)
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
public WindowMappingFn<W> 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>
-
-