HADOOP-14894. ReflectionUtils should use Time.monotonicNow to mesaure duration. Contributed by Bharat Viswanadham.

This commit is contained in:
Anu Engineer 2017-09-23 11:56:34 -07:00
parent 2a81af447f
commit 1c4a798505

View File

@ -212,7 +212,7 @@ public static void logThreadInfo(Log log,
boolean dumpStack = false; boolean dumpStack = false;
if (log.isInfoEnabled()) { if (log.isInfoEnabled()) {
synchronized (ReflectionUtils.class) { synchronized (ReflectionUtils.class) {
long now = Time.now(); long now = Time.monotonicNow();
if (now - previousLogTime >= minInterval * 1000) { if (now - previousLogTime >= minInterval * 1000) {
previousLogTime = now; previousLogTime = now;
dumpStack = true; dumpStack = true;
@ -241,7 +241,7 @@ public static void logThreadInfo(Logger log,
boolean dumpStack = false; boolean dumpStack = false;
if (log.isInfoEnabled()) { if (log.isInfoEnabled()) {
synchronized (ReflectionUtils.class) { synchronized (ReflectionUtils.class) {
long now = Time.now(); long now = Time.monotonicNow();
if (now - previousLogTime >= minInterval * 1000) { if (now - previousLogTime >= minInterval * 1000) {
previousLogTime = now; previousLogTime = now;
dumpStack = true; dumpStack = true;