Class AfterMatchSkipStrategy

    • Method Detail

      • skipToFirst

        public static SkipToFirstStrategy skipToFirst​(String patternName)
        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

        public static SkipToLastStrategy skipToLast​(String patternName)
        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

        public static SkipPastLastStrategy skipPastLastEvent()
        Discards every partial match that started before emitted match ended.
        Returns:
        the created AfterMatchSkipStrategy
      • skipToNext

        public static AfterMatchSkipStrategy skipToNext()
        Discards every partial match that started with the same event, emitted match was started.
        Returns:
        the created AfterMatchSkipStrategy
      • noSkip

        public static NoSkipStrategy 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
      • prune

        public void prune​(Collection<ComputationState> matchesToPrune,
                          Collection<Map<String,​List<EventId>>> matchedResult,
                          SharedBufferAccessor<?> sharedBufferAccessor)
                   throws Exception
        Prunes matches/partial matches based on the chosen strategy.
        Parameters:
        matchesToPrune - current partial matches
        matchedResult - already completed matches
        sharedBufferAccessor - accessor to corresponding shared buffer
        Throws:
        Exception - thrown if could not access the state
      • shouldPrune

        protected abstract boolean shouldPrune​(EventId startEventID,
                                               EventId pruningId)
        Tells if the partial/completed match starting at given id should be prunned by given pruningId.
        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 abstract EventId getPruningId​(Collection<Map<String,​List<EventId>>> match)
        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

        public Optional<String> getPatternName()
        Name of pattern that processing will be skipped to.