Github user kl0u commented on the issue:

    https://github.com/apache/flink/pull/4172
  
    @dianfu So this is a plan that can work to avoid having to generate the 
code of the `IterativeCondition` every time. This came also after discussion 
with @fhueske who also explained me how things are done in the SQL part. So 
here we go:
    
    1) You will start with a String which contains the user's query. 
    2) You analyze the query and generate the code that corresponds to the 
`IterativeCondition`.
        2i) The code goes into a `Wrapper` class, which extends the 
`IterativeCondition` and keeps only 2 `String`s: the code of the condition and 
a unique name for the condition.
        2ii) This `Wrapper`s is passed to the `Pattern` and the `CEPOperator`.
    **THE JOB IS SUBMITTED**
    3) At the `open()`, the `CEPOperator` checks the states if they have actual 
`IterativeConditions` or `Wrapper` (which is a subclass of the 
`IterativeCondition`), and if yes:
        3i) it gets the name and the code and compiles the code to an actual 
`IterativeCondition`, which is then stored instead of the `Wrapper`.
    
    This way we have to compile only once, at the `open()` of the operator, and 
not every time.
    What do you think?



---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to