Interface PatternTimeoutFunction<IN,​OUT>

  • Type Parameters:
    IN - Type of the input elements
    OUT - 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 the Pattern. The timeout method returns exactly one result. If you want to return more than one result, then you have to implement a PatternFlatTimeoutFunction.
    
     PatternStream<IN> pattern = ...;
    
     DataStream<OUT> result = pattern.select(..., new MyPatternTimeoutFunction());
     
    • 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 names
        timeoutTimestamp - 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.