Class SkipToFirstStrategy

java.lang.Object
org.apache.flink.cep.nfa.aftermatch.AfterMatchSkipStrategy
org.apache.flink.cep.nfa.aftermatch.SkipToFirstStrategy
All Implemented Interfaces:
Serializable

public final class SkipToFirstStrategy extends AfterMatchSkipStrategy
Discards every partial match that started before the first event of emitted match mapped to *PatternName*.
See Also:
  • Method Details

    • throwExceptionOnMiss

      public org.apache.flink.cep.nfa.aftermatch.SkipToElementStrategy throwExceptionOnMiss()
      Enables throwing exception if no events mapped to the *PatternName*. If not enabled and no events were mapped, NoSkipStrategy will be used
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isSkipStrategy

      public boolean isSkipStrategy()
      Description copied from class: AfterMatchSkipStrategy
      Tells if the strategy may skip some matches.
      Specified by:
      isSkipStrategy in class AfterMatchSkipStrategy
      Returns:
      false if the strategy is NO_SKIP strategy
    • shouldPrune

      protected boolean shouldPrune(EventId startEventID, EventId pruningId)
      Description copied from class: AfterMatchSkipStrategy
      Tells if the partial/completed match starting at given id should be prunned by given pruningId.
      Specified by:
      shouldPrune in class AfterMatchSkipStrategy
      Parameters:
      startEventID - starting event id of a partial/completed match
      pruningId - pruningId calculated by this strategy
      Returns:
      true if the match should be pruned
    • getPruningId

      protected EventId getPruningId(Collection<Map<String,List<EventId>>> match)
      Description copied from class: AfterMatchSkipStrategy
      Retrieves event id of the pruning element from the given match based on the strategy.
      Specified by:
      getPruningId in class AfterMatchSkipStrategy
      Parameters:
      match - match corresponding to which should the pruning happen
      Returns:
      pruning event id
    • getPatternName

      public Optional<String> getPatternName()
      Description copied from class: AfterMatchSkipStrategy
      Name of pattern that processing will be skipped to.
      Overrides:
      getPatternName in class AfterMatchSkipStrategy
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object