Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-6536

Improve error message in SharedBuffer::put()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.3.0
    • Component/s: CEP
    • Labels:
      None

      Issue Links

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user kl0u closed the pull request at:

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

        Show
        githubbot ASF GitHub Bot added a comment - Github user kl0u closed the pull request at: https://github.com/apache/flink/pull/3872
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user kl0u commented on the issue:

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

        Merged.

        Show
        githubbot ASF GitHub Bot added a comment - Github user kl0u commented on the issue: https://github.com/apache/flink/pull/3872 Merged.
        Hide
        kkl0u Kostas Kloudas added a comment -

        Merged at 02ea418fb307876e1b957cad6be619a4d035d829 in master.

        Show
        kkl0u Kostas Kloudas added a comment - Merged at 02ea418fb307876e1b957cad6be619a4d035d829 in master.
        Hide
        githubbot ASF GitHub Bot added a comment -

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

        https://github.com/apache/flink/pull/3872#discussion_r116444685

        — Diff: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java —
        @@ -96,10 +96,11 @@ public void put(

        // sanity check whether we've found the previous element
        if (previousSharedBufferEntry == null && previousValue != null) {

        • throw new IllegalStateException("Could not find previous shared buffer entry with " +
          + throw new IllegalStateException("Could not find previous entry with " +
          "key: " + previousKey + ", value: " + previousValue + " and timestamp: " +
        • previousTimestamp + ". This can indicate that the element belonging to the previous " +
        • "relation has been already pruned, even though you expect it to be still there.");
          + previousTimestamp + ". This can indicate that either you did not implement " +
          + "the equals() and hashCode() methods of your input elements properly or that " +
          + "the element belonging to that entry has been already pruned.");
            • End diff –

        You are right @dawidwys but I think that now the message makes clear that you should always implement `equals()` and `hashCode()`. So far it was only in the docs.

        Show
        githubbot ASF GitHub Bot added a comment - Github user kl0u commented on a diff in the pull request: https://github.com/apache/flink/pull/3872#discussion_r116444685 — Diff: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java — @@ -96,10 +96,11 @@ public void put( // sanity check whether we've found the previous element if (previousSharedBufferEntry == null && previousValue != null) { throw new IllegalStateException("Could not find previous shared buffer entry with " + + throw new IllegalStateException("Could not find previous entry with " + "key: " + previousKey + ", value: " + previousValue + " and timestamp: " + previousTimestamp + ". This can indicate that the element belonging to the previous " + "relation has been already pruned, even though you expect it to be still there."); + previousTimestamp + ". This can indicate that either you did not implement " + + "the equals() and hashCode() methods of your input elements properly or that " + + "the element belonging to that entry has been already pruned."); End diff – You are right @dawidwys but I think that now the message makes clear that you should always implement `equals()` and `hashCode()`. So far it was only in the docs.
        Hide
        githubbot ASF GitHub Bot added a comment -

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

        https://github.com/apache/flink/pull/3872#discussion_r116444058

        — Diff: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java —
        @@ -96,10 +96,11 @@ public void put(

        // sanity check whether we've found the previous element
        if (previousSharedBufferEntry == null && previousValue != null) {

        • throw new IllegalStateException("Could not find previous shared buffer entry with " +
          + throw new IllegalStateException("Could not find previous entry with " +
          "key: " + previousKey + ", value: " + previousValue + " and timestamp: " +
        • previousTimestamp + ". This can indicate that the element belonging to the previous " +
        • "relation has been already pruned, even though you expect it to be still there.");
          + previousTimestamp + ". This can indicate that either you did not implement " +
          + "the equals() and hashCode() methods of your input elements properly or that " +
          + "the element belonging to that entry has been already pruned.");
            • End diff –

        Been thinking about this exception message and those two reasons for the exception come from "two different worlds".

        1. if element has been pruned - from user perspective this means some error in CEP library occured and the user can not do much about it.
        2. the equals() and hashCode() are obvious user mistakes.

        Not sure if we should do sth with it, but just wanted to express my thoughts on it.

        Show
        githubbot ASF GitHub Bot added a comment - Github user dawidwys commented on a diff in the pull request: https://github.com/apache/flink/pull/3872#discussion_r116444058 — Diff: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java — @@ -96,10 +96,11 @@ public void put( // sanity check whether we've found the previous element if (previousSharedBufferEntry == null && previousValue != null) { throw new IllegalStateException("Could not find previous shared buffer entry with " + + throw new IllegalStateException("Could not find previous entry with " + "key: " + previousKey + ", value: " + previousValue + " and timestamp: " + previousTimestamp + ". This can indicate that the element belonging to the previous " + "relation has been already pruned, even though you expect it to be still there."); + previousTimestamp + ". This can indicate that either you did not implement " + + "the equals() and hashCode() methods of your input elements properly or that " + + "the element belonging to that entry has been already pruned."); End diff – Been thinking about this exception message and those two reasons for the exception come from "two different worlds". 1. if element has been pruned - from user perspective this means some error in CEP library occured and the user can not do much about it. 2. the equals() and hashCode() are obvious user mistakes. Not sure if we should do sth with it, but just wanted to express my thoughts on it.
        Hide
        githubbot ASF GitHub Bot added a comment -

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

        https://github.com/apache/flink/pull/3872#discussion_r116017704

        — Diff: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java —
        @@ -96,10 +96,11 @@ public void put(

        // sanity check whether we've found the previous element
        if (previousSharedBufferEntry == null && previousValue != null) {

        • throw new IllegalStateException("Could not find previous shared buffer entry with " +
          + throw new IllegalStateException("Could not find previous entry with " +
          "key: " + previousKey + ", value: " + previousValue + " and timestamp: " +
        • previousTimestamp + ". This can indicate that the element belonging to the previous " +
        • "relation has been already pruned, even though you expect it to be still there.");
          + previousTimestamp + ". This can indicate that either you did not implement " +
          + "the equals() and hashCode() methods, of your input elements properly or that " +
            • End diff –

        I think the comma is superfluous.

        Show
        githubbot ASF GitHub Bot added a comment - Github user aljoscha commented on a diff in the pull request: https://github.com/apache/flink/pull/3872#discussion_r116017704 — Diff: flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/nfa/SharedBuffer.java — @@ -96,10 +96,11 @@ public void put( // sanity check whether we've found the previous element if (previousSharedBufferEntry == null && previousValue != null) { throw new IllegalStateException("Could not find previous shared buffer entry with " + + throw new IllegalStateException("Could not find previous entry with " + "key: " + previousKey + ", value: " + previousValue + " and timestamp: " + previousTimestamp + ". This can indicate that the element belonging to the previous " + "relation has been already pruned, even though you expect it to be still there."); + previousTimestamp + ". This can indicate that either you did not implement " + + "the equals() and hashCode() methods, of your input elements properly or that " + End diff – I think the comma is superfluous.
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user kl0u opened a pull request:

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

        FLINK-6536 [cep] Improve error message in SharedBuffer::put().

        There are two commits that address both FLINK-6536 and FLINK-6255.

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

        $ git pull https://github.com/kl0u/flink cep-misc

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

        https://github.com/apache/flink/pull/3872.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 #3872


        commit ee4db435565f7e1ab53e96f179f4ee970173900c
        Author: kl0u <kkloudas@gmail.com>
        Date: 2017-05-11T09:39:00Z

        FLINK-6536 [cep] Improve error message in SharedBuffer::put().

        commit 3b7f7227b843235514521dbe495d407fe8f31af3
        Author: kl0u <kkloudas@gmail.com>
        Date: 2017-05-11T09:58:14Z

        FLINK-6255 [cep] Remove PatternStream.getSideOutput().


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user kl0u opened a pull request: https://github.com/apache/flink/pull/3872 FLINK-6536 [cep] Improve error message in SharedBuffer::put(). There are two commits that address both FLINK-6536 and FLINK-6255 . You can merge this pull request into a Git repository by running: $ git pull https://github.com/kl0u/flink cep-misc Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3872.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 #3872 commit ee4db435565f7e1ab53e96f179f4ee970173900c Author: kl0u <kkloudas@gmail.com> Date: 2017-05-11T09:39:00Z FLINK-6536 [cep] Improve error message in SharedBuffer::put(). commit 3b7f7227b843235514521dbe495d407fe8f31af3 Author: kl0u <kkloudas@gmail.com> Date: 2017-05-11T09:58:14Z FLINK-6255 [cep] Remove PatternStream.getSideOutput().

          People

          • Assignee:
            kkl0u Kostas Kloudas
            Reporter:
            kkl0u Kostas Kloudas
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development