flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-4422) Convert all time interval measurements to System.nanoTime()
Date Tue, 28 Feb 2017 16:22:45 GMT

    [ https://issues.apache.org/jira/browse/FLINK-4422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15888364#comment-15888364
] 

ASF GitHub Bot commented on FLINK-4422:
---------------------------------------

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

    https://github.com/apache/flink/pull/3420#discussion_r103492897
  
    --- Diff: flink-connectors/flink-connector-kafka-0.8/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java
---
    @@ -355,13 +355,13 @@ public E getElementBlocking(long timeoutMillis) throws InterruptedException
{
     			throw new IllegalArgumentException("invalid timeout");
     		}
     		
    -		final long deadline = System.currentTimeMillis() + timeoutMillis;
    +		final long deadline = System.nanoTime() + timeoutMillis * 1_000_000L;
    --- End diff --
    
    Good points! Lets leave it as `timeoutMillis` then.


> Convert all time interval measurements to System.nanoTime()
> -----------------------------------------------------------
>
>                 Key: FLINK-4422
>                 URL: https://issues.apache.org/jira/browse/FLINK-4422
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Core
>            Reporter: Stephan Ewen
>            Assignee: Jin Mingjian
>            Priority: Minor
>
> In contrast to {{System.currentTimeMillis()}}, {{System.nanoTime()}} is monotonous. To
measure delays and time intervals, {{System.nanoTime()}} is hence reliable, while {{System.currentTimeMillis()}}
is not.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message