You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by RebornHuan <gi...@git.apache.org> on 2017/07/20 01:33:53 UTC

[GitHub] flink pull request #4374: repalce map.put with putIfAbsent

GitHub user RebornHuan opened a pull request:

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

    repalce map.put with putIfAbsent

    Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
    If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the [How To Contribute guide](http://flink.apache.org/how-to-contribute.html).
    In addition to going through the list, please provide a meaningful description of your changes.
    
    - [ ] General
      - The pull request references the related JIRA issue ("[FLINK-XXX] Jira title text")
      - The pull request addresses only one issue
      - Each commit in the PR has a meaningful commit message (including the JIRA id)
    
    - [ ] Documentation
      - Documentation has been added for new functionality
      - Old documentation affected by the pull request has been updated
      - JavaDoc for public methods has been added
    
    - [ ] Tests & Build
      - Functionality added by the pull request is covered by tests
      - `mvn clean verify` has been executed successfully locally or a Travis build has passed


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

    $ git pull https://github.com/RebornHuan/flink master

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

    https://github.com/apache/flink/pull/4374.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 #4374
    
----
commit 11598c920a7c38ae8f914307982af8023eb49963
Author: RebornHuan <54...@qq.com>
Date:   2017-07-20T01:33:07Z

    repalce map.put with putIfAbsent

----


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

[GitHub] flink issue #4374: repalce map.put with putIfAbsent

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

    https://github.com/apache/flink/pull/4374
  
    but honestly, the previous approach just looks wrong: adding it and in case of a conflict reverting that `put` operation.
    What if (and I'm walking in the dark here) something already operates on the invalidly registered task (is this run in parallel?). I cannot spot any parallel use though...


---

[GitHub] flink issue #4374: repalce map.put with putIfAbsent

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

    https://github.com/apache/flink/pull/4374
  
    @RebornHuan please provide a brief description of the purpose of this change.


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

[GitHub] flink issue #4374: repalce map.put with putIfAbsent

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

    https://github.com/apache/flink/pull/4374
  
    Although this totally makes sense and would be nice to change, we cannot merge it until Java 7 has been dropped (as you see from the TravisCI runs).


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

[GitHub] flink issue #4374: repalce map.put with putIfAbsent

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

    https://github.com/apache/flink/pull/4374
  
    @RebornHuan although this change looks to be correct and makes good use of the newer API, there is a trade-off between deleting a line of code called during an error condition and the risk of such small refactorings. I don't think we have a demonstrated benefit to making this change.


---