org.apache.hadoop.chukwa.inputtools.log4j
Class Log4JMetricsContext

java.lang.Object
  extended by org.apache.hadoop.metrics.spi.AbstractMetricsContext
      extended by org.apache.hadoop.chukwa.inputtools.log4j.Log4JMetricsContext
All Implemented Interfaces:
org.apache.hadoop.metrics.MetricsContext

public class Log4JMetricsContext
extends AbstractMetricsContext


Field Summary
protected static String ADD_UUID_PROPERTY
           
protected  boolean needUUID
           
protected static String OUTPUT_DIR_PROPERTY
           
protected  String outputDir
           
protected  int period
           
protected static String PERIOD_PROPERTY
           
protected static String user
           
 
Fields inherited from interface org.apache.hadoop.metrics.MetricsContext
DEFAULT_PERIOD
 
Constructor Summary
Log4JMetricsContext()
          Creates a new instance of FileContext
 
Method Summary
protected  void emitRecord(String contextName, String recordName, org.apache.hadoop.metrics.spi.OutputRecord outRec)
          Sends a record to the metrics system.
 void init(String contextName, org.apache.hadoop.metrics.ContextFactory factory)
          Initializes the context.
 
Methods inherited from class org.apache.hadoop.metrics.spi.AbstractMetricsContext
close, createRecord, flush, getAttribute, getAttributeTable, getContextFactory, getContextName, getPeriod, isMonitoring, newRecord, registerUpdater, remove, setPeriod, startMonitoring, stopMonitoring, unregisterUpdater, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OUTPUT_DIR_PROPERTY

protected static final String OUTPUT_DIR_PROPERTY
See Also:
Constant Field Values

PERIOD_PROPERTY

protected static final String PERIOD_PROPERTY
See Also:
Constant Field Values

ADD_UUID_PROPERTY

protected static final String ADD_UUID_PROPERTY
See Also:
Constant Field Values

user

protected static final String user

outputDir

protected String outputDir

period

protected int period

needUUID

protected boolean needUUID
Constructor Detail

Log4JMetricsContext

public Log4JMetricsContext()
Creates a new instance of FileContext

Method Detail

init

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

Specified by:
init in interface org.apache.hadoop.metrics.MetricsContext
Overrides:
init in class AbstractMetricsContext

emitRecord

protected void emitRecord(String contextName,
                          String recordName,
                          org.apache.hadoop.metrics.spi.OutputRecord outRec)
                   throws IOException
Description copied from class: AbstractMetricsContext
Sends a record to the metrics system.

Specified by:
emitRecord in class AbstractMetricsContext
Throws:
IOException


Copyright © ${year} The Apache Software Foundation