IN- type of incoming elements
OUT- type of produced elements based on found matches
@PublicEvolving public abstract class PatternProcessFunction<IN,OUT> extends AbstractRichFunction
Patternspecifying the sought-after pattern. This is the preferred way to process found matches.
PatternStream<IN> pattern = ... DataStream<OUT> result = pattern.process(new MyPatternProcessFunction());
|Modifier and Type||Class and Description|
Gives access to time related characteristics as well as enables emitting elements to side outputs.
|Constructor and Description|
|Modifier and Type||Method and Description|
Generates resulting elements given a map of detected pattern events.
close, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContext
public abstract void processMatch(Map<String,List<IN>> match, PatternProcessFunction.Context ctx, Collector<OUT> out) throws Exception
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.
match- map containing the found pattern. Events are identified by their names.
ctx- enables access to time features and emitting results through side outputs
out- Collector used to output the generated elements
Exception- This method may throw exceptions. Throwing an exception will cause the operation to fail and may trigger recovery.
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.