@Override protected EventId getPruningId(Collection<Map<String, List<EventId>>> match) { EventId pruningId = null; for (Map<String, List<EventId>> resultMap : match) { List<EventId> pruningPattern = resultMap.get(patternName); if (pruningPattern == null || pruningPattern.isEmpty()) { if (shouldThrowException) { throw new FlinkRuntimeException(String.format( "Could not skip to %s. No such element in the found match %s", patternName, resultMap)); } } else { pruningId = max(pruningId, pruningPattern.get(getIndex(pruningPattern.size()))); } if (shouldThrowException) { EventId startEvent = resultMap.values() .stream() .flatMap(Collection::stream) .min(EventId::compareTo) .orElseThrow(() -> new IllegalStateException("Cannot prune based on empty match")); if (pruningId != null && pruningId.equals(startEvent)) { throw new FlinkRuntimeException("Could not skip to first element of a match."); } } } return pruningId; }
@Override protected EventId getPruningId(Collection<Map<String, List<EventId>>> match) { EventId pruningId = null; for (Map<String, List<EventId>> resultMap : match) { List<EventId> pruningPattern = resultMap.get(patternName); if (pruningPattern == null || pruningPattern.isEmpty()) { if (shouldThrowException) { throw new FlinkRuntimeException(String.format( "Could not skip to %s. No such element in the found match %s", patternName, resultMap)); } } else { pruningId = max(pruningId, pruningPattern.get(getIndex(pruningPattern.size()))); } if (shouldThrowException) { EventId startEvent = resultMap.values() .stream() .flatMap(Collection::stream) .min(EventId::compareTo) .orElseThrow(() -> new IllegalStateException("Cannot prune based on empty match")); if (pruningId != null && pruningId.equals(startEvent)) { throw new FlinkRuntimeException("Could not skip to first element of a match."); } } } return pruningId; }
@Override protected EventId getPruningId(Collection<Map<String, List<EventId>>> match) { EventId pruningId = null; for (Map<String, List<EventId>> resultMap : match) { List<EventId> pruningPattern = resultMap.get(patternName); if (pruningPattern == null || pruningPattern.isEmpty()) { if (shouldThrowException) { throw new FlinkRuntimeException(String.format( "Could not skip to %s. No such element in the found match %s", patternName, resultMap)); } } else { pruningId = max(pruningId, pruningPattern.get(getIndex(pruningPattern.size()))); } if (shouldThrowException) { EventId startEvent = resultMap.values() .stream() .flatMap(Collection::stream) .min(EventId::compareTo) .orElseThrow(() -> new IllegalStateException("Cannot prune based on empty match")); if (pruningId != null && pruningId.equals(startEvent)) { throw new FlinkRuntimeException("Could not skip to first element of a match."); } } } return pruningId; }