W - window typepublic class InvalidWindows<W extends BoundedWindow> extends WindowFn<java.lang.Object,W>
WindowFn that represents an invalid pipeline state.WindowFn.AssignContext, WindowFn.MergeContext| Constructor and Description |
|---|
InvalidWindows(java.lang.String cause,
WindowFn<?,W> originalWindowFn) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Collection<W> |
assignWindows(WindowFn.AssignContext c)
Given a timestamp and element, returns the set of windows into which it should be placed.
|
java.lang.String |
getCause()
Returns the reason that this
WindowFn is invalid. |
WindowMappingFn<W> |
getDefaultWindowMappingFn()
Returns the default
WindowMappingFn to use to map main input windows to side input
windows. |
WindowFn<?,W> |
getOriginalWindowFn()
Returns the original windowFn that this InvalidWindows replaced.
|
Instant |
getOutputTime(Instant inputTimestamp,
W window)
Returns the output timestamp to use for data depending on the given
inputTimestamp in
the specified window. |
boolean |
isCompatible(WindowFn<?,?> other)
InvalidWindows objects with the same originalWindowFn are compatible. |
void |
mergeWindows(WindowFn.MergeContext c)
Does whatever merging of windows is necessary.
|
void |
verifyCompatibility(WindowFn<?,?> other)
Throw
IncompatibleWindowException if this WindowFn does not perform the same merging as
the given $WindowFn. |
Coder<W> |
windowCoder()
Returns the
Coder used for serializing the windows used by this windowFn. |
assignsToOneWindow, getWindowTypeDescriptor, isNonMerging, populateDisplayDatapublic java.lang.String getCause()
WindowFn is invalid.public WindowFn<?,W> getOriginalWindowFn()
public java.util.Collection<W> assignWindows(WindowFn.AssignContext c)
WindowFnassignWindows in class WindowFn<java.lang.Object,W extends BoundedWindow>public void mergeWindows(WindowFn.MergeContext c)
WindowFnSee MergeOverlappingIntervalWindows.mergeWindows(org.apache.beam.sdk.transforms.windowing.WindowFn<?, org.apache.beam.sdk.transforms.windowing.IntervalWindow>.MergeContext) for an example of how to override
this method.
mergeWindows in class WindowFn<java.lang.Object,W extends BoundedWindow>public Coder<W> windowCoder()
WindowFnCoder used for serializing the windows used by this windowFn.windowCoder in class WindowFn<java.lang.Object,W extends BoundedWindow>public boolean isCompatible(WindowFn<?,?> other)
InvalidWindows objects with the same originalWindowFn are compatible.isCompatible in class WindowFn<java.lang.Object,W extends BoundedWindow>public void verifyCompatibility(WindowFn<?,?> other) throws IncompatibleWindowException
WindowFnIncompatibleWindowException if this WindowFn does not perform the same merging as
the given $WindowFn.verifyCompatibility in class WindowFn<java.lang.Object,W extends BoundedWindow>IncompatibleWindowException - if compared WindowFns are not compatible.public WindowMappingFn<W> getDefaultWindowMappingFn()
WindowFnWindowMappingFn to use to map main input windows to side input
windows. This should accept arbitrary main input windows, and produce a BoundedWindow
that can be produced by this WindowFn.getDefaultWindowMappingFn in class WindowFn<java.lang.Object,W extends BoundedWindow>public Instant getOutputTime(Instant inputTimestamp, W window)
WindowFninputTimestamp in
the specified window.
The result of this method must be between inputTimestamp and window.maxTimestamp() (inclusive on both sides).
This function must be monotonic across input timestamps. Specifically, if A < B,
then getOutputTime(A, window) <= getOutputTime(B, window).
For a WindowFn that doesn't produce overlapping windows, this can (and typically
should) just return inputTimestamp. In the presence of overlapping windows, it is
suggested that the result in later overlapping windows is past the end of earlier windows so
that the later windows don't prevent the watermark from progressing past the end of the earlier
window.
getOutputTime in class WindowFn<java.lang.Object,W extends BoundedWindow>