svn merge -c 1476487 FIXES: HADOOP-9504. MetricsDynamicMBeanBase has concurrency issues in createMBeanInfo. Contributed by Liang Xie

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1476488 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Darrell Lowe 2013-04-27 04:13:04 +00:00
parent b2927bd936
commit 8f151832cc
2 changed files with 8 additions and 2 deletions

View File

@ -127,6 +127,9 @@ Release 2.0.5-beta - UNRELEASED
HADOOP-9473. Typo in FileUtil copy() method. (Glen Mazza via suresh)
HADOOP-9504. MetricsDynamicMBeanBase has concurrency issues in
createMBeanInfo (Liang Xie via jlowe)
Release 2.0.4-alpha - UNRELEASED
INCOMPATIBLE CHANGES
@ -1162,6 +1165,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 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -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 MetricsDynamicMBeanBase implements DynamicMBean {
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 MetricsDynamicMBeanBase implements DynamicMBean {
}
private void createMBeanInfo() {
metricsRateAttributeMod = new HashMap<String, MetricsBase>();
boolean needsMinMaxResetOperation = false;
List<MBeanAttributeInfo> attributesInfo = new ArrayList<MBeanAttributeInfo>();
MBeanOperationInfo[] operationsInfo = null;