T - type of elements being windowedW - BoundedWindow subclass used to represent the
windows used by this WindowingFnpublic abstract class WindowingFn<T,W extends BoundedWindow>
extends java.lang.Object
implements java.io.Serializable
Window transform used to assign elements into
windows and to determine how windows are merged. See Window for more
information on how WindowingFns are used and for a library of
predefined WindowingFns.
Users will generally want to use the predefined
WindowingFns, but it is also possible to create new
subclasses.
TODO: Describe how to properly create WindowingFns.
| Modifier and Type | Class and Description |
|---|---|
class |
WindowingFn.AssignContext
Information available when running
assignWindows(com.google.cloud.dataflow.sdk.transforms.windowing.WindowingFn<T, W>.AssignContext). |
class |
WindowingFn.MergeContext
Information available when running
mergeWindows(com.google.cloud.dataflow.sdk.transforms.windowing.WindowingFn<T, W>.MergeContext). |
| Constructor and Description |
|---|
WindowingFn() |
| Modifier and Type | Method and Description |
|---|---|
abstract java.util.Collection<W> |
assignWindows(WindowingFn.AssignContext c)
Given a timestamp and element, returns the set of windows into which it
should be placed.
|
abstract boolean |
isCompatible(WindowingFn<?,?> other)
Returns whether this performs the same merging as the given
WindowingFn. |
abstract void |
mergeWindows(WindowingFn.MergeContext c)
Does whatever merging of windows is necessary.
|
abstract Coder<W> |
windowCoder()
Returns the
Coder used for serializing the windows used
by this windowingFn. |
public abstract java.util.Collection<W> assignWindows(WindowingFn.AssignContext c) throws java.lang.Exception
java.lang.Exceptionpublic abstract void mergeWindows(WindowingFn.MergeContext c) throws java.lang.Exception
See MergeOverlappingIntervalWindows.mergeWindows(com.google.cloud.dataflow.sdk.transforms.windowing.WindowingFn<?, com.google.cloud.dataflow.sdk.transforms.windowing.IntervalWindow>.MergeContext) for an
example of how to override this method.
java.lang.Exceptionpublic abstract boolean isCompatible(WindowingFn<?,?> other)
WindowingFn.