@InterfaceAudience.Public @InterfaceStability.Evolving public final class IOStatisticsSnapshot extends Object implements IOStatistics, Serializable, IOStatisticsAggregator
It is serializable so that frameworks which can use java serialization
to propagate data (Spark, Flink...) can send the statistics
back. For this reason, TreeMaps are explicitly used as field types,
even though IDEs can recommend use of Map instead.
For security reasons, untrusted java object streams should never be
deserialized. If for some reason this is required, use
requiredSerializationClasses()
to get the list of classes
used when deserializing instances of this object.
It is annotated for correct serializations with jackson2.
MAX_UNSET_VALUE, MIN_UNSET_VALUE
Constructor and Description |
---|
IOStatisticsSnapshot()
Construct.
|
IOStatisticsSnapshot(IOStatistics source)
Construct, taking a snapshot of the source statistics data
if the source is non-null.
|
Modifier and Type | Method and Description |
---|---|
boolean |
aggregate(IOStatistics source)
Aggregate the current statistics with the
source reference passed in.
|
void |
clear()
Clear all the maps.
|
Map<String,Long> |
counters()
Map of counters.
|
Map<String,Long> |
gauges()
Map of gauges.
|
Map<String,Long> |
maximums()
Map of maximums.
|
Map<String,MeanStatistic> |
meanStatistics()
Map of meanStatistics.
|
Map<String,Long> |
minimums()
Map of minimums.
|
static List<Class> |
requiredSerializationClasses()
What classes are needed to deserialize this class?
Needed to securely unmarshall this from untrusted sources.
|
static org.apache.hadoop.util.JsonSerialization<IOStatisticsSnapshot> |
serializer()
Get a JSON serializer for this class.
|
void |
snapshot(IOStatistics source)
Take a snapshot.
|
String |
toString() |
public IOStatisticsSnapshot()
public IOStatisticsSnapshot(IOStatistics source)
source
- statistics source. Nullable.public void clear()
public void snapshot(IOStatistics source)
source
- statistics source.public boolean aggregate(@Nullable IOStatistics source)
aggregate
in interface IOStatisticsAggregator
source
- source; may be nullpublic Map<String,Long> counters()
IOStatistics
counters
in interface IOStatistics
public Map<String,Long> gauges()
IOStatistics
gauges
in interface IOStatistics
public Map<String,Long> minimums()
IOStatistics
minimums
in interface IOStatistics
public Map<String,Long> maximums()
IOStatistics
maximums
in interface IOStatistics
public Map<String,MeanStatistic> meanStatistics()
IOStatistics
meanStatistics
in interface IOStatistics
public static org.apache.hadoop.util.JsonSerialization<IOStatisticsSnapshot> serializer()
Copyright © 2021 Apache Software Foundation. All rights reserved.