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 #4296: [FLINK-7147] [cep] Support greedy quantifier in CE...
Date Mon, 07 Aug 2017 11:07:57 GMT
Github user dawidwys commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4296#discussion_r131628087
  
    --- Diff: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/compiler/NFACompiler.java
---
    @@ -637,9 +675,23 @@ private boolean isPatternOptional(Pattern<T, ?> pattern) {
     				untilCondition,
     				true);
     
    -			final IterativeCondition<T> proceedCondition = getTrueFunction();
    +			IterativeCondition<T> proceedCondition = getTrueFunction();
     			final State<T> loopingState = createState(currentPattern.getName(), State.StateType.Normal);
    -			loopingState.addProceed(sinkState, proceedCondition);
    +
    +			if (currentPattern.getQuantifier().hasProperty(Quantifier.QuantifierProperty.GREEDY))
{
    +				State<T> sinkStateCopy = copy(sinkState);
    --- End diff --
    
    If I understood correctly the copies are needed only in casese where there is the `untilCondition`.
Am I right? If so let's create the copy then. Right know there are dangling copies of the
next when there is no `untilCondtion`.


---
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