@Internal public class PatternTimeoutFlatSelectAdapter<IN,OUT,T> extends PatternFlatSelectAdapter<IN,OUT> implements TimedOutPartialMatchHandler<IN>
PatternFlatSelectFunction and PatternTimeoutFlatSelectAdapter with PatternProcessFunction.PatternProcessFunction.Context| Constructor and Description |
|---|
PatternTimeoutFlatSelectAdapter(PatternFlatSelectFunction<IN,OUT> flatSelectFunction,
PatternFlatTimeoutFunction<IN,T> flatTimeoutFunction,
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 PatternTimeoutFlatSelectAdapter(PatternFlatSelectFunction<IN,OUT> flatSelectFunction, PatternFlatTimeoutFunction<IN,T> flatTimeoutFunction, 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 PatternFlatSelectAdapter<IN,OUT>Exceptionpublic void close()
throws Exception
close in interface org.apache.flink.api.common.functions.RichFunctionclose in class PatternFlatSelectAdapter<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.