org.apache.hadoop.metrics2.filter
Class RegexFilter

java.lang.Object
  extended by org.apache.hadoop.metrics2.MetricsFilter
      extended by org.apache.hadoop.metrics2.filter.RegexFilter
All Implemented Interfaces:
MetricsPlugin

public class RegexFilter
extends MetricsFilter

A regex pattern filter for metrics


Field Summary
protected static String EXCLUDE_KEY
           
protected static String EXCLUDE_TAGS_KEY
           
protected static String INCLUDE_KEY
           
protected static String INCLUDE_TAGS_KEY
           
 
Constructor Summary
RegexFilter()
           
 
Method Summary
 boolean accepts(Iterable<MetricsTag> tags)
          Whether to accept the tags
 boolean accepts(MetricsTag tag)
          Whether to accept the tag
 boolean accepts(String name)
          Whether to accept the name
protected  Pattern compile(String s)
          Compile a string pattern in to a pattern object
 void init(org.apache.commons.configuration.SubsetConfiguration conf)
          Initialize the plugin
 
Methods inherited from class org.apache.hadoop.metrics2.MetricsFilter
accepts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INCLUDE_KEY

protected static final String INCLUDE_KEY
See Also:
Constant Field Values

EXCLUDE_KEY

protected static final String EXCLUDE_KEY
See Also:
Constant Field Values

INCLUDE_TAGS_KEY

protected static final String INCLUDE_TAGS_KEY
See Also:
Constant Field Values

EXCLUDE_TAGS_KEY

protected static final String EXCLUDE_TAGS_KEY
See Also:
Constant Field Values
Constructor Detail

RegexFilter

public RegexFilter()
Method Detail

compile

protected Pattern compile(String s)
Compile a string pattern in to a pattern object

Parameters:
s - the string pattern to compile
Returns:
the compiled pattern object

init

public void init(org.apache.commons.configuration.SubsetConfiguration conf)
Description copied from interface: MetricsPlugin
Initialize the plugin

Specified by:
init in interface MetricsPlugin
Specified by:
init in class MetricsFilter
Parameters:
conf - the configuration object for the plugin

accepts

public boolean accepts(MetricsTag tag)
Description copied from class: MetricsFilter
Whether to accept the tag

Specified by:
accepts in class MetricsFilter
Parameters:
tag - to filter on
Returns:
true to accept; false otherwise

accepts

public boolean accepts(Iterable<MetricsTag> tags)
Description copied from class: MetricsFilter
Whether to accept the tags

Specified by:
accepts in class MetricsFilter
Parameters:
tags - to filter on
Returns:
true to accept; false otherwise

accepts

public boolean accepts(String name)
Description copied from class: MetricsFilter
Whether to accept the name

Specified by:
accepts in class MetricsFilter
Parameters:
name - to filter on
Returns:
true to accept; false otherwise.


Copyright © 2009 The Apache Software Foundation