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

(cherry picked from commit 8e9502e05d)
This commit is contained in:
Vinayakumar B 2014-11-05 14:47:52 +05:30
parent 46c29b988d
commit 2d0c56e898
2 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -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();
}
}