flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dawidwys <...@git.apache.org>
Subject [GitHub] flink pull request #3624: [FLINK-6197] [cep] Add support for iterative condi...
Date Tue, 28 Mar 2017 08:11:30 GMT
Github user dawidwys commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3624#discussion_r108355802
  
    --- Diff: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/NFA.java ---
    @@ -553,9 +559,38 @@ private int calculateIncreasingSelfState(int ignoreBranches, int
takeBranches) {
     		return outgoingEdges;
     	}
     
    +	private boolean checkFilterCondition(ComputationState<T> computationState, IterativeCondition<T>
condition, T event) throws Exception {
    +		return condition == null || condition.filter(event, computationState.getConditionContext());
    +	}
    +
    +	Map<String, List<T>> extractCurrentMatches(final ComputationState<T>
computationState) {
    +		if (computationState.getPreviousState() == null) {
    +			return new HashMap<>();
    +		}
    +
    +		Collection<LinkedHashMultimap<String, T>> paths = stringSharedBuffer.extractPatterns(
    +				computationState.getPreviousState().getName(),
    +				computationState.getEvent(),
    +				computationState.getTimestamp(),
    +				computationState.getVersion());
     
    -	private boolean checkFilterCondition(FilterFunction<T> condition, T event) throws
Exception {
    -		return condition == null || condition.filter(event);
    +		// for a given computation state, we cannot have more than one matching patterns.
    +		Preconditions.checkArgument(paths.size() <= 1);
    --- End diff --
    
    How about checkState? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message