Class AfterMatchSkipStrategy
java.lang.Object
org.apache.flink.cep.nfa.aftermatch.AfterMatchSkipStrategy
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
NoSkipStrategy,SkipPastLastStrategy,SkipToFirstStrategy,SkipToLastStrategy,SkipToNextStrategy
Indicate the skip strategy after a match process.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionName of pattern that processing will be skipped to.protected abstract EventIdgetPruningId(Collection<Map<String, List<EventId>>> match) Retrieves event id of the pruning element from the given match based on the strategy.abstract booleanTells if the strategy may skip some matches.static NoSkipStrategynoSkip()Every possible match will be emitted.voidprune(Collection<ComputationState> matchesToPrune, Collection<Map<String, List<EventId>>> matchedResult, SharedBufferAccessor<?> sharedBufferAccessor) Prunes matches/partial matches based on the chosen strategy.protected abstract booleanshouldPrune(EventId startEventID, EventId pruningId) Tells if the partial/completed match starting at given id should be prunned by given pruningId.static SkipPastLastStrategyDiscards every partial match that started before emitted match ended.static SkipToFirstStrategyskipToFirst(String patternName) Discards every partial match that started before the first event of emitted match mapped to *PatternName*.static SkipToLastStrategyskipToLast(String patternName) Discards every partial match that started before the last event of emitted match mapped to *PatternName*.static AfterMatchSkipStrategyDiscards every partial match that started with the same event, emitted match was started.
-
Method Details
-
skipToFirst
Discards every partial match that started before the first event of emitted match mapped to *PatternName*.- Parameters:
patternName- the pattern name to skip to- Returns:
- the created AfterMatchSkipStrategy
-
skipToLast
Discards every partial match that started before the last event of emitted match mapped to *PatternName*.- Parameters:
patternName- the pattern name to skip to- Returns:
- the created AfterMatchSkipStrategy
-
skipPastLastEvent
Discards every partial match that started before emitted match ended.- Returns:
- the created AfterMatchSkipStrategy
-
skipToNext
Discards every partial match that started with the same event, emitted match was started.- Returns:
- the created AfterMatchSkipStrategy
-
noSkip
Every possible match will be emitted.- Returns:
- the created AfterMatchSkipStrategy
-
isSkipStrategy
public abstract boolean isSkipStrategy()Tells if the strategy may skip some matches.- Returns:
- false if the strategy is NO_SKIP strategy
-
getPruningId
Retrieves event id of the pruning element from the given match based on the strategy.- Parameters:
match- match corresponding to which should the pruning happen- Returns:
- pruning event id
-
getPatternName
Name of pattern that processing will be skipped to.
-