org.apache.hadoop.metrics2
Class AbstractMetric

java.lang.Object
  extended by org.apache.hadoop.metrics2.AbstractMetric
All Implemented Interfaces:
MetricsInfo

@InterfaceAudience.Public
@InterfaceStability.Evolving
public abstract class AbstractMetric
extends Object
implements MetricsInfo

The immutable metric


Constructor Summary
protected AbstractMetric(MetricsInfo info)
          Construct the metric
 
Method Summary
 String description()
           
 boolean equals(Object obj)
           
 int hashCode()
           
protected  MetricsInfo info()
           
 String name()
           
 String toString()
           
abstract  org.apache.hadoop.metrics2.MetricType type()
          Get the type of the metric
abstract  Number value()
          Get the value of the metric
abstract  void visit(MetricsVisitor visitor)
          Accept a visitor interface
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractMetric

protected AbstractMetric(MetricsInfo info)
Construct the metric

Parameters:
info - about the metric
Method Detail

name

public String name()
Specified by:
name in interface MetricsInfo
Returns:
the name of the metric/tag

description

public String description()
Specified by:
description in interface MetricsInfo
Returns:
the description of the metric/tag

info

protected MetricsInfo info()

value

public abstract Number value()
Get the value of the metric

Returns:
the value of the metric

type

public abstract org.apache.hadoop.metrics2.MetricType type()
Get the type of the metric

Returns:
the type of the metric

visit

public abstract void visit(MetricsVisitor visitor)
Accept a visitor interface

Parameters:
visitor - of the metric

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 Apache Software Foundation. All Rights Reserved.