W - the types of windows being managedpublic class MergingActiveWindowSet<W extends BoundedWindow> extends Object implements ActiveWindowSet<W>
ActiveWindowSet used with WindowFns that support
merging.ActiveWindowSet.MergeCallback<W extends BoundedWindow>| Constructor and Description |
|---|
MergingActiveWindowSet(WindowFn<Object,W> windowFn,
StateInternals state) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(W window)
Add a window to the
ActiveWindowSet. |
boolean |
mergeIfAppropriate(W window,
ActiveWindowSet.MergeCallback<W> mergeCallback)
Invoke
merge on the associated WindowFn, and return true if the window
still exists afterwards. |
void |
persist()
Save any state changes needed.
|
void |
remove(W window)
Remove a window from the
ActiveWindowSet. |
Iterable<W> |
sourceWindows(W window)
Return the set of windows that were merged to produce
window. |
public MergingActiveWindowSet(WindowFn<Object,W> windowFn, StateInternals state)
public void persist()
ActiveWindowSetpersist in interface ActiveWindowSet<W extends BoundedWindow>public boolean add(W window)
ActiveWindowSetActiveWindowSet.add in interface ActiveWindowSet<W extends BoundedWindow>public void remove(W window)
ActiveWindowSetActiveWindowSet.remove in interface ActiveWindowSet<W extends BoundedWindow>public boolean mergeIfAppropriate(W window, ActiveWindowSet.MergeCallback<W> mergeCallback) throws Exception
ActiveWindowSetmerge on the associated WindowFn, and return true if the window
still exists afterwards.mergeIfAppropriate in interface ActiveWindowSet<W extends BoundedWindow>Exceptionpublic Iterable<W> sourceWindows(W window)
ActiveWindowSetwindow. If the associated
WindowFn never merges windows, then this should return the singleton list containing
window.sourceWindows in interface ActiveWindowSet<W extends BoundedWindow>