@Private
@Unstable
public class DataNodePeerMetrics
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static org.slf4j.Logger |
LOG |
| Constructor | Description |
|---|---|
DataNodePeerMetrics(java.lang.String name,
org.apache.hadoop.conf.Configuration conf) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addSendPacketDownstream(java.lang.String peerAddr,
long elapsedMs) |
Adds invocation and elapsed time of SendPacketDownstream for peer.
|
void |
collectThreadLocalStates() |
Collects states maintained in
ThreadLocal, if any. |
static DataNodePeerMetrics |
create(java.lang.String dnName,
org.apache.hadoop.conf.Configuration conf) |
Creates an instance of DataNodePeerMetrics, used for registration.
|
java.lang.String |
dumpSendPacketDownstreamAvgInfoAsJson() |
Dump SendPacketDownstreamRollingAvgTime metrics as JSON.
|
long |
getLowThresholdMs() |
|
long |
getMinOutlierDetectionNodes() |
|
long |
getMinOutlierDetectionSamples() |
|
java.util.Map<java.lang.String,org.apache.hadoop.hdfs.server.protocol.OutlierMetrics> |
getOutliers() |
Retrieve the set of dataNodes that look significantly slower
than their peers.
|
org.apache.hadoop.metrics2.lib.MutableRollingAverages |
getSendPacketDownstreamRollingAverages() |
|
OutlierDetector |
getSlowNodeDetector() |
|
java.lang.String |
name() |
|
void |
setLowThresholdMs(long thresholdMs) |
|
void |
setMinOutlierDetectionNodes(long minNodes) |
|
void |
setMinOutlierDetectionSamples(long minSamples) |
|
void |
setTestOutliers(java.util.Map<java.lang.String,org.apache.hadoop.hdfs.server.protocol.OutlierMetrics> outlier) |
Strictly to be used by test code only.
|
public DataNodePeerMetrics(java.lang.String name,
org.apache.hadoop.conf.Configuration conf)
public java.lang.String name()
public long getMinOutlierDetectionSamples()
public static DataNodePeerMetrics create(java.lang.String dnName, org.apache.hadoop.conf.Configuration conf)
public void addSendPacketDownstream(java.lang.String peerAddr,
long elapsedMs)
The caller should pass in a well-formatted peerAddr. e.g. "[192.168.1.110:1010]" is good. This will be translated into a full qualified metric name, e.g. "[192.168.1.110:1010]AvgTime".
public java.lang.String dumpSendPacketDownstreamAvgInfoAsJson()
public void collectThreadLocalStates()
ThreadLocal, if any.public java.util.Map<java.lang.String,org.apache.hadoop.hdfs.server.protocol.OutlierMetrics> getOutliers()
public void setTestOutliers(java.util.Map<java.lang.String,org.apache.hadoop.hdfs.server.protocol.OutlierMetrics> outlier)
outlier - outlier directly set by tests.public org.apache.hadoop.metrics2.lib.MutableRollingAverages getSendPacketDownstreamRollingAverages()
public void setMinOutlierDetectionNodes(long minNodes)
public long getMinOutlierDetectionNodes()
public void setLowThresholdMs(long thresholdMs)
public long getLowThresholdMs()
public void setMinOutlierDetectionSamples(long minSamples)
@VisibleForTesting public OutlierDetector getSlowNodeDetector()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.