Class InternalAggregateProcessAllWindowFunction<T,ACC,V,R,W extends Window>
- java.lang.Object
-
- org.apache.flink.api.common.functions.AbstractRichFunction
-
- org.apache.flink.api.common.functions.WrappingFunction<ProcessAllWindowFunction<V,R,W>>
-
- org.apache.flink.streaming.runtime.operators.windowing.functions.InternalAggregateProcessAllWindowFunction<T,ACC,V,R,W>
-
- Type Parameters:
W
- 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
- All Implemented Interfaces:
Serializable
,Function
,RichFunction
,InternalWindowFunction<Iterable<T>,R,Byte,W>
public final class InternalAggregateProcessAllWindowFunction<T,ACC,V,R,W extends Window> extends WrappingFunction<ProcessAllWindowFunction<V,R,W>> implements InternalWindowFunction<Iterable<T>,R,Byte,W>
Internal window function for wrapping aProcessAllWindowFunction
that takes anIterable
and anAggregateFunction
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.streaming.runtime.operators.windowing.functions.InternalWindowFunction
InternalWindowFunction.InternalWindowContext
-
-
Field Summary
-
Fields inherited from class org.apache.flink.api.common.functions.WrappingFunction
wrappedFunction
-
-
Constructor Summary
Constructors Constructor Description InternalAggregateProcessAllWindowFunction(AggregateFunction<T,ACC,V> aggFunction, ProcessAllWindowFunction<V,R,W> windowFunction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear(W window, InternalWindowFunction.InternalWindowContext context)
Deletes any state in theContext
when the Window expires (the watermark passes itsmaxTimestamp
+allowedLateness
).IterationRuntimeContext
getIterationRuntimeContext()
Gets a specialized version of theRuntimeContext
, which has additional information about the iteration in which the function is executed.RuntimeContext
getRuntimeContext()
Gets the context that contains information about the UDF's runtime, such as the parallelism of the function, the subtask index of the function, or the name of the task that executes the function.void
open(OpenContext openContext)
Initialization method for the function.void
process(Byte key, W window, InternalWindowFunction.InternalWindowContext context, Iterable<T> input, Collector<R> out)
Evaluates the window and outputs none or several elements.-
Methods inherited from class org.apache.flink.api.common.functions.WrappingFunction
close, getWrappedFunction, setRuntimeContext
-
-
-
-
Constructor Detail
-
InternalAggregateProcessAllWindowFunction
public InternalAggregateProcessAllWindowFunction(AggregateFunction<T,ACC,V> aggFunction, ProcessAllWindowFunction<V,R,W> windowFunction)
-
-
Method Detail
-
open
public void open(OpenContext openContext) throws Exception
Description copied from interface:RichFunction
Initialization method for the function. It is called before the actual working methods (like map or join) and thus suitable for one time setup work. For functions that are part of an iteration, this method will be invoked at the beginning of each iteration superstep.The openContext object passed to the function can be used for configuration and initialization. The openContext contains some necessary information that were configured on the function in the program composition.
public class MyFilter extends RichFilterFunction<String> { private String searchString; public void open(OpenContext openContext) { // initialize the value of searchString } public boolean filter(String value) { return value.equals(searchString); } }
- Specified by:
open
in interfaceRichFunction
- Overrides:
open
in classWrappingFunction<ProcessAllWindowFunction<V,R,W extends Window>>
- Parameters:
openContext
- The context containing information about the context in which the function is opened.- Throws:
Exception
- Implementations may forward exceptions, which are caught by the runtime. When the runtime catches an exception, it aborts the task and lets the fail-over logic decide whether to retry the task execution.
-
process
public void process(Byte key, W window, InternalWindowFunction.InternalWindowContext context, Iterable<T> input, Collector<R> out) throws Exception
Description copied from interface:InternalWindowFunction
Evaluates the window and outputs none or several elements.- Specified by:
process
in interfaceInternalWindowFunction<T,ACC,V,R>
context
- The context in which the window is being evaluated.input
- The elements in the window being evaluated.out
- A collector for emitting elements.- Throws:
Exception
- The function may throw exceptions to fail the program and trigger recovery.
-
clear
public void clear(W window, InternalWindowFunction.InternalWindowContext context) throws Exception
Description copied from interface:InternalWindowFunction
Deletes any state in theContext
when the Window expires (the watermark passes itsmaxTimestamp
+allowedLateness
).
-
getRuntimeContext
public RuntimeContext getRuntimeContext()
Description copied from interface:RichFunction
Gets the context that contains information about the UDF's runtime, such as the parallelism of the function, the subtask index of the function, or the name of the task that executes the function.The RuntimeContext also gives access to the
Accumulator
s and theDistributedCache
.- Specified by:
getRuntimeContext
in interfaceRichFunction
- Overrides:
getRuntimeContext
in classAbstractRichFunction
- Returns:
- The UDF's runtime context.
-
getIterationRuntimeContext
public IterationRuntimeContext getIterationRuntimeContext()
Description copied from interface:RichFunction
Gets a specialized version of theRuntimeContext
, which has additional information about the iteration in which the function is executed. This IterationRuntimeContext is only available if the function is part of an iteration. Otherwise, this method throws an exception.- Specified by:
getIterationRuntimeContext
in interfaceRichFunction
- Overrides:
getIterationRuntimeContext
in classAbstractRichFunction
- Returns:
- The IterationRuntimeContext.
-
-