From aab9737a058c0bdeeb17c173e530b7e571315a56 Mon Sep 17 00:00:00 2001 From: Mingliang Liu Date: Wed, 16 Nov 2016 20:04:57 -0800 Subject: [PATCH] HADOOP-13822. Use GlobalStorageStatistics.INSTANCE.reset() at FileSystem#clearStatistics(). Contribute by Brahma Reddy Battula --- .../src/main/java/org/apache/hadoop/fs/FileSystem.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java index 529745cafc8..9e984559149 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java @@ -3719,12 +3719,7 @@ public abstract class FileSystem extends Configured implements Closeable { * Reset all statistics for all file systems */ public static synchronized void clearStatistics() { - final Iterator iterator = - GlobalStorageStatistics.INSTANCE.iterator(); - while (iterator.hasNext()) { - final StorageStatistics statistics = iterator.next(); - statistics.reset(); - } + GlobalStorageStatistics.INSTANCE.reset(); } /**