public class FoldWindowFunction<K,W extends Window,T,R> extends org.apache.flink.api.java.operators.translation.WrappingFunction<FoldFunction<T,R>> implements WindowFunction<T,R,K,W>, OutputTypeConfigurable<R>
| Constructor and Description |
|---|
FoldWindowFunction(R initialValue,
FoldFunction<T,R> reduceFunction) |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(K k,
W window,
Iterable<T> values,
Collector<R> out)
Evaluates the window and outputs none or several elements.
|
void |
setOutputType(TypeInformation<R> outTypeInfo,
ExecutionConfig executionConfig)
Is called by the
StreamGraph.addOperator(Integer, StreamOperator, TypeInformation, TypeInformation, String)
method when the StreamGraph is generated. |
close, getWrappedFunction, open, setRuntimeContextgetIterationRuntimeContext, getRuntimeContextpublic FoldWindowFunction(R initialValue, FoldFunction<T,R> reduceFunction)
public void apply(K k, W window, Iterable<T> values, Collector<R> out) throws Exception
WindowFunctionapply 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.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.public void setOutputType(TypeInformation<R> outTypeInfo, ExecutionConfig executionConfig)
OutputTypeConfigurableStreamGraph.addOperator(Integer, StreamOperator, TypeInformation, TypeInformation, String)
method when the StreamGraph is generated. The
method is called with the output TypeInformation which is also used for the
StreamTask output serializer.setOutputType in interface OutputTypeConfigurable<R>outTypeInfo - Output type information of the StreamTaskexecutionConfig - Execution configurationCopyright © 2014–2016 The Apache Software Foundation. All rights reserved.