MetricsSink (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.metrics2, interface: MetricsSink

Package org.apache.hadoop.metrics2

# Interface MetricsSink

All Superinterfaces:
  `MetricsPlugin`

All Known Implementing Classes:
  `AbstractGangliaSink`, `FileSink`, `GangliaSink30`, `GangliaSink31`, `GraphiteSink`, `PrometheusMetricsSink`, `RollingFileSystemSink`, `StatsDSink`

@Public @Evolving public interface MetricsSink extends MetricsPlugin
The metrics sink interface.

Implementations of this interface consume the `MetricsRecord` generated from `MetricsSource`. It registers with `MetricsSystem` which periodically pushes the `MetricsRecord` to the sink using `putMetrics(MetricsRecord)` method. If the implementing class also implements `Closeable`, then the MetricsSystem will close the sink when it is stopped.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `flush()`
  Flush any buffered metrics
  `void`
  `putMetrics(MetricsRecord record)`
  Put a metrics record in the sink

  ### Methods inherited from interface org.apache.hadoop.metrics2.MetricsPlugin

  `init`

- ## Method Details

  - ### putMetrics

    void putMetrics(MetricsRecord record)
    Put a metrics record in the sink
    Parameters:
      `record` - the record to put

  - ### flush

    void flush()
    Flush any buffered metrics