public class DefaultKafkaMetricAccumulator extends Object implements Accumulator<Void,Double>, Serializable
Modifier and Type | Field and Description |
---|---|
protected boolean |
isMerged |
protected org.apache.kafka.common.metrics.KafkaMetric |
kafkaMetric |
protected double |
mergedValue |
Modifier and Type | Method and Description |
---|---|
void |
add(Void value) |
Accumulator<Void,Double> |
clone()
Duplicates the accumulator.
|
static DefaultKafkaMetricAccumulator |
createFor(org.apache.kafka.common.Metric metric) |
Double |
getLocalValue() |
protected static org.apache.kafka.common.metrics.Measurable |
getMeasurableFromKafkaMetric(org.apache.kafka.common.metrics.KafkaMetric kafkaMetric)
This utility method is using reflection to get the Measurable from the KafkaMetric.
|
void |
merge(Accumulator<Void,Double> other)
Used by system internally to merge the collected parts of an accumulator
at the end of the job.
|
void |
resetLocal()
Reset the local value.
|
String |
toString() |
protected boolean isMerged
protected double mergedValue
protected transient org.apache.kafka.common.metrics.KafkaMetric kafkaMetric
public static DefaultKafkaMetricAccumulator createFor(org.apache.kafka.common.Metric metric)
protected static org.apache.kafka.common.metrics.Measurable getMeasurableFromKafkaMetric(org.apache.kafka.common.metrics.KafkaMetric kafkaMetric)
kafkaMetric
- the metric to extract the field formpublic void add(Void value)
add
in interface Accumulator<Void,Double>
value
- The value to add to the accumulator objectpublic Double getLocalValue()
getLocalValue
in interface Accumulator<Void,Double>
public void resetLocal()
Accumulator
resetLocal
in interface Accumulator<Void,Double>
public void merge(Accumulator<Void,Double> other)
Accumulator
merge
in interface Accumulator<Void,Double>
other
- Reference to accumulator to merge in.public Accumulator<Void,Double> clone()
Accumulator
CloneNotSupportedException
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.