@Internal public class PatternTimeoutSelectAdapter<IN,OUT,T> extends PatternSelectAdapter<IN,OUT> implements TimedOutPartialMatchHandler<IN>
PatternSelectFunction and PatternTimeoutFlatSelectAdapter with PatternProcessFunction.PatternProcessFunction.Context| Constructor and Description |
|---|
PatternTimeoutSelectAdapter(PatternSelectFunction<IN,OUT> selectFunction,
PatternTimeoutFunction<IN,T> timeoutFunction,
org.apache.flink.util.OutputTag<T> timedOutPartialMatchesTag) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
open(org.apache.flink.configuration.Configuration parameters) |
void |
processTimedOutMatch(Map<String,List<IN>> match,
PatternProcessFunction.Context ctx)
Called for every timed out partial match (due to
Pattern.within(Time)). |
processMatchpublic PatternTimeoutSelectAdapter(PatternSelectFunction<IN,OUT> selectFunction, PatternTimeoutFunction<IN,T> timeoutFunction, org.apache.flink.util.OutputTag<T> timedOutPartialMatchesTag)
public void open(org.apache.flink.configuration.Configuration parameters)
throws Exception
open in interface org.apache.flink.api.common.functions.RichFunctionopen in class PatternSelectAdapter<IN,OUT>Exceptionpublic void close()
throws Exception
close in interface org.apache.flink.api.common.functions.RichFunctionclose in class PatternSelectAdapter<IN,OUT>Exceptionpublic void processTimedOutMatch(Map<String,List<IN>> match, PatternProcessFunction.Context ctx) throws Exception
TimedOutPartialMatchHandlerPattern.within(Time)). 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 { processTimedOutMatch in interface TimedOutPartialMatchHandler<IN>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 outputsException - 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.