Author: jlowe
Date: Sat Apr 27 04:19:47 2013
New Revision: 1476489

URL: http://svn.apache.org/r1476489
Log:
svn merge -c 1476487 FIXES: HADOOP-9504. MetricsDynamicMBeanBase has 
concurrency issues in createMBeanInfo. Contributed by Liang Xie

Modified:
    
hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
    
hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java

Modified: 
hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1476489&r1=1476488&r2=1476489&view=diff
==============================================================================
--- 
hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
 (original)
+++ 
hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
 Sat Apr 27 04:19:47 2013
@@ -21,6 +21,9 @@ Release 0.23.8 - UNRELEASED
     HADOOP-9469. mapreduce/yarn source jars not included in dist tarball
     (Robert Parker via tgraves)
 
+    HADOOP-9504. MetricsDynamicMBeanBase has concurrency issues in
+    createMBeanInfo (Liang Xie via jlowe)
+
 Release 0.23.7 - 2013-04-18
 
   INCOMPATIBLE CHANGES

Modified: 
hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java?rev=1476489&r1=1476488&r2=1476489&view=diff
==============================================================================
--- 
hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java
 (original)
+++ 
hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics/util/MetricsDynamicMBeanBase.java
 Sat Apr 27 04:19:47 2013
@@ -18,9 +18,9 @@
 package org.apache.hadoop.metrics.util;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.management.Attribute;
 import javax.management.AttributeList;
@@ -69,6 +69,7 @@ public abstract class MetricsDynamicMBea
   protected MetricsDynamicMBeanBase(final MetricsRegistry mr, final String 
aMBeanDescription) {
     metricsRegistry = mr;
     mbeanDescription = aMBeanDescription;
+    metricsRateAttributeMod = new ConcurrentHashMap<String, MetricsBase>();
     createMBeanInfo();
   }
   
@@ -78,7 +79,6 @@ public abstract class MetricsDynamicMBea
   }
   
   private void createMBeanInfo() {
-    metricsRateAttributeMod = new HashMap<String, MetricsBase>();
     boolean needsMinMaxResetOperation = false;
     List<MBeanAttributeInfo> attributesInfo = new 
ArrayList<MBeanAttributeInfo>();
     MBeanOperationInfo[] operationsInfo = null;


Reply via email to