Class PatternSelectAdapter<IN,OUT>
- java.lang.Object
-
- org.apache.flink.api.common.functions.AbstractRichFunction
-
- org.apache.flink.cep.functions.PatternProcessFunction<IN,OUT>
-
- org.apache.flink.cep.functions.adaptors.PatternSelectAdapter<IN,OUT>
-
- All Implemented Interfaces:
Serializable
,org.apache.flink.api.common.functions.Function
,org.apache.flink.api.common.functions.RichFunction
- Direct Known Subclasses:
PatternTimeoutSelectAdapter
@Internal public class PatternSelectAdapter<IN,OUT> extends PatternProcessFunction<IN,OUT>
Adapter that expressesPatternSelectFunction
withPatternProcessFunction
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.cep.functions.PatternProcessFunction
PatternProcessFunction.Context
-
-
Constructor Summary
Constructors Constructor Description PatternSelectAdapter(PatternSelectFunction<IN,OUT> selectFunction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
open(org.apache.flink.api.common.functions.OpenContext openContext)
void
processMatch(Map<String,List<IN>> match, PatternProcessFunction.Context ctx, org.apache.flink.util.Collector<OUT> out)
Generates resulting elements given a map of detected pattern events.
-
-
-
Constructor Detail
-
PatternSelectAdapter
public PatternSelectAdapter(PatternSelectFunction<IN,OUT> selectFunction)
-
-
Method Detail
-
open
public void open(org.apache.flink.api.common.functions.OpenContext openContext) throws Exception
- Specified by:
open
in interfaceorg.apache.flink.api.common.functions.RichFunction
- Overrides:
open
in classorg.apache.flink.api.common.functions.AbstractRichFunction
- Throws:
Exception
-
close
public void close() throws Exception
- Specified by:
close
in interfaceorg.apache.flink.api.common.functions.RichFunction
- Overrides:
close
in classorg.apache.flink.api.common.functions.AbstractRichFunction
- Throws:
Exception
-
processMatch
public void processMatch(Map<String,List<IN>> match, PatternProcessFunction.Context ctx, org.apache.flink.util.Collector<OUT> out) throws Exception
Description copied from class:PatternProcessFunction
Generates resulting elements given a map of detected pattern events. The events are identified by their specified names.TimeContext.timestamp()
in this case returns the time of the last element that was assigned to the match, resulting in this partial match being finished.- Specified by:
processMatch
in classPatternProcessFunction<IN,OUT>
- Parameters:
match
- map containing the found pattern. Events are identified by their names.ctx
- enables access to time features and emitting results through side outputsout
- Collector used to output the generated elements- Throws:
Exception
- This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
-
-