hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jl...@apache.org
Subject hadoop git commit: MAPREDUCE-6967. gridmix/SleepReducer should use Time.monotonicNow for measuring durations. Contributed by Chetna Chaudhari
Date Fri, 22 Sep 2017 20:30:08 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 08fca508e -> b133dc570


MAPREDUCE-6967. gridmix/SleepReducer should use Time.monotonicNow for measuring durations.
Contributed by Chetna Chaudhari


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/b133dc57
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/b133dc57
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/b133dc57

Branch: refs/heads/trunk
Commit: b133dc5700b66318ac6d80e463b049723c511f37
Parents: 08fca50
Author: Jason Lowe <jlowe@apache.org>
Authored: Fri Sep 22 15:21:42 2017 -0500
Committer: Jason Lowe <jlowe@apache.org>
Committed: Fri Sep 22 15:21:42 2017 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/mapred/gridmix/SleepJob.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/b133dc57/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/SleepJob.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/SleepJob.java
b/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/SleepJob.java
index 6c2a048..87a67f1 100644
--- a/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/SleepJob.java
+++ b/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/SleepJob.java
@@ -52,6 +52,7 @@ import org.apache.hadoop.tools.rumen.TaskAttemptInfo;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.util.Time;
 
 public class SleepJob extends GridmixJob {
   public static final Log LOG = LogFactory.getLog(SleepJob.class);
@@ -184,7 +185,7 @@ public class SleepJob extends GridmixJob {
         TimeUnit.MILLISECONDS.convert(sleepInterval, TimeUnit.SECONDS);
       //This is to stop accumulating deviation from expected sleep time
       //over a period of time.
-      long start = System.currentTimeMillis();
+      long start = Time.monotonicNow();
       long slept = 0L;
       long sleep = 0L;
       while (slept < duration) {
@@ -192,7 +193,7 @@ public class SleepJob extends GridmixJob {
         sleep = Math.min(rem, RINTERVAL);
         context.setStatus("Sleeping... " + rem + " ms left");
         TimeUnit.MILLISECONDS.sleep(sleep);
-        slept = System.currentTimeMillis() - start;
+        slept = Time.monotonicNow() - start;
       }
     }
 


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


Mime
View raw message