Class PatternTimeoutSelectAdapter<IN,OUT,T>
- 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>
-
- org.apache.flink.cep.functions.adaptors.PatternTimeoutSelectAdapter<IN,OUT,T>
-
- All Implemented Interfaces:
Serializable
,org.apache.flink.api.common.functions.Function
,org.apache.flink.api.common.functions.RichFunction
,TimedOutPartialMatchHandler<IN>
@Internal public class PatternTimeoutSelectAdapter<IN,OUT,T> extends PatternSelectAdapter<IN,OUT> implements TimedOutPartialMatchHandler<IN>
Adapter that expresses combination ofPatternSelectFunction
andPatternTimeoutFlatSelectAdapter
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 PatternTimeoutSelectAdapter(PatternSelectFunction<IN,OUT> selectFunction, PatternTimeoutFunction<IN,T> timeoutFunction, org.apache.flink.util.OutputTag<T> timedOutPartialMatchesTag)
-
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
processTimedOutMatch(Map<String,List<IN>> match, PatternProcessFunction.Context ctx)
Called for every timed out partial match (due toPattern.within(Duration)
).-
Methods inherited from class org.apache.flink.cep.functions.adaptors.PatternSelectAdapter
processMatch
-
-
-
-
Constructor Detail
-
PatternTimeoutSelectAdapter
public PatternTimeoutSelectAdapter(PatternSelectFunction<IN,OUT> selectFunction, PatternTimeoutFunction<IN,T> timeoutFunction, org.apache.flink.util.OutputTag<T> timedOutPartialMatchesTag)
-
-
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 classPatternSelectAdapter<IN,OUT>
- Throws:
Exception
-
close
public void close() throws Exception
- Specified by:
close
in interfaceorg.apache.flink.api.common.functions.RichFunction
- Overrides:
close
in classPatternSelectAdapter<IN,OUT>
- Throws:
Exception
-
processTimedOutMatch
public void processTimedOutMatch(Map<String,List<IN>> match, PatternProcessFunction.Context ctx) throws Exception
Description copied from interface:TimedOutPartialMatchHandler
Called for every timed out partial match (due toPattern.within(Duration)
). It enables custom handling, e.g. one can emit the timed out results through a side output:{@code private final OutputTag
timedOutPartialMatchesTag = ... private class MyFunction extends PatternProcessFunction implements TimedOutPartialMatchHandler { - Specified by:
processTimedOutMatch
in interfaceTimedOutPartialMatchHandler<IN>
- Parameters:
match
- map containing the timed out partial match. Events are identified by their names.ctx
- enables access to time features and emitting results through side outputs- Throws:
Exception
- This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
-
-