Class RichFilterFunction<T>
- java.lang.Object
-
- org.apache.flink.api.common.functions.AbstractRichFunction
-
- org.apache.flink.api.common.functions.RichFilterFunction<T>
-
- Type Parameters:
T
- The type of the filtered elements.
- All Implemented Interfaces:
Serializable
,FilterFunction<T>
,Function
,RichFunction
@Public public abstract class RichFilterFunction<T> extends AbstractRichFunction implements FilterFunction<T>
Rich variant of theFilterFunction
. As aRichFunction
, it gives access to theRuntimeContext
and provides setup and teardown methods:RichFunction.open(OpenContext)
andRichFunction.close()
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RichFilterFunction()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract boolean
filter(T value)
The filter function that evaluates the predicate.-
Methods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction
close, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContext
-
-
-
-
Method Detail
-
filter
public abstract boolean filter(T value) throws Exception
Description copied from interface:FilterFunction
The filter function that evaluates the predicate.IMPORTANT: The system assumes that the function does not modify the elements on which the predicate is applied. Violating this assumption can lead to incorrect results.
- Specified by:
filter
in interfaceFilterFunction<T>
- Parameters:
value
- The value to be filtered.- Returns:
- True for values that should be retained, false for values to be filtered out.
- Throws:
Exception
- This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
-
-