@Internal public class ReduceApplyWindowFunction<K,W extends Window,T,R> extends WrappingFunction<WindowFunction<T,R,K,W>> implements WindowFunction<T,R,K,W>
WindowFunction
that is used for implementing a fold on a window configuration
that only allows WindowFunction
and cannot directly execute a ReduceFunction
.wrappedFunction
Constructor and Description |
---|
ReduceApplyWindowFunction(ReduceFunction<T> reduceFunction,
WindowFunction<T,R,K,W> windowFunction) |
Modifier and Type | Method and Description |
---|---|
void |
apply(K k,
W window,
Iterable<T> input,
Collector<R> out)
Evaluates the window and outputs none or several elements.
|
close, getWrappedFunction, open, setRuntimeContext
getIterationRuntimeContext, getRuntimeContext, open
public ReduceApplyWindowFunction(ReduceFunction<T> reduceFunction, WindowFunction<T,R,K,W> windowFunction)
public void apply(K k, W window, Iterable<T> input, Collector<R> out) throws Exception
WindowFunction
apply
in interface WindowFunction<T,R,K,W extends Window>
k
- The key for which this window is evaluated.window
- The window that is being evaluated.input
- The elements in the window being evaluated.out
- A collector for emitting elements.Exception
- The function may throw exceptions to fail the program and trigger recovery.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.