org.apache.hadoop.hbase.metrics
Class BaseSourceImpl

java.lang.Object
  extended by org.apache.hadoop.hbase.metrics.BaseSourceImpl
All Implemented Interfaces:
BaseSource, MetricsSource
Direct Known Subclasses:
MetricsAssignmentManagerSourceImpl, MetricsBalancerSourceImpl, MetricsEditsReplaySourceImpl, MetricsHBaseServerSourceImpl, MetricsMasterFilesystemSourceImpl, MetricsMasterSourceImpl, MetricsRegionAggregateSourceImpl, MetricsRegionServerSourceImpl, MetricsReplicationSourceImpl, MetricsRESTSourceImpl, MetricsSnapshotSourceImpl, MetricsThriftServerSourceImpl, MetricsWALSourceImpl

@InterfaceAudience.Private
public class BaseSourceImpl
extends Object
implements BaseSource, MetricsSource

Hadoop 2 implementation of BaseSource (using metrics2 framework). It handles registration to DefaultMetricsSystem and creation of the metrics registry. All MetricsSource's in hbase-hadoop2-compat should derive from this class.


Field Summary
protected  String metricsContext
           
protected  String metricsDescription
           
protected  String metricsJmxContext
           
protected  String metricsName
           
protected  DynamicMetricsRegistry metricsRegistry
           
 
Fields inherited from interface org.apache.hadoop.hbase.metrics.BaseSource
HBASE_METRICS_SYSTEM_NAME
 
Constructor Summary
BaseSourceImpl(String metricsName, String metricsDescription, String metricsContext, String metricsJmxContext)
           
 
Method Summary
 void decGauge(String gaugeName, long delta)
          Decrease the value of a named gauge.
 void getMetrics(MetricsCollector metricsCollector, boolean all)
           
 String getMetricsContext()
           
 String getMetricsDescription()
           
 String getMetricsJmxContext()
           
 String getMetricsName()
           
 DynamicMetricsRegistry getMetricsRegistry()
           
 void incCounters(String key, long delta)
          Increment a named counter by some value.
 void incGauge(String gaugeName, long delta)
          Add some amount to a gauge.
 void init()
           
 void removeMetric(String key)
          Remove a named gauge.
 void setGauge(String gaugeName, long value)
          Set a single gauge to a value.
 void updateHistogram(String name, long value)
           
 void updateQuantile(String name, long value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

metricsRegistry

protected final DynamicMetricsRegistry metricsRegistry

metricsName

protected final String metricsName

metricsDescription

protected final String metricsDescription

metricsContext

protected final String metricsContext

metricsJmxContext

protected final String metricsJmxContext
Constructor Detail

BaseSourceImpl

public BaseSourceImpl(String metricsName,
                      String metricsDescription,
                      String metricsContext,
                      String metricsJmxContext)
Method Detail

init

public void init()
Specified by:
init in interface BaseSource

setGauge

public void setGauge(String gaugeName,
                     long value)
Set a single gauge to a value.

Specified by:
setGauge in interface BaseSource
Parameters:
gaugeName - gauge name
value - the new value of the gauge.

incGauge

public void incGauge(String gaugeName,
                     long delta)
Add some amount to a gauge.

Specified by:
incGauge in interface BaseSource
Parameters:
gaugeName - The name of the gauge to increment.
delta - The amount to increment the gauge by.

decGauge

public void decGauge(String gaugeName,
                     long delta)
Decrease the value of a named gauge.

Specified by:
decGauge in interface BaseSource
Parameters:
gaugeName - The name of the gauge.
delta - the ammount to subtract from a gauge value.

incCounters

public void incCounters(String key,
                        long delta)
Increment a named counter by some value.

Specified by:
incCounters in interface BaseSource
Parameters:
key - the name of the counter
delta - the ammount to increment

updateHistogram

public void updateHistogram(String name,
                            long value)
Specified by:
updateHistogram in interface BaseSource

updateQuantile

public void updateQuantile(String name,
                           long value)
Specified by:
updateQuantile in interface BaseSource

removeMetric

public void removeMetric(String key)
Remove a named gauge.

Specified by:
removeMetric in interface BaseSource
Parameters:
key -

getMetrics

public void getMetrics(MetricsCollector metricsCollector,
                       boolean all)
Specified by:
getMetrics in interface MetricsSource

getMetricsRegistry

public DynamicMetricsRegistry getMetricsRegistry()

getMetricsContext

public String getMetricsContext()
Specified by:
getMetricsContext in interface BaseSource

getMetricsDescription

public String getMetricsDescription()
Specified by:
getMetricsDescription in interface BaseSource

getMetricsJmxContext

public String getMetricsJmxContext()
Specified by:
getMetricsJmxContext in interface BaseSource

getMetricsName

public String getMetricsName()
Specified by:
getMetricsName in interface BaseSource


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.