You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2020/03/12 02:32:47 UTC

[GitHub] [hadoop] brfrn169 commented on a change in pull request #1889: HDFS-15215 The Timestamp for longest write/read lock held log is wrong

brfrn169 commented on a change in pull request #1889: HDFS-15215 The Timestamp for longest write/read lock held log is wrong
URL: https://github.com/apache/hadoop/pull/1889#discussion_r391371213
 
 

 ##########
 File path: hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/FakeTimer.java
 ##########
 @@ -29,17 +29,19 @@
 @InterfaceAudience.Private
 @InterfaceStability.Unstable
 public class FakeTimer extends Timer {
+  private long now;
   private long nowNanos;
 
   /** Constructs a FakeTimer with a non-zero value */
   public FakeTimer() {
     // Initialize with a non-trivial value.
+    now = 1577836800000L; // 2020-01-01 00:00:00,000+0000
 
 Review comment:
   Thank you for the comment.
   
   Actually, I think it's more real behavior than original one, because `Timer.now()` returns the time based on `System.currentTimeMillis()`, and `Timer.monotonicNow()` and `Timer.monotonicNowNanos()` return the time based on `System.nanoTime()`, which are different times. 
   
   This change is useful to verify the fix in this PR. Also, it doesn't break the existing tests.
   
   What do you think?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org