GangliaSink30 (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.metrics2.sink.ganglia, class: GangliaSink30

Package org.apache.hadoop.metrics2.sink.ganglia

# Class GangliaSink30

java.lang.Object
org.apache.hadoop.metrics2.sink.ganglia.AbstractGangliaSink
org.apache.hadoop.metrics2.sink.ganglia.GangliaSink30

All Implemented Interfaces:
  `MetricsPlugin`, `MetricsSink`

Direct Known Subclasses:
  `GangliaSink31`

public class GangliaSink30 extends AbstractGangliaSink
This code supports Ganglia 3.0

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.hadoop.metrics2.sink.ganglia.AbstractGangliaSink

  `AbstractGangliaSink.GangliaConfType, AbstractGangliaSink.GangliaSlope`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final org.slf4j.Logger`
  `LOG`

  ### Fields inherited from class org.apache.hadoop.metrics2.sink.ganglia.AbstractGangliaSink

  `BUFFER_SIZE, DEFAULT_DMAX, DEFAULT_MULTICAST_ENABLED, DEFAULT_MULTICAST_TTL, DEFAULT_PORT, DEFAULT_SLOPE, DEFAULT_TMAX, DEFAULT_UNITS, EQUAL, gangliaMetricVisitor, MULTICAST_ENABLED_PROPERTY, MULTICAST_TTL_PROPERTY, SERVERS_PROPERTY, SUPPORT_SPARSE_METRICS_DEFAULT, SUPPORT_SPARSE_METRICS_PROPERTY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GangliaSink30()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `appendPrefix(MetricsRecord record, StringBuilder sb)`
  `protected void`
  `emitMetric(String groupName, String name, String type, String value, org.apache.hadoop.metrics2.sink.ganglia.GangliaConf gConf, AbstractGangliaSink.GangliaSlope gSlope)`
  The method sends metrics to Ganglia servers.
  `void`
  `init(org.apache.commons.configuration2.SubsetConfiguration conf)`
  Initialize the plugin
  `void`
  `putMetrics(MetricsRecord record)`
  Put a metrics record in the sink

  ### Methods inherited from class org.apache.hadoop.metrics2.sink.ganglia.AbstractGangliaSink

  `emitToGangliaHosts, flush, getGangliaConfForMetric, getHostName, getMetricsServers, isSupportSparseMetrics, xdr_int, xdr_string`

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

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

- ## Field Details

  - ### LOG

    public final org.slf4j.Logger LOG

- ## Constructor Details

  - ### GangliaSink30

    public GangliaSink30()

- ## Method Details

  - ### init

    public void init(org.apache.commons.configuration2.SubsetConfiguration conf)
    Description copied from interface: `MetricsPlugin`
    Initialize the plugin
    Specified by:
      `init` in interface `MetricsPlugin`
    Overrides:
      `init` in class `AbstractGangliaSink`
    Parameters:
      `conf` - the configuration object for the plugin

  - ### appendPrefix

    @Private public void appendPrefix(MetricsRecord record, StringBuilder sb)

  - ### putMetrics

    public void putMetrics(MetricsRecord record)
    Description copied from interface: `MetricsSink`
    Put a metrics record in the sink
    Parameters:
      `record` - the record to put

  - ### emitMetric

    protected void emitMetric(String groupName, String name, String type, String value, org.apache.hadoop.metrics2.sink.ganglia.GangliaConf gConf, AbstractGangliaSink.GangliaSlope gSlope) throws IOException
    The method sends metrics to Ganglia servers. The method has been taken from org.apache.hadoop.metrics.ganglia.GangliaContext30 with minimal changes in order to keep it in sync.
    Parameters:
      `groupName` - The group name of the metric
      `name` - The metric name
      `type` - The type of the metric
      `value` - The value of the metric
      `gConf` - The GangliaConf for this metric
      `gSlope` - The slope for this metric
    Throws:
      `IOException` - raised on errors performing I/O.