org.apache.hadoop.hdfs.server.namenode.metrics
Class FSNamesystemMetrics

java.lang.Object
  extended by 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()


Field Summary
 org.apache.hadoop.metrics.util.MetricsTimeVaryingInt numExpiredHeartbeats
           
 
Constructor Summary
FSNamesystemMetrics(FSNamesystem fsNameSystem, org.apache.hadoop.conf.Configuration conf)
           
 
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
 

Field Detail

numExpiredHeartbeats

public final org.apache.hadoop.metrics.util.MetricsTimeVaryingInt numExpiredHeartbeats
Constructor Detail

FSNamesystemMetrics

public FSNamesystemMetrics(FSNamesystem fsNameSystem,
                           org.apache.hadoop.conf.Configuration conf)
Method Detail

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