Class InternalIterableProcessAllWindowFunction<IN,OUT,W extends Window>
- java.lang.Object
-
- org.apache.flink.api.common.functions.AbstractRichFunction
-
- org.apache.flink.api.common.functions.WrappingFunction<ProcessAllWindowFunction<IN,OUT,W>>
-
- org.apache.flink.streaming.runtime.operators.windowing.functions.InternalIterableProcessAllWindowFunction<IN,OUT,W>
-
- All Implemented Interfaces:
Serializable
,Function
,RichFunction
,InternalWindowFunction<Iterable<IN>,OUT,Byte,W>
public final class InternalIterableProcessAllWindowFunction<IN,OUT,W extends Window> extends WrappingFunction<ProcessAllWindowFunction<IN,OUT,W>> implements InternalWindowFunction<Iterable<IN>,OUT,Byte,W>
Internal window function for wrapping aProcessAllWindowFunction
that takes anIterable
when the window state also is anIterable
.- 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 InternalIterableProcessAllWindowFunction(ProcessAllWindowFunction<IN,OUT,W> wrappedFunction)
-
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<IN> input, Collector<OUT> 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
-
InternalIterableProcessAllWindowFunction
public InternalIterableProcessAllWindowFunction(ProcessAllWindowFunction<IN,OUT,W> wrappedFunction)
-
-
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<IN,OUT,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<IN> input, Collector<OUT> out) throws Exception
Description copied from interface:InternalWindowFunction
Evaluates the window and outputs none or several elements.- Specified by:
process
in interfaceInternalWindowFunction<Iterable<IN>,OUT,Byte,W extends Window>
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.
-
-