You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2014/05/30 16:00:08 UTC

git commit: HBASE-11267 Dynamic metrics2 metrics may consume large amount of heap memory

Repository: hbase
Updated Branches:
  refs/heads/0.98 c4b119ca8 -> ebc6fbc21


HBASE-11267 Dynamic metrics2 metrics may consume large amount of heap memory


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/ebc6fbc2
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ebc6fbc2
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ebc6fbc2

Branch: refs/heads/0.98
Commit: ebc6fbc2190bd4dc6d484d6b61bf20408c1ff5e9
Parents: c4b119c
Author: Ted Yu <te...@apache.org>
Authored: Fri May 30 13:59:49 2014 +0000
Committer: Ted Yu <te...@apache.org>
Committed: Fri May 30 13:59:49 2014 +0000

----------------------------------------------------------------------
 .../hadoop/metrics2/lib/DynamicMetricsRegistry.java | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ebc6fbc2/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/DynamicMetricsRegistry.java
----------------------------------------------------------------------
diff --git a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/DynamicMetricsRegistry.java b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/DynamicMetricsRegistry.java
index 8314c92..daff9f5 100644
--- a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/DynamicMetricsRegistry.java
+++ b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/DynamicMetricsRegistry.java
@@ -99,7 +99,7 @@ public class DynamicMetricsRegistry {
    * @return a new counter object
    */
   public MutableCounterInt newCounter(String name, String desc, int iVal) {
-    return newCounter(Interns.info(name, desc), iVal);
+    return newCounter(new MetricsInfoImpl(name, desc), iVal);
   }
 
   /**
@@ -121,7 +121,7 @@ public class DynamicMetricsRegistry {
    * @return a new counter object
    */
   public MutableCounterLong newCounter(String name, String desc, long iVal) {
-    return newCounter(Interns.info(name, desc), iVal);
+    return newCounter(new MetricsInfoImpl(name, desc), iVal);
   }
 
   /**
@@ -143,7 +143,7 @@ public class DynamicMetricsRegistry {
    * @return a new gauge object
    */
   public MutableGaugeInt newGauge(String name, String desc, int iVal) {
-    return newGauge(Interns.info(name, desc), iVal);
+    return newGauge(new MetricsInfoImpl(name, desc), iVal);
   }
   /**
    * Create a mutable integer gauge
@@ -164,7 +164,7 @@ public class DynamicMetricsRegistry {
    * @return a new gauge object
    */
   public MutableGaugeLong newGauge(String name, String desc, long iVal) {
-    return newGauge(Interns.info(name, desc), iVal);
+    return newGauge(new MetricsInfoImpl(name, desc), iVal);
   }
 
   /**
@@ -342,7 +342,7 @@ public class DynamicMetricsRegistry {
    */
   public DynamicMetricsRegistry tag(String name, String description, String value,
                              boolean override) {
-    return tag(Interns.info(name, description), value, override);
+    return tag(new MetricsInfoImpl(name, description), value, override);
   }
 
   /**
@@ -422,7 +422,7 @@ public class DynamicMetricsRegistry {
     if (metric == null) {
 
       //Create the potential new gauge.
-      MutableGaugeLong newGauge = new MutableGaugeLong(Interns.info(gaugeName, ""),
+      MutableGaugeLong newGauge = new MutableGaugeLong(new MetricsInfoImpl(gaugeName, ""),
               potentialStartingValue);
 
       // Try and put the gauge in.  This is atomic.
@@ -454,7 +454,7 @@ public class DynamicMetricsRegistry {
     MutableMetric counter = metricsMap.get(counterName);
     if (counter == null) {
       MutableCounterLong newCounter =
-              new MutableCounterLong(Interns.info(counterName, ""), potentialStartingValue);
+              new MutableCounterLong(new MetricsInfoImpl(counterName, ""), potentialStartingValue);
       counter = metricsMap.putIfAbsent(counterName, newCounter);
       if (counter == null) {
         return newCounter;
@@ -475,7 +475,7 @@ public class DynamicMetricsRegistry {
     MutableMetric histo = metricsMap.get(histoName);
     if (histo == null) {
       MutableHistogram newCounter =
-          new MutableHistogram(Interns.info(histoName, ""));
+          new MutableHistogram(new MetricsInfoImpl(histoName, ""));
       histo = metricsMap.putIfAbsent(histoName, newCounter);
       if (histo == null) {
         return newCounter;