CompositeContext (Hadoop 0.20.2-cdh3u1 API)
Date: 2011-07-18

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.hadoop.metrics.spi
Class CompositeContext

    java.lang.Object
      org.apache.hadoop.metrics.spi.AbstractMetricsContext
          org.apache.hadoop.metrics.spi.CompositeContext

All Implemented Interfaces:
  MetricsContext

    public class CompositeContext

extends AbstractMetricsContext

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.hadoop.metrics.spi.AbstractMetricsContext
`AbstractMetricsContext.MetricMap, AbstractMetricsContext.TagMap`

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, getAllRecords, getAttribute, getAttributeTable, getContextFactory, getContextName, getPeriod, parseAndSetPeriod, remove, setPeriod, update`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CompositeContext

    public CompositeContext()

Method Detail

### init

    public void init(String contextName,
                     ContextFactory factory)

  Description copied from class: `AbstractMetricsContext`
  Initializes the context.

  Specified by:
    `init` in interface `MetricsContext`
  Overrides:
    `init` in class `AbstractMetricsContext`
  Parameters:
    `contextName` - The given name for this context
    `factory` - The creator of this context

### newRecord

    public MetricsRecord newRecord(String recordName)

  Description copied from class: `AbstractMetricsContext`
  Subclasses should override this if they subclass MetricsRecordImpl.

  Overrides:
    `newRecord` in class `AbstractMetricsContext`
  Parameters:
    `recordName` - the name of the record
  Returns:
    newly created instance of MetricsRecordImpl or subclass

### emitRecord

    protected void emitRecord(String contextName,
                              String recordName,
                              OutputRecord outRec)
                       throws IOException

  Description copied from class: `AbstractMetricsContext`
  Sends a record to the metrics system.

  Specified by:
    `emitRecord` in class `AbstractMetricsContext`
  Throws:
    `IOException`

### flush

    protected void flush()
                  throws IOException

  Description copied from class: `AbstractMetricsContext`
  Called each period after all records have been emitted, this method does nothing. Subclasses may override it in order to perform some kind of flush.

  Overrides:
    `flush` in class `AbstractMetricsContext`
  Throws:
    `IOException`

### startMonitoring

    public void startMonitoring()
                         throws IOException

  Description copied from class: `AbstractMetricsContext`
  Starts or restarts monitoring, the emitting of metrics records.

  Specified by:
    `startMonitoring` in interface `MetricsContext`
  Overrides:
    `startMonitoring` in class `AbstractMetricsContext`
  Throws:
    `IOException`

### stopMonitoring

    public void stopMonitoring()

  Description copied from class: `AbstractMetricsContext`
  Stops monitoring. This does not free buffered data.

  Specified by:
    `stopMonitoring` in interface `MetricsContext`
  Overrides:
    `stopMonitoring` in class `AbstractMetricsContext`
  See Also:
    `AbstractMetricsContext.close()`

### isMonitoring

    public boolean isMonitoring()

  Return true if all subcontexts are monitoring.

  Specified by:
    `isMonitoring` in interface `MetricsContext`
  Overrides:
    `isMonitoring` in class `AbstractMetricsContext`

### close

    public void close()

  Description copied from class: `AbstractMetricsContext`
  Stops monitoring and frees buffered data, returning this object to its initial state.

  Specified by:
    `close` in interface `MetricsContext`
  Overrides:
    `close` in class `AbstractMetricsContext`

### registerUpdater

    public void registerUpdater(Updater updater)

  Description copied from class: `AbstractMetricsContext`
  Registers a callback to be called at time intervals determined by the configuration.

  Specified by:
    `registerUpdater` in interface `MetricsContext`
  Overrides:
    `registerUpdater` in class `AbstractMetricsContext`
  Parameters:
    `updater` - object to be run periodically; it should update some metrics records

### unregisterUpdater

    public void unregisterUpdater(Updater updater)

  Description copied from class: `AbstractMetricsContext`
  Removes a callback, if it exists.

  Specified by:
    `unregisterUpdater` in interface `MetricsContext`
  Overrides:
    `unregisterUpdater` in class `AbstractMetricsContext`
  Parameters:
    `updater` - object to be removed from the callback list

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation