Package org.apache.hadoop.metrics2.sink
Class FileSink
java.lang.Object
org.apache.hadoop.metrics2.sink.FileSink
- All Implemented Interfaces:
Closeable,AutoCloseable,MetricsPlugin,MetricsSink
A metrics sink that writes to a file
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()Flush any buffered metricsvoidinit(org.apache.commons.configuration2.SubsetConfiguration conf) Initialize the pluginvoidputMetrics(MetricsRecord record) Put a metrics record in the sink
-
Constructor Details
-
FileSink
public FileSink()
-
-
Method Details
-
init
public void init(org.apache.commons.configuration2.SubsetConfiguration conf) Description copied from interface:MetricsPluginInitialize the plugin- Specified by:
initin interfaceMetricsPlugin- Parameters:
conf- the configuration object for the plugin
-
putMetrics
Description copied from interface:MetricsSinkPut a metrics record in the sink- Specified by:
putMetricsin interfaceMetricsSink- Parameters:
record- the record to put
-
flush
public void flush()Description copied from interface:MetricsSinkFlush any buffered metrics- Specified by:
flushin interfaceMetricsSink
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-