MetricsFilter (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.metrics2, class: MetricsFilter

Package org.apache.hadoop.metrics2

# Class MetricsFilter

java.lang.Object
org.apache.hadoop.metrics2.MetricsFilter

All Implemented Interfaces:
  `MetricsPlugin`

Direct Known Subclasses:
  `org.apache.hadoop.metrics2.filter.AbstractPatternFilter`

@Public @Evolving public abstract class MetricsFilter extends Object implements MetricsPlugin
The metrics filter interface. The MetricsFilter objects can be used either to filter the metrics from `MetricsSource`s or to filter metrics per `MetricsSink`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MetricsFilter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract boolean`
  `accepts(Iterable<MetricsTag> tags)`
  Whether to accept the tags
  `abstract boolean`
  `accepts(String name)`
  Whether to accept the name
  `boolean`
  `accepts(MetricsRecord record)`
  Whether to accept the record
  `abstract boolean`
  `accepts(MetricsTag tag)`
  Whether to accept the tag

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

  `init`

- ## Constructor Details

  - ### MetricsFilter

    public MetricsFilter()

- ## Method Details

  - ### accepts

    public abstract boolean accepts(String name)
    Whether to accept the name
    Parameters:
      `name` - to filter on
    Returns:
      true to accept; false otherwise.

  - ### accepts

    public abstract boolean accepts(MetricsTag tag)
    Whether to accept the tag
    Parameters:
      `tag` - to filter on
    Returns:
      true to accept; false otherwise

  - ### accepts

    public abstract boolean accepts(Iterable<MetricsTag> tags)
    Whether to accept the tags
    Parameters:
      `tags` - to filter on
    Returns:
      true to accept; false otherwise

  - ### accepts

    public boolean accepts(MetricsRecord record)
    Whether to accept the record
    Parameters:
      `record` - to filter on
    Returns:
      true to accept; false otherwise.