K
- The key typeW
- The window typeT
- The type of the input to the AggregateFunctionACC
- The type of the AggregateFunction's accumulatorV
- The type of the AggregateFunction's result, and the input to the WindowFunctionR
- The result type of the WindowFunction@Internal public class AggregateApplyWindowFunction<K,W extends Window,T,ACC,V,R> extends WrappingFunction<WindowFunction<V,R,K,W>> implements WindowFunction<T,R,K,W>
WindowFunction
that composes an AggregateFunction
and WindowFunction
.
Upon invocation, this first applies AggregateFunction
to the input, and then finally the
WindowFunction
to the single result element.wrappedFunction
Constructor and Description |
---|
AggregateApplyWindowFunction(AggregateFunction<T,ACC,V> aggFunction,
WindowFunction<V,R,K,W> windowFunction) |
Modifier and Type | Method and Description |
---|---|
void |
apply(K key,
W window,
Iterable<T> values,
Collector<R> out)
Evaluates the window and outputs none or several elements.
|
close, getWrappedFunction, open, setRuntimeContext
getIterationRuntimeContext, getRuntimeContext
public AggregateApplyWindowFunction(AggregateFunction<T,ACC,V> aggFunction, WindowFunction<V,R,K,W> windowFunction)
public void apply(K key, W window, Iterable<T> values, Collector<R> out) throws Exception
WindowFunction
apply
in interface WindowFunction<T,R,K,W extends Window>
key
- The key for which this window is evaluated.window
- The window that is being evaluated.values
- 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.