You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by medcv <gi...@git.apache.org> on 2018/06/07 22:00:33 UTC

[GitHub] flink pull request #6138: [FLINK-9550][DOC]FlinkCEP snippet example has some...

GitHub user medcv opened a pull request:

    https://github.com/apache/flink/pull/6138

    [FLINK-9550][DOC]FlinkCEP snippet example has some syntax errors

    
    ## What is the purpose of the change
    
    Fixing FlinkCEP snippet code syntax errors and data type mismatches 
    
    ## Does this pull request potentially affect one of the following parts:
    
      - Dependencies (does it add or upgrade a dependency): (no)
      - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
      - The serializers: (no)
      - The runtime per-record code paths (performance sensitive): (no)
      - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
      - The S3 file system connector: (no)
    
    ## Documentation
    
      - Does this pull request introduce a new feature? (no)
      - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/medcv/flink FLINK-9550

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/6138.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #6138
    
----
commit 4a5bc91bc2c326c1a38fd231d24b300b491b75cc
Author: Yadan.JS <y_...@...>
Date:   2018-06-07T21:52:27Z

    [FLINK-9550][DOC]FlinkCEP snippet example has some syntax errors

----


---

[GitHub] flink issue #6138: [FLINK-9550][DOC]FlinkCEP snippet example has some syntax...

Posted by medcv <gi...@git.apache.org>.
Github user medcv commented on the issue:

    https://github.com/apache/flink/pull/6138
  
    @dawidwys Thanks for the review! 


---

[GitHub] flink pull request #6138: [FLINK-9550][DOC]FlinkCEP snippet example has some...

Posted by medcv <gi...@git.apache.org>.
Github user medcv commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6138#discussion_r195749896
  
    --- Diff: docs/dev/libs/cep.md ---
    @@ -131,7 +131,7 @@ val result: DataStream[Alert] = patternStream.select(createAlert(_))
     The pattern API allows you to define complex pattern sequences that you want to extract from your input stream.
     
     Each complex pattern sequence consists of multiple simple patterns, i.e. patterns looking for individual events with the same properties. From now on, we will call these simple patterns **patterns**, and the final complex pattern sequence we are searching for in the stream, the **pattern sequence**. You can see a pattern sequence as a graph of such patterns, where transitions from one pattern to the next occur based on user-specified
    -*conditions*, e.g. `event.getName().equals("start")`. A **match** is a sequence of input events which visits all
    --- End diff --
    
    just to make it consistent with the `return event.getName().equals("end");` in the above snippet 


---

[GitHub] flink issue #6138: [FLINK-9550][DOC]FlinkCEP snippet example has some syntax...

Posted by medcv <gi...@git.apache.org>.
Github user medcv commented on the issue:

    https://github.com/apache/flink/pull/6138
  
    @dawidwys PR's been updated! Please review.


---

[GitHub] flink pull request #6138: [FLINK-9550][DOC]FlinkCEP snippet example has some...

Posted by medcv <gi...@git.apache.org>.
Github user medcv commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6138#discussion_r195749997
  
    --- Diff: docs/dev/libs/cep.md ---
    @@ -275,36 +275,38 @@ with "foo", and if the sum of the prices of the previously accepted events for t
     <div class="codetabs" markdown="1">
     <div data-lang="java" markdown="1">
     {% highlight java %}
    -middle.oneOrMore().where(new IterativeCondition<SubEvent>() {
    -    @Override
    -    public boolean filter(SubEvent value, Context<SubEvent> ctx) throws Exception {
    -        if (!value.getName().startsWith("foo")) {
    -            return false;
    -        }
    -
    -        double sum = value.getPrice();
    -        for (Event event : ctx.getEventsForPattern("middle")) {
    -            sum += event.getPrice();
    +middle.oneOrMore()
    +    .subtype(SubEvent.class)
    --- End diff --
    
    will update!


---

[GitHub] flink pull request #6138: [FLINK-9550][DOC]FlinkCEP snippet example has some...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/6138


---

[GitHub] flink pull request #6138: [FLINK-9550][DOC]FlinkCEP snippet example has some...

Posted by dawidwys <gi...@git.apache.org>.
Github user dawidwys commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6138#discussion_r195732236
  
    --- Diff: docs/dev/libs/cep.md ---
    @@ -131,7 +131,7 @@ val result: DataStream[Alert] = patternStream.select(createAlert(_))
     The pattern API allows you to define complex pattern sequences that you want to extract from your input stream.
     
     Each complex pattern sequence consists of multiple simple patterns, i.e. patterns looking for individual events with the same properties. From now on, we will call these simple patterns **patterns**, and the final complex pattern sequence we are searching for in the stream, the **pattern sequence**. You can see a pattern sequence as a graph of such patterns, where transitions from one pattern to the next occur based on user-specified
    -*conditions*, e.g. `event.getName().equals("start")`. A **match** is a sequence of input events which visits all
    --- End diff --
    
    Is this change necessary?


---

[GitHub] flink pull request #6138: [FLINK-9550][DOC]FlinkCEP snippet example has some...

Posted by dawidwys <gi...@git.apache.org>.
Github user dawidwys commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6138#discussion_r195736943
  
    --- Diff: docs/dev/libs/cep.md ---
    @@ -275,36 +275,38 @@ with "foo", and if the sum of the prices of the previously accepted events for t
     <div class="codetabs" markdown="1">
     <div data-lang="java" markdown="1">
     {% highlight java %}
    -middle.oneOrMore().where(new IterativeCondition<SubEvent>() {
    -    @Override
    -    public boolean filter(SubEvent value, Context<SubEvent> ctx) throws Exception {
    -        if (!value.getName().startsWith("foo")) {
    -            return false;
    -        }
    -
    -        double sum = value.getPrice();
    -        for (Event event : ctx.getEventsForPattern("middle")) {
    -            sum += event.getPrice();
    +middle.oneOrMore()
    +    .subtype(SubEvent.class)
    --- End diff --
    
    Either don't add the `subtype` clause or add it also in the scala example.


---

[GitHub] flink issue #6138: [FLINK-9550][DOC]FlinkCEP snippet example has some syntax...

Posted by dawidwys <gi...@git.apache.org>.
Github user dawidwys commented on the issue:

    https://github.com/apache/flink/pull/6138
  
    +1, merging


---