From 27b131e79c5fa99de3ed4fb529d854dd5da55bde Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Thu, 14 Apr 2016 10:55:51 +0900 Subject: [PATCH] HADOOP-12822. Change "Metrics intern cache overflow" log level from WARN to INFO. Contributed by Andras Bokor. --- .../org/apache/hadoop/metrics2/lib/Interns.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/lib/Interns.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/lib/Interns.java index 7ad6660caf..8e28367758 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/lib/Interns.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/lib/Interns.java @@ -18,15 +18,15 @@ package org.apache.hadoop.metrics2.lib; -import java.util.Map; -import java.util.LinkedHashMap; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.metrics2.MetricsInfo; import org.apache.hadoop.metrics2.MetricsTag; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.LinkedHashMap; +import java.util.Map; /** * Helpers to create interned metrics info @@ -34,7 +34,7 @@ @InterfaceAudience.Public @InterfaceStability.Evolving public class Interns { - private static final Log LOG = LogFactory.getLog(Interns.class); + private static final Logger LOG = LoggerFactory.getLogger(Interns.class); // A simple intern cache with two keys // (to avoid creating new (combined) key objects for lookup) @@ -47,7 +47,7 @@ private static abstract class CacheWith2Keys { protected boolean removeEldestEntry(Map.Entry> e) { boolean overflow = expireKey1At(size()); if (overflow && !gotOverflow) { - LOG.warn("Metrics intern cache overflow at "+ size() +" for "+ e); + LOG.info("Metrics intern cache overflow at {} for {}", size(), e); gotOverflow = true; } return overflow; @@ -67,7 +67,7 @@ synchronized V add(K1 k1, K2 k2) { @Override protected boolean removeEldestEntry(Map.Entry e) { boolean overflow = expireKey2At(size()); if (overflow && !gotOverflow) { - LOG.warn("Metrics intern cache overflow at "+ size() +" for "+ e); + LOG.info("Metrics intern cache overflow at {} for {}", size(), e); gotOverflow = true; } return overflow;