You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by jinmingjian <gi...@git.apache.org> on 2017/02/21 23:23:19 UTC

[GitHub] flink pull request #3384: [FLINK-4422] Convert all time interval measurement...

GitHub user jinmingjian opened a pull request:

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

    [FLINK-4422] Convert all time interval measurements to System.nanoTime() - flink-clients

    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.
    
    - [x] 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
    
    - [x] 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/jinmingjian/flink FLINK-4422-1

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

    https://github.com/apache/flink/pull/3384.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 #3384
    
----
commit a08f79f192d929ad60f1b898eed87230b31a499e
Author: Jin Mingjian <ji...@gmail.com>
Date:   2017-02-21T14:43:54Z

    [FLINK-4422] Convert all time interval measurements to System.nanoTime() - flink-clients

----


---
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 pull request #3384: [FLINK-4422] Convert all time interval measurement...

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

    https://github.com/apache/flink/pull/3384#discussion_r102427597
  
    --- Diff: flink-clients/src/test/java/org/apache/flink/client/program/ClientConnectionTest.java ---
    @@ -115,13 +115,13 @@ public void run() {
     
     			try {
     				// wait until the caller is successful, for at most the given time
    -				long now = System.currentTimeMillis();
    -				long deadline = now + MAX_DELAY;
    +				long now = System.nanoTime();
    +				long deadline = now + MAX_DELAY*1000000;
    --- End diff --
    
    missing spaces around ```*```


---
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 pull request #3384: [FLINK-4422] Convert all time interval measurement...

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

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


---
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 #3384: [FLINK-4422] Convert all time interval measurements to Sy...

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

    https://github.com/apache/flink/pull/3384
  
    Looks good, +1 to merge
    
    Optional comment: I have seen that developers get confused when working with the code whether a `long` refers to a "millisecond" timestamp or to a "nanosecond" timestamp.
    
    One way to solve that is to put that into the variable names (like `MAX_DELAY_MILLIS` or `deadlineNanos`). Another way is to use only milliseconds everywhere. Something like https://github.com/apache/flink/blob/master/flink-runtime/src/main/java/org/apache/flink/runtime/util/clock/Clock.java can help to get the milliseconds in a more readable way than using nanoTime and multiplying.


---
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 pull request #3384: [FLINK-4422] Convert all time interval measurement...

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

    https://github.com/apache/flink/pull/3384#discussion_r102428106
  
    --- Diff: flink-clients/src/test/java/org/apache/flink/client/program/ClientConnectionTest.java ---
    @@ -115,13 +115,13 @@ public void run() {
     
     			try {
     				// wait until the caller is successful, for at most the given time
    -				long now = System.currentTimeMillis();
    -				long deadline = now + MAX_DELAY;
    +				long now = System.nanoTime();
    +				long deadline = now + MAX_DELAY*1000000;
    --- End diff --
    
    I would suggest to express the million literal as `1_000_000` - that is easier to parse for the reader, making it easier to spot errors.


---
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 #3384: [FLINK-4422] Convert all time interval measurements to Sy...

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

    https://github.com/apache/flink/pull/3384
  
    Merging this...


---
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 pull request #3384: [FLINK-4422] Convert all time interval measurement...

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

    https://github.com/apache/flink/pull/3384#discussion_r102435330
  
    --- Diff: flink-clients/src/test/java/org/apache/flink/client/program/ClientConnectionTest.java ---
    @@ -115,13 +115,13 @@ public void run() {
     
     			try {
     				// wait until the caller is successful, for at most the given time
    -				long now = System.currentTimeMillis();
    -				long deadline = now + MAX_DELAY;
    +				long now = System.nanoTime();
    +				long deadline = now + MAX_DELAY*1000000;
    --- End diff --
    
    agree, although I commonly use 1000_000 in fact:) I planed to use [this detailed idea style](https://raw.githubusercontent.com/dawidwys/flink/bee981be8aa83225a8e3a736700eae445d79cece/tools/FlinkCodeStyle.xml) after digging today's discussions in mail list. Is this OK?:)


---
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.
---