From 1c4a798505a2bc8285b709188f6492dbb33a0968 Mon Sep 17 00:00:00 2001 From: Anu Engineer Date: Sat, 23 Sep 2017 11:56:34 -0700 Subject: [PATCH] HADOOP-14894. ReflectionUtils should use Time.monotonicNow to mesaure duration. Contributed by Bharat Viswanadham. --- .../src/main/java/org/apache/hadoop/util/ReflectionUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ReflectionUtils.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ReflectionUtils.java index f1294e7610..ff7357a175 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ReflectionUtils.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/ReflectionUtils.java @@ -212,7 +212,7 @@ public static void logThreadInfo(Log log, boolean dumpStack = false; if (log.isInfoEnabled()) { synchronized (ReflectionUtils.class) { - long now = Time.now(); + long now = Time.monotonicNow(); if (now - previousLogTime >= minInterval * 1000) { previousLogTime = now; dumpStack = true; @@ -241,7 +241,7 @@ public static void logThreadInfo(Logger log, boolean dumpStack = false; if (log.isInfoEnabled()) { synchronized (ReflectionUtils.class) { - long now = Time.now(); + long now = Time.monotonicNow(); if (now - previousLogTime >= minInterval * 1000) { previousLogTime = now; dumpStack = true;