Github user kl0u commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2361#discussion_r97789900
  
    --- Diff: 
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/compiler/NFACompiler.java
 ---
    @@ -130,26 +114,166 @@
                        }
     
                        // add the beginning state
    -                   final State<T> beginningState;
    +                   State<T> beginningState = 
states.get(BEGINNING_STATE_NAME);;
    +                   addTransitions(beginningState, -1, patterns, states);
    +                   return new NFAFactoryImpl<T>(inputTypeSerializer, 
windowTime, new HashSet<>(states.values()), timeoutHandling);
    +           }
    +   }
     
    -                   if (states.containsKey(BEGINNING_STATE_NAME)) {
    -                           beginningState = 
states.get(BEGINNING_STATE_NAME);
    -                   } else {
    -                           beginningState = new 
State<>(BEGINNING_STATE_NAME, State.StateType.Start);
    -                           states.put(BEGINNING_STATE_NAME, 
beginningState);
    -                   }
    +   private static <T> void addTransitions(State<T> currentState, int 
patternPos, ArrayList<Pattern<T, ?>> patterns, Map<String, State<T>> states) {
    --- End diff --
    
    The `patterns` can become a `List` instead of `ArrayList`.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to