W - window typepublic class InvalidWindows<W extends BoundedWindow> extends WindowFn<Object,W>
WindowFn that represents an invalid pipeline state.WindowFn.AssignContext, WindowFn.MergeContext| Constructor and Description |
|---|
InvalidWindows(String cause,
WindowFn<?,W> originalWindowFn) |
| Modifier and Type | Method and Description |
|---|---|
Collection<W> |
assignWindows(WindowFn.AssignContext c)
Given a timestamp and element, returns the set of windows into which it
should be placed.
|
String |
getCause()
Returns the reason that this
WindowFn is invalid. |
WindowFn<?,W> |
getOriginalWindowFn()
Returns the original windowFn that this InvalidWindows replaced.
|
org.joda.time.Instant |
getOutputTime(org.joda.time.Instant inputTimestamp,
W window)
Returns the output timestamp to use for data depending on the given
inputTimestamp
in the specified window. |
W |
getSideInputWindow(BoundedWindow window)
Returns the window of the side input corresponding to the given window of
the main input.
|
boolean |
isCompatible(WindowFn<?,?> other)
InvalidWindows objects with the same originalWindowFn are compatible. |
void |
mergeWindows(WindowFn.MergeContext c)
Does whatever merging of windows is necessary.
|
Coder<W> |
windowCoder()
Returns the
Coder used for serializing the windows used
by this windowFn. |
assignsToSingleWindow, isNonMergingpublic String getCause()
WindowFn is invalid.public WindowFn<?,W> getOriginalWindowFn()
public Collection<W> assignWindows(WindowFn.AssignContext c)
WindowFnassignWindows in class WindowFn<Object,W extends BoundedWindow>public void mergeWindows(WindowFn.MergeContext c)
WindowFn See MergeOverlappingIntervalWindows.mergeWindows(com.google.cloud.dataflow.sdk.transforms.windowing.WindowFn<?, com.google.cloud.dataflow.sdk.transforms.windowing.IntervalWindow>.MergeContext) for an
example of how to override this method.
mergeWindows in class WindowFn<Object,W extends BoundedWindow>public Coder<W> windowCoder()
WindowFnCoder used for serializing the windows used
by this windowFn.windowCoder in class WindowFn<Object,W extends BoundedWindow>public boolean isCompatible(WindowFn<?,?> other)
InvalidWindows objects with the same originalWindowFn are compatible.isCompatible in class WindowFn<Object,W extends BoundedWindow>public W getSideInputWindow(BoundedWindow window)
WindowFn Authors of custom WindowFns should override this.
getSideInputWindow in class WindowFn<Object,W extends BoundedWindow>public org.joda.time.Instant getOutputTime(org.joda.time.Instant inputTimestamp,
W window)
WindowFninputTimestamp
in the specified window.
The result must be between inputTimestamp and window.maxTimestamp()
(inclusive on both sides). If this WindowFn doesn't produce overlapping windows,
this can (and typically should) just return inputTimestamp. If this does produce
overlapping windows, it is suggested that the 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.
Each KV<K, Iterable<V>> produced from a GroupByKey will be output at a
timestamp that is the minimum of getOutputTime applied to the timestamp of all of
the non-late KV<K, V> that were used as input to the GroupByKey. The watermark
is also prevented from advancing past this minimum timestamp until after the
KV<K, Iterable<V>> has been output.
This function should be monotonic across input timestamps. Specifically, if A < B,
then getOutputTime(A, window) <= getOutputTime(B, window).
getOutputTime in class WindowFn<Object,W extends BoundedWindow>