|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.metrics.spi.AbstractMetricsContext org.apache.hadoop.metrics.spi.CompositeContext
public class CompositeContext
Field Summary |
---|
Fields inherited from interface org.apache.hadoop.metrics.MetricsContext |
---|
DEFAULT_PERIOD |
Constructor Summary | |
---|---|
CompositeContext()
|
Method Summary | |
---|---|
void |
close()
Stops monitoring and frees buffered data, returning this object to its initial state. |
protected void |
emitRecord(String contextName,
String recordName,
OutputRecord outRec)
Sends a record to the metrics system. |
protected void |
flush()
Called each period after all records have been emitted, this method does nothing. |
void |
init(String contextName,
ContextFactory factory)
Initializes the context. |
boolean |
isMonitoring()
Return true if all subcontexts are monitoring. |
MetricsRecord |
newRecord(String recordName)
Subclasses should override this if they subclass MetricsRecordImpl. |
void |
registerUpdater(Updater updater)
Registers a callback to be called at time intervals determined by the configuration. |
void |
startMonitoring()
Starts or restarts monitoring, the emitting of metrics records. |
void |
stopMonitoring()
Stops monitoring. |
void |
unregisterUpdater(Updater updater)
Removes a callback, if it exists. |
Methods inherited from class org.apache.hadoop.metrics.spi.AbstractMetricsContext |
---|
createRecord, getAttribute, getAttributeTable, getContextFactory, getContextName, getPeriod, remove, setPeriod, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompositeContext()
Method Detail |
---|
public void init(String contextName, ContextFactory factory)
AbstractMetricsContext
init
in interface MetricsContext
init
in class AbstractMetricsContext
contextName
- The given name for this contextfactory
- The creator of this contextpublic MetricsRecord newRecord(String recordName)
AbstractMetricsContext
newRecord
in class AbstractMetricsContext
recordName
- the name of the record
protected void emitRecord(String contextName, String recordName, OutputRecord outRec) throws IOException
AbstractMetricsContext
emitRecord
in class AbstractMetricsContext
IOException
protected void flush() throws IOException
AbstractMetricsContext
flush
in class AbstractMetricsContext
IOException
public void startMonitoring() throws IOException
AbstractMetricsContext
startMonitoring
in interface MetricsContext
startMonitoring
in class AbstractMetricsContext
IOException
public void stopMonitoring()
AbstractMetricsContext
stopMonitoring
in interface MetricsContext
stopMonitoring
in class AbstractMetricsContext
AbstractMetricsContext.close()
public boolean isMonitoring()
isMonitoring
in interface MetricsContext
isMonitoring
in class AbstractMetricsContext
public void close()
AbstractMetricsContext
close
in interface MetricsContext
close
in class AbstractMetricsContext
public void registerUpdater(Updater updater)
AbstractMetricsContext
registerUpdater
in interface MetricsContext
registerUpdater
in class AbstractMetricsContext
updater
- object to be run periodically; it should update
some metrics recordspublic void unregisterUpdater(Updater updater)
AbstractMetricsContext
unregisterUpdater
in interface MetricsContext
unregisterUpdater
in class AbstractMetricsContext
updater
- object to be removed from the callback list
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |