Package org.apache.flink.cep
Interface PatternTimeoutFunction<IN,OUT>
-
- Type Parameters:
IN
- Type of the input elementsOUT
- Type of the output element
- All Superinterfaces:
Function
,Serializable
public interface PatternTimeoutFunction<IN,OUT> extends Function, Serializable
Base interface for a pattern timeout function. A pattern timeout function is called with a map containing the timed out partial events which can be accessed by their names and the timestamp when the timeout occurred. The names depend on the definition of thePattern
. The timeout method returns exactly one result. If you want to return more than one result, then you have to implement aPatternFlatTimeoutFunction
.PatternStream<IN> pattern = ...; DataStream<OUT> result = pattern.select(..., new MyPatternTimeoutFunction());
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OUT
timeout(Map<String,List<IN>> pattern, long timeoutTimestamp)
Generates a timeout result from the given map of events and timeout timestamp.
-
-
-
Method Detail
-
timeout
OUT timeout(Map<String,List<IN>> pattern, long timeoutTimestamp) throws Exception
Generates a timeout result from the given map of events and timeout timestamp. The partial events are identified by their names. Only one resulting element can be generated.- Parameters:
pattern
- Map containing the found partial pattern. Events are identified by their namestimeoutTimestamp
- Timestamp of the timeout- Returns:
- Resulting timeout element
- Throws:
Exception
- This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
-
-