hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vinayakum...@apache.org
Subject git commit: HADOOP-11271. Use Time.monotonicNow() in Shell.java instead of Time.now() (Contributed by Vinayakumar B)
Date Wed, 05 Nov 2014 09:19:50 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 46c29b988 -> 2d0c56e89


HADOOP-11271. Use Time.monotonicNow() in Shell.java instead of Time.now() (Contributed by
Vinayakumar B)

(cherry picked from commit 8e9502e05d09e31b76fda7cc6691e78a39db8de6)


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

Branch: refs/heads/branch-2
Commit: 2d0c56e8985713075735622a6033ba4713e52b9d
Parents: 46c29b9
Author: Vinayakumar B <vinayakumarb@apache.org>
Authored: Wed Nov 5 14:47:52 2014 +0530
Committer: Vinayakumar B <vinayakumarb@apache.org>
Committed: Wed Nov 5 14:49:19 2014 +0530

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt                  | 3 +++
 .../src/main/java/org/apache/hadoop/util/Shell.java              | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/2d0c56e8/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 0c1e746..6aefdec 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -54,6 +54,9 @@ Release 2.7.0 - UNRELEASED
 
     HADOOP-11269. Add java 8 profile for hadoop-annotations. (Li Lu via wheat9)
 
+    HADOOP-11271. Use Time.monotonicNow() in Shell.java instead of Time.now()
+    (vinayakumarb)
+
 Release 2.6.0 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/2d0c56e8/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
index bd25b9d..a44e992 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
@@ -449,7 +449,7 @@ abstract public class Shell {
 
   /** check to see if a command needs to be executed and execute if needed */
   protected void run() throws IOException {
-    if (lastTime + interval > Time.now())
+    if (lastTime + interval > Time.monotonicNow())
       return;
     exitCode = 0; // reset for next run
     runCommand();
@@ -578,7 +578,7 @@ abstract public class Shell {
         LOG.warn("Error while closing the error stream", ioe);
       }
       process.destroy();
-      lastTime = Time.now();
+      lastTime = Time.monotonicNow();
     }
   }
 


Mime
View raw message