public class GlobalWindows extends NonMergingWindowFn<Object,GlobalWindow>
WindowFn where all data is in the same window.WindowFn.AssignContext, WindowFn.MergeContext| Constructor and Description |
|---|
GlobalWindows() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
assignsToSingleWindow()
Returns true if this
WindowFn assigns each element to a single window. |
Collection<GlobalWindow> |
assignWindows(WindowFn.AssignContext c)
Given a timestamp and element, returns the set of windows into which it
should be placed.
|
org.joda.time.Instant |
getOutputTime(org.joda.time.Instant inputTimestamp,
GlobalWindow window)
Returns the output timestamp to use for data depending on the given
inputTimestamp
in the specified window. |
GlobalWindow |
getSideInputWindow(BoundedWindow window)
Returns the window of the side input corresponding to the given window of
the main input.
|
boolean |
isCompatible(WindowFn<?,?> o)
Returns whether this performs the same merging as the given
WindowFn. |
Coder<GlobalWindow> |
windowCoder()
Returns the
Coder used for serializing the windows used
by this windowFn. |
isNonMerging, mergeWindowspublic Collection<GlobalWindow> assignWindows(WindowFn.AssignContext c)
WindowFnassignWindows in class WindowFn<Object,GlobalWindow>public boolean isCompatible(WindowFn<?,?> o)
WindowFnWindowFn.isCompatible in class WindowFn<Object,GlobalWindow>public Coder<GlobalWindow> windowCoder()
WindowFnCoder used for serializing the windows used
by this windowFn.windowCoder in class WindowFn<Object,GlobalWindow>public GlobalWindow getSideInputWindow(BoundedWindow window)
WindowFnAuthors of custom WindowFns should override this.
getSideInputWindow in class WindowFn<Object,GlobalWindow>public boolean assignsToSingleWindow()
WindowFnWindowFn assigns each element to a single window.assignsToSingleWindow in class WindowFn<Object,GlobalWindow>public org.joda.time.Instant getOutputTime(org.joda.time.Instant inputTimestamp,
GlobalWindow 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 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,GlobalWindow>