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

      @InterfaceAudience.Public
       @InterfaceStability.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 and Description
    `MetricsFilter()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract boolean` | `accepts(Iterable<MetricsTag> tags)` Whether to accept the tags
    `boolean` | `accepts(MetricsRecord record)` Whether to accept the record
    `abstract boolean` | `accepts(MetricsTag tag)` Whether to accept the tag
    `abstract boolean` | `accepts(String name)` Whether to accept the name

    - ### 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 Detail

    - #### MetricsFilter

          public MetricsFilter()

  - ### Method Detail

    - #### 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.

Copyright © 2022 Apache Software Foundation. All rights reserved.