Class GlobalWindows
- java.lang.Object
-
- org.apache.beam.sdk.transforms.windowing.WindowFn<T,W>
-
- org.apache.beam.sdk.transforms.windowing.NonMergingWindowFn<java.lang.Object,GlobalWindow>
-
- org.apache.beam.sdk.transforms.windowing.GlobalWindows
-
- All Implemented Interfaces:
java.io.Serializable
,HasDisplayData
public class GlobalWindows extends NonMergingWindowFn<java.lang.Object,GlobalWindow>
AWindowFn
that assigns all data to the same window.This is the
WindowFn
used for data coming from a source, before aWindow
transform has been applied.- 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 GlobalWindows()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
assignsToOneWindow()
Returns true if thisWindowFn
always assigns an element to exactly one window.java.util.Collection<GlobalWindow>
assignWindows(WindowFn.AssignContext c)
Given a timestamp and element, returns the set of windows into which it should be placed.boolean
equals(@Nullable java.lang.Object other)
WindowMappingFn<GlobalWindow>
getDefaultWindowMappingFn()
Returns the defaultWindowMappingFn
to use to map main input windows to side input windows.int
hashCode()
boolean
isCompatible(WindowFn<?,?> o)
Returns whether this performs the same merging as the givenWindowFn
.java.lang.String
toString()
void
verifyCompatibility(WindowFn<?,?> other)
ThrowIncompatibleWindowException
if this WindowFn does not perform the same merging as the given $WindowFn
.Coder<GlobalWindow>
windowCoder()
Returns theCoder
used for serializing the windows used by this windowFn.-
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, populateDisplayData
-
-
-
-
Method Detail
-
assignWindows
public java.util.Collection<GlobalWindow> 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<java.lang.Object,GlobalWindow>
-
isCompatible
public boolean isCompatible(WindowFn<?,?> o)
Description copied from class:WindowFn
Returns whether this performs the same merging as the givenWindowFn
.- Specified by:
isCompatible
in classWindowFn<java.lang.Object,GlobalWindow>
-
verifyCompatibility
public void verifyCompatibility(WindowFn<?,?> other) throws IncompatibleWindowException
Description copied from class:WindowFn
ThrowIncompatibleWindowException
if this WindowFn does not perform the same merging as the given $WindowFn
.- Overrides:
verifyCompatibility
in classWindowFn<java.lang.Object,GlobalWindow>
- Throws:
IncompatibleWindowException
- if compared WindowFns are not compatible.
-
windowCoder
public Coder<GlobalWindow> windowCoder()
Description copied from class:WindowFn
Returns theCoder
used for serializing the windows used by this windowFn.- Specified by:
windowCoder
in classWindowFn<java.lang.Object,GlobalWindow>
-
getDefaultWindowMappingFn
public WindowMappingFn<GlobalWindow> 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<java.lang.Object,GlobalWindow>
-
assignsToOneWindow
public 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<java.lang.Object,GlobalWindow>
-
equals
public boolean equals(@Nullable java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-