org.apache.hadoop.hdfs.server.namenode.metrics
Class FSNamesystemMetrics
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.metrics.FSNamesystemMetrics
- All Implemented Interfaces:
- org.apache.hadoop.metrics.Updater
@InterfaceAudience.Private
public class FSNamesystemMetrics
- extends Object
- implements org.apache.hadoop.metrics.Updater
This class is for maintaining the various FSNamesystem status metrics
and publishing them through the metrics interfaces.
The SNamesystem creates and registers the JMX MBean.
This class has a number of metrics variables that are publicly accessible;
these variables (objects) have methods to update their values;
for example:
filesTotal
.set()
Method Summary |
void |
doUpdates(org.apache.hadoop.metrics.MetricsContext unused)
Since this object is a registered updater, this method will be called
periodically, e.g. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
numExpiredHeartbeats
public final org.apache.hadoop.metrics.util.MetricsTimeVaryingInt numExpiredHeartbeats
FSNamesystemMetrics
public FSNamesystemMetrics(FSNamesystem fsNameSystem,
org.apache.hadoop.conf.Configuration conf)
doUpdates
public void doUpdates(org.apache.hadoop.metrics.MetricsContext unused)
- Since this object is a registered updater, this method will be called
periodically, e.g. every 5 seconds.
We set the metrics value within this function before pushing it out.
FSNamesystem updates its own local variables which are
light weight compared to Metrics counters.
Some of the metrics are explicity casted to int. Few metrics collectors
do not handle long values. It is safe to cast to int for now as all these
values fit in int value.
Metrics related to DFS capacity are stored in bytes which do not fit in
int, so they are rounded to GB
- Specified by:
doUpdates
in interface org.apache.hadoop.metrics.Updater
Copyright © 2009 The Apache Software Foundation