Hi,
i am reading flink-cep source code based on release-1.3.2 . I cant understand here , can anyone help me on this in NFACompiler? private List<Tuple2<IterativeCondition<T>, String>> getCurrentNotCondition() { List<Tuple2<IterativeCondition<T>, String>> notConditions = new ArrayList<>(); Pattern<T, ? extends T> previousPattern = currentPattern; while (previousPattern.getPrevious() != null && ( previousPattern.getPrevious().getQuantifier().hasProperty(Quantifier.QuantifierProperty.OPTIONAL) || previousPattern.getPrevious().getQuantifier().getConsumingStrategy() == Quantifier.ConsumingStrategy.NOT_FOLLOW)) { previousPattern = previousPattern.getPrevious(); if (previousPattern.getQuantifier().getConsumingStrategy() == Quantifier.ConsumingStrategy.NOT_FOLLOW) { final IterativeCondition<T> notCondition = (IterativeCondition<T>) previousPattern.getCondition(); notConditions.add(Tuple2.of(notCondition, previousPattern.getName())); } } return notConditions; } it choose the pattern "hasProperty(Quantifier.QuantifierProperty.OPTIONAL)" or "Quantifier.ConsumingStrategy.NOT_FOLLOW" but it just add it to notConditions when it is "Quantifier.ConsumingStrategy.NOT_FOLLOW" is there something wrong -- Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/ |
Hi,
It is a very low level detail of the CEP library, that should be transparent for the end-user. However, just to clarify it a bit, it is expected. The reason behind this function is to create an optional path that bypasses all optional states. NOT_FOLLOW is treated as part of optional path, but in contrast to OPTIONAL its condition should be taken into account into the combined condition. Hope it helps. Regards, Dawid > On 5 Mar 2018, at 10:42, aitozi <[hidden email]> wrote: > > Hi, > > i am reading flink-cep source code based on release-1.3.2 . I cant > understand here , can anyone help me on this in NFACompiler? > > private List<Tuple2<IterativeCondition<T>, String>> > getCurrentNotCondition() { > List<Tuple2<IterativeCondition<T>, String>> notConditions = new > ArrayList<>(); > > Pattern<T, ? extends T> previousPattern = currentPattern; > while (previousPattern.getPrevious() != null && ( > > previousPattern.getPrevious().getQuantifier().hasProperty(Quantifier.QuantifierProperty.OPTIONAL) > || > previousPattern.getPrevious().getQuantifier().getConsumingStrategy() == > Quantifier.ConsumingStrategy.NOT_FOLLOW)) { > > previousPattern = previousPattern.getPrevious(); > > if (previousPattern.getQuantifier().getConsumingStrategy() == > Quantifier.ConsumingStrategy.NOT_FOLLOW) { > final IterativeCondition<T> notCondition = (IterativeCondition<T>) > previousPattern.getCondition(); > notConditions.add(Tuple2.of(notCondition, previousPattern.getName())); > } > } > return notConditions; > } > > it choose the pattern "hasProperty(Quantifier.QuantifierProperty.OPTIONAL)" > or "Quantifier.ConsumingStrategy.NOT_FOLLOW" but it just add it to > notConditions when it is "Quantifier.ConsumingStrategy.NOT_FOLLOW" is there > something wrong > > > > > -- > Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/ signature.asc (849 bytes) Download Attachment |
Then what is STOP state in NFA, i haven't seen this state in event pattern
match paper ? Does each Not pattern will be transformed to stop state? -- Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/ |
Free forum by Nabble | Edit this page |