public abstract class AfterMatchSkipStrategy extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
Optional<String> |
getPatternName()
Name of pattern that processing will be skipped to.
|
protected abstract EventId |
getPruningId(Collection<Map<String,List<EventId>>> match)
Retrieves event id of the pruning element from the given match based on the strategy.
|
abstract boolean |
isSkipStrategy()
Tells if the strategy may skip some matches.
|
static AfterMatchSkipStrategy |
noSkip()
Every possible match will be emitted.
|
void |
prune(Collection<ComputationState> matchesToPrune,
Collection<Map<String,List<EventId>>> matchedResult,
SharedBuffer<?> sharedBuffer)
Prunes matches/partial matches based on the chosen strategy.
|
protected abstract boolean |
shouldPrune(EventId startEventID,
EventId pruningId)
Tells if the partial/completed match starting at given id should be prunned by given pruningId.
|
static AfterMatchSkipStrategy |
skipPastLastEvent()
Discards every partial match that contains event of the match.
|
static AfterMatchSkipStrategy |
skipToFirst(String patternName)
Discards every partial match that contains event of the match preceding the first of *PatternName*.
|
static AfterMatchSkipStrategy |
skipToLast(String patternName)
Discards every partial match that contains event of the match preceding the last of *PatternName*.
|
public static AfterMatchSkipStrategy skipToFirst(String patternName)
patternName
- the pattern name to skip topublic static AfterMatchSkipStrategy skipToLast(String patternName)
patternName
- the pattern name to skip topublic static AfterMatchSkipStrategy skipPastLastEvent()
public static AfterMatchSkipStrategy noSkip()
public abstract boolean isSkipStrategy()
public void prune(Collection<ComputationState> matchesToPrune, Collection<Map<String,List<EventId>>> matchedResult, SharedBuffer<?> sharedBuffer) throws Exception
matchesToPrune
- current partial matchesmatchedResult
- already completed matchessharedBuffer
- corresponding shared bufferException
- thrown if could not access the stateprotected abstract boolean shouldPrune(EventId startEventID, EventId pruningId)
startEventID
- starting event id of a partial/completed matchpruningId
- pruningId calculated by this strategyprotected abstract EventId getPruningId(Collection<Map<String,List<EventId>>> match)
match
- match corresponding to which should the pruning happenCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.