|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.metrics.spi.AbstractMetricsContext
org.apache.hadoop.metrics.file.FileContext
FileSink instead.
@InterfaceAudience.Public @InterfaceStability.Evolving @Deprecated public class FileContext
Metrics context for writing metrics to a file.
This class is configured by setting ContextFactory attributes which in turn are usually configured through a properties file. All the attributes are prefixed by the contextName. For example, the properties file might contain:myContextName.fileName=/tmp/metrics.log myContextName.period=5
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.hadoop.metrics.spi.AbstractMetricsContext |
|---|
AbstractMetricsContext.MetricMap, AbstractMetricsContext.TagMap |
| Field Summary | |
|---|---|
protected static String |
FILE_NAME_PROPERTY
Deprecated. |
protected static String |
PERIOD_PROPERTY
Deprecated. |
| Fields inherited from interface org.apache.hadoop.metrics.MetricsContext |
|---|
DEFAULT_PERIOD |
| Constructor Summary | |
|---|---|
FileContext()
Deprecated. Creates a new instance of FileContext |
|
| Method Summary | |
|---|---|
void |
emitRecord(String contextName,
String recordName,
OutputRecord outRec)
Deprecated. Emits a metrics record to a file. |
void |
flush()
Deprecated. Flushes the output writer, forcing updates to disk. |
String |
getFileName()
Deprecated. Returns the configured file name, or null. |
void |
init(String contextName,
ContextFactory factory)
Deprecated. Initializes the context. |
void |
startMonitoring()
Deprecated. Starts or restarts monitoring, by opening in append-mode, the file specified by the fileName attribute,
if specified. |
void |
stopMonitoring()
Deprecated. Stops monitoring, closing the file. |
| Methods inherited from class org.apache.hadoop.metrics.spi.AbstractMetricsContext |
|---|
close, createRecord, getAllRecords, getAttribute, getAttributeTable, getContextFactory, getContextName, getPeriod, isMonitoring, newRecord, parseAndSetPeriod, registerUpdater, remove, setPeriod, unregisterUpdater, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@InterfaceAudience.Private protected static final String FILE_NAME_PROPERTY
@InterfaceAudience.Private protected static final String PERIOD_PROPERTY
| Constructor Detail |
|---|
@InterfaceAudience.Private public FileContext()
| Method Detail |
|---|
@InterfaceAudience.Private
public void init(String contextName,
ContextFactory factory)
AbstractMetricsContext
init in interface MetricsContextinit in class AbstractMetricsContextcontextName - The given name for this contextfactory - The creator of this context@InterfaceAudience.Private public String getFileName()
@InterfaceAudience.Private
public void startMonitoring()
throws IOException
fileName attribute,
if specified. Otherwise the data will be written to standard
output.
startMonitoring in interface MetricsContextstartMonitoring in class AbstractMetricsContextIOException@InterfaceAudience.Private public void stopMonitoring()
stopMonitoring in interface MetricsContextstopMonitoring in class AbstractMetricsContextAbstractMetricsContext.close()
@InterfaceAudience.Private
public void emitRecord(String contextName,
String recordName,
OutputRecord outRec)
emitRecord in class AbstractMetricsContext@InterfaceAudience.Private public void flush()
flush in class AbstractMetricsContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||