Class MetricsDynamicMBeanBase
- java.lang.Object
-
- com.mapr.org.apache.hadoop.metrics.util.MetricsDynamicMBeanBase
-
- All Implemented Interfaces:
javax.management.DynamicMBean
@LimitedPrivate({"HDFS","MapReduce"}) public abstract class MetricsDynamicMBeanBase extends java.lang.Object implements javax.management.DynamicMBeanThis abstract base class facilitates creating dynamic mbeans automatically from metrics. The metrics constructors registers metrics in a registry. Different categories of metrics should be in differnt classes with their own registry (as in NameNodeMetrics and DataNodeMetrics). Then the MBean can be created passing the registry to the constructor. The MBean should be then registered using a mbean name (example): MetricsHolder myMetrics = new MetricsHolder(); // has metrics and registry MetricsTestMBean theMBean = new MetricsTestMBean(myMetrics.mregistry); ObjectName mbeanName = MBeanUtil.registerMBean("ServiceFoo", "TestStatistics", theMBean);
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMetricsDynamicMBeanBase(MetricsRegistry mr, java.lang.String aMBeanDescription)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetAttribute(java.lang.String attributeName)javax.management.AttributeListgetAttributes(java.lang.String[] attributeNames)javax.management.MBeanInfogetMBeanInfo()java.lang.Objectinvoke(java.lang.String actionName, java.lang.Object[] parms, java.lang.String[] signature)voidsetAttribute(javax.management.Attribute attribute)javax.management.AttributeListsetAttributes(javax.management.AttributeList attributes)
-
-
-
Constructor Detail
-
MetricsDynamicMBeanBase
protected MetricsDynamicMBeanBase(MetricsRegistry mr, java.lang.String aMBeanDescription)
-
-
Method Detail
-
getAttribute
public java.lang.Object getAttribute(java.lang.String attributeName) throws javax.management.AttributeNotFoundException, javax.management.MBeanException, javax.management.ReflectionException- Specified by:
getAttributein interfacejavax.management.DynamicMBean- Throws:
javax.management.AttributeNotFoundExceptionjavax.management.MBeanExceptionjavax.management.ReflectionException
-
getAttributes
public javax.management.AttributeList getAttributes(java.lang.String[] attributeNames)
- Specified by:
getAttributesin interfacejavax.management.DynamicMBean
-
getMBeanInfo
public javax.management.MBeanInfo getMBeanInfo()
- Specified by:
getMBeanInfoin interfacejavax.management.DynamicMBean
-
invoke
public java.lang.Object invoke(java.lang.String actionName, java.lang.Object[] parms, java.lang.String[] signature) throws javax.management.MBeanException, javax.management.ReflectionException- Specified by:
invokein interfacejavax.management.DynamicMBean- Throws:
javax.management.MBeanExceptionjavax.management.ReflectionException
-
setAttribute
public void setAttribute(javax.management.Attribute attribute) throws javax.management.AttributeNotFoundException, javax.management.InvalidAttributeValueException, javax.management.MBeanException, javax.management.ReflectionException- Specified by:
setAttributein interfacejavax.management.DynamicMBean- Throws:
javax.management.AttributeNotFoundExceptionjavax.management.InvalidAttributeValueExceptionjavax.management.MBeanExceptionjavax.management.ReflectionException
-
setAttributes
public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
- Specified by:
setAttributesin interfacejavax.management.DynamicMBean
-
-