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 NoSkipStrategy |
noSkip()
Every possible match will be emitted.
|
void |
prune(Collection<ComputationState> matchesToPrune,
Collection<Map<String,List<EventId>>> matchedResult,
SharedBufferAccessor<?> sharedBufferAccessor)
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 SkipPastLastStrategy |
skipPastLastEvent()
Discards every partial match that started before emitted match ended.
|
static SkipToFirstStrategy |
skipToFirst(String patternName)
Discards every partial match that started before the first event of emitted match mapped to
*PatternName*.
|
static SkipToLastStrategy |
skipToLast(String patternName)
Discards every partial match that started before the last event of emitted match mapped to
*PatternName*.
|
static AfterMatchSkipStrategy |
skipToNext()
Discards every partial match that started with the same event, emitted match was started.
|
public static SkipToFirstStrategy skipToFirst(String patternName)
patternName
- the pattern name to skip topublic static SkipToLastStrategy skipToLast(String patternName)
patternName
- the pattern name to skip topublic static SkipPastLastStrategy skipPastLastEvent()
public static AfterMatchSkipStrategy skipToNext()
public static NoSkipStrategy noSkip()
public abstract boolean isSkipStrategy()
public void prune(Collection<ComputationState> matchesToPrune, Collection<Map<String,List<EventId>>> matchedResult, SharedBufferAccessor<?> sharedBufferAccessor) throws Exception
matchesToPrune
- current partial matchesmatchedResult
- already completed matchessharedBufferAccessor
- accessor to 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–2024 The Apache Software Foundation. All rights reserved.