LiuGuH opened a new pull request, #6390:
URL: https://github.com/apache/hadoop/pull/6390

   <!--
     Thanks for sending a pull request!
       1. If this is your first time, please read our contributor guidelines: 
https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
       2. Make sure your PR title starts with JIRA issue id, e.g., 
'HADOOP-17799. Your PR title ...'.
   -->
   
   ### Description of PR
   
   With [HDFS-17116](https://issues.apache.org/jira/browse/HDFS-17116), Router 
safemode check contidition use monotonicNow(). 
   
   For code in  RouterSafemodeService.periodicInvoke()
   ```
   long now = monotonicNow();
   long cacheUpdateTime = stateStore.getCacheUpdateTime();
   boolean isCacheStale = (now - cacheUpdateTime) > this.staleInterval;
   ```
   
   
    
   Function monotonicNow() is implemented with System.nanoTime(). 
   
   System.nanoTime() in javadoc description:
   ```
   This method can only be used to measure elapsed time and is not related to 
any other notion of system or wall-clock time. The value returned represents 
nanoseconds since some fixed but arbitrary origin time (perhaps in the future, 
so values may be negative). 
   ```
   
    
   The following situation maybe exists :
   
   If refreshCaches  is not success in the beginning, cacheUpdateTime will be 0 
, and now - cacheUpdateTime is arbitrary origin time,so isCacheStale maybe  be 
true or false.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to