Interface TimedOutPartialMatchHandler<IN>

  • Type Parameters:
    IN - type of input elements
    All Known Implementing Classes:
    PatternTimeoutFlatSelectAdapter, PatternTimeoutSelectAdapter

    @PublicEvolving
    public interface TimedOutPartialMatchHandler<IN>
    Enables handling timed out partial matches. It shall be used in a mixin style. If you need your PatternProcessFunction to be able to handle timed out partial matches implement this interface as well. Example:
    
     private class MyFunction extends PatternProcessFunction<IN, OUT> implements TimedOutPartialMatchHandler<IN> {
    
     }
     
    • Method Detail

      • processTimedOutMatch

        void processTimedOutMatch​(Map<String,​List<IN>> match,
                                  PatternProcessFunction.Context ctx)
                           throws Exception
        Called for every timed out partial match (due to Pattern.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 {
        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.