org.apache.hadoop.metrics.spi
Class NullContextWithUpdateThread

java.lang.Object
  extended by org.apache.hadoop.metrics.spi.AbstractMetricsContext
      extended by org.apache.hadoop.metrics.spi.NullContextWithUpdateThread
All Implemented Interfaces:
MetricsContext

public class NullContextWithUpdateThread
extends AbstractMetricsContext

A null context which has a thread calling periodically when monitoring is started. This keeps the data sampled correctly. In all other respects, this is like the NULL context: No data is emitted. This is suitable for Monitoring systems like JMX which reads the metrics when someone reads the data from JMX. The default impl of start and stop monitoring: is the AbstractMetricsContext is good enough.


Field Summary
 
Fields inherited from interface org.apache.hadoop.metrics.MetricsContext
DEFAULT_PERIOD
 
Constructor Summary
NullContextWithUpdateThread()
          Creates a new instance of NullContextWithUpdateThread
 
Method Summary
protected  void emitRecord(String contextName, String recordName, OutputRecord outRec)
          Do-nothing version of emitRecord
 void init(String contextName, ContextFactory factory)
          Initializes the context.
protected  void remove(MetricsRecordImpl record)
          Do-nothing version of remove
protected  void update(MetricsRecordImpl record)
          Do-nothing version of update
 
Methods inherited from class org.apache.hadoop.metrics.spi.AbstractMetricsContext
close, createRecord, flush, getAttribute, getAttributeTable, getContextFactory, getContextName, getPeriod, isMonitoring, newRecord, registerUpdater, setPeriod, startMonitoring, stopMonitoring, unregisterUpdater
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullContextWithUpdateThread

public NullContextWithUpdateThread()
Creates a new instance of NullContextWithUpdateThread

Method Detail

init

public void init(String contextName,
                 ContextFactory factory)
Description copied from class: AbstractMetricsContext
Initializes the context.

Overrides:
init in class AbstractMetricsContext

emitRecord

protected void emitRecord(String contextName,
                          String recordName,
                          OutputRecord outRec)
Do-nothing version of emitRecord

Specified by:
emitRecord in class AbstractMetricsContext

update

protected void update(MetricsRecordImpl record)
Do-nothing version of update

Overrides:
update in class AbstractMetricsContext

remove

protected void remove(MetricsRecordImpl record)
Do-nothing version of remove

Overrides:
remove in class AbstractMetricsContext


Copyright © 2008 The Apache Software Foundation