DataNodeMetrics (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.datanode.metrics, class: DataNodeMetrics

Package org.apache.hadoop.hdfs.server.datanode.metrics

# Class DataNodeMetrics

java.lang.Object
org.apache.hadoop.hdfs.server.datanode.metrics.DataNodeMetrics

@Private @Metrics(about="DataNode metrics", context="dfs") public class DataNodeMetrics extends Object
This class is for maintaining the various DataNode statistics and publishing them through the metrics interfaces. This also registers the JMX MBean for RPC.

This class has a number of metrics variables that are publicly accessible; these variables (objects) have methods to update their values; for example:

`blocksRead`.inc()

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DataNodeMetrics(String name, String sessionId, int[] intervals, org.apache.hadoop.metrics2.source.JvmMetrics jvmMetrics)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addAcquireDataSetReadLock(long latency)`
  `void`
  `addAcquireDataSetWriteLock(long latency)`
  `void`
  `addBlockChecksumOp(long latency)`
  `void`
  `addBlockReport(long latency, String rpcMetricSuffix)`
  `void`
  `addBlockReportCreateCost(long latency)`
  `void`
  `addCacheReport(long latency)`
  `void`
  `addCheckAndUpdateOp(long latency)`
  Add addCheckAndUpdateOp metrics.
  `void`
  `addConvertTemporaryToRbwOp(long latency)`
  Add addConvertTemporaryToRbwOp metrics.
  `void`
  `addCopyBlockOp(long latency)`
  `void`
  `addCreateRbwOp(long latency)`
  Add addCreateRbwOp metrics.
  `void`
  `addCreateTemporaryOp(long latency)`
  Add addCreateTemporaryOp metrics.
  `void`
  `addFinalizeBlockOp(long latency)`
  Add addFinalizeBlockOp metrics.
  `void`
  `addFlushNanos(long latencyNanos)`
  `void`
  `addFsyncNanos(long latencyNanos)`
  `void`
  `addHeartbeat(long latency, String rpcMetricSuffix)`
  `void`
  `addHeartbeatTotal(long latency, String rpcMetricSuffix)`
  `void`
  `addIncrementalBlockReport(long latency, String rpcMetricSuffix)`
  `void`
  `addLifeline(long latency, String rpcMetricSuffix)`
  `void`
  `addNumProcessedCommands(long latency)`
  Add processedCommandsOp metrics.
  `void`
  `addPacketAckRoundTripTimeNanos(long latencyNanos)`
  `void`
  `addRamDiskBlocksEvictionWindowMs(long latencyMs)`
  `void`
  `addRamDiskBlocksLazyPersistWindowMs(long latencyMs)`
  `void`
  `addRamDiskBytesWrite(long bytes)`
  `void`
  `addReadBlockOp(long latency)`
  `void`
  `addReadTransferRate(long readTransferRate)`
  `void`
  `addRecoverRbwOp(long latency)`
  Add addRecoverRbwOp metrics.
  `void`
  `addReplaceBlockOp(long latency)`
  `void`
  `addSendDataPacketBlockedOnNetworkNanos(long latencyNanos)`
  `void`
  `addSendDataPacketTransferNanos(long latencyNanos)`
  `void`
  `addUnfinalizeBlockOp(long latency)`
  Add addUnfinalizeBlockOp metrics.
  `void`
  `addUpdateReplicaUnderRecoveryOp(long latency)`
  Add addUpdateReplicaUnderRecoveryOp metrics.
  `void`
  `addWriteBlockOp(long latency)`
  `static DataNodeMetrics`
  `create(org.apache.hadoop.conf.Configuration conf, String dnName)`
  `void`
  `decrDataNodeActiveXceiversCount()`
  `void`
  `decrDataNodeBlockRecoveryWorkerCount()`
  `void`
  `decrDataNodePacketResponderCount()`
  `void`
  `decrDataNodeReadActiveXceiversCount()`
  `void`
  `decrDataNodeWriteActiveXceiversCount()`
  `long`
  `getBlocksRemoved()`
  `int`
  `getDataNodeActiveXceiverCount()`
  `int`
  `getDataNodeBlockRecoveryWorkerCount()`
  `int`
  `getDataNodePacketResponderCount()`
  `org.apache.hadoop.hdfs.server.protocol.DataNodeUsageReport`
  `getDNUsageReport(long timeSinceLastReport)`
  `long`
  `getECInvalidReconstructionTasks()`
  `org.apache.hadoop.metrics2.source.JvmMetrics`
  `getJvmMetrics()`
  `void`
  `incrActorCmdQueueLength(int delta)`
  `void`
  `incrBlocksCached(int delta)`
  `void`
  `incrBlocksDeletedInPendingIBR()`
  `void`
  `incrBlocksGetLocalPathInfo()`
  Increment for getBlockLocalPathInfo calls
  `void`
  `incrBlocksInPendingIBR()`
  `void`
  `incrBlocksRead()`
  `void`
  `incrBlocksReceivedInPendingIBR()`
  `void`
  `incrBlocksReceivingInPendingIBR()`
  `void`
  `incrBlocksRemoved(int delta)`
  `void`
  `incrBlocksReplicated()`
  `void`
  `incrBlocksUncached(int delta)`
  `void`
  `incrBlocksVerified()`
  `void`
  `incrBlocksWritten()`
  `void`
  `incrBlockVerificationFailures()`
  `void`
  `incrBytesRead(int delta)`
  `void`
  `incrBytesWritten(int delta)`
  `void`
  `incrDataNodeActiveXceiversCount()`
  `void`
  `incrDataNodeBlockRecoveryWorkerCount()`
  `void`
  `incrDatanodeNetworkErrors()`
  `void`
  `incrDataNodePacketResponderCount()`
  `void`
  `incrDataNodeReadActiveXceiversCount()`
  `void`
  `incrDataNodeWriteActiveXceiversCount()`
  `void`
  `incrECDecodingTime(long decodingTimeNanos)`
  `void`
  `incrECFailedReconstructionTasks()`
  `void`
  `incrECInvalidReconstructionTasks()`
  `void`
  `incrECReconstructionBytesRead(long bytes)`
  `void`
  `incrECReconstructionBytesWritten(long bytes)`
  `void`
  `incrECReconstructionDecodingTime(long millis)`
  `void`
  `incrECReconstructionReadTime(long millis)`
  `void`
  `incrECReconstructionRemoteBytesRead(long bytes)`
  `void`
  `incrECReconstructionTasks()`
  `void`
  `incrECReconstructionValidateTime(long millis)`
  `void`
  `incrECReconstructionWriteTime(long millis)`
  `void`
  `incrFsyncCount()`
  `void`
  `incrNullStorageBlockReports()`
  `void`
  `incrNumProcessedCommands()`
  `void`
  `incrPacketsReceived()`
  `void`
  `incrPacketsSlowWriteToDisk()`
  `void`
  `incrPacketsSlowWriteToMirror()`
  `void`
  `incrPacketsSlowWriteToOsCache()`
  `void`
  `incrRamDiskBlocksDeletedBeforeLazyPersisted()`
  `void`
  `incrRamDiskBlocksEvicted()`
  `void`
  `incrRamDiskBlocksEvictedWithoutRead()`
  `void`
  `incrRamDiskBlocksLazyPersisted()`
  `void`
  `incrRamDiskBlocksReadHits()`
  `void`
  `incrRamDiskBlocksWrite()`
  `void`
  `incrRamDiskBlocksWriteFallback()`
  `void`
  `incrRamDiskBytesLazyPersisted(long bytes)`
  `void`
  `incrReadsFromClient(boolean local, long size)`
  `void`
  `incrReplaceBlockOpOnSameHost()`
  `void`
  `incrReplaceBlockOpOnSameMount()`
  `void`
  `incrReplaceBlockOpToOtherHost()`
  `void`
  `incrSlowAckToUpstreamCount()`
  `void`
  `incrSlowFlushOrSyncCount()`
  `void`
  `incrTotalReadTime(long timeTaken)`
  `void`
  `incrTotalWriteTime(long timeTaken)`
  `void`
  `incrVolumeFailures(int size)`
  `void`
  `incrWritesFromClient(boolean local, long size)`
  `String`
  `name()`
  `void`
  `resetBlocksInPendingIBR()`
  Resets blocks in pending IBR to zero.
  `void`
  `setDataNodeActiveXceiversCount(int value)`
  `void`
  `setDataNodeBlockRecoveryWorkerCount(int value)`
  `void`
  `setDataNodePacketResponderCount(int value)`
  `void`
  `setDataNodeReadActiveXceiversCount(int value)`
  `void`
  `setDataNodeWriteActiveXceiversCount(int value)`
  `void`
  `shutdown()`

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

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

- ## Constructor Details

  - ### DataNodeMetrics

    public DataNodeMetrics(String name, String sessionId, int[] intervals, org.apache.hadoop.metrics2.source.JvmMetrics jvmMetrics)

- ## Method Details

  - ### create

    public static DataNodeMetrics create(org.apache.hadoop.conf.Configuration conf, String dnName)

  - ### name

    public String name()

  - ### getJvmMetrics

    public org.apache.hadoop.metrics2.source.JvmMetrics getJvmMetrics()

  - ### addHeartbeat

    public void addHeartbeat(long latency, String rpcMetricSuffix)

  - ### addHeartbeatTotal

    public void addHeartbeatTotal(long latency, String rpcMetricSuffix)

  - ### addLifeline

    public void addLifeline(long latency, String rpcMetricSuffix)

  - ### addBlockReport

    public void addBlockReport(long latency, String rpcMetricSuffix)

  - ### addBlockReportCreateCost

    public void addBlockReportCreateCost(long latency)

  - ### addIncrementalBlockReport

    public void addIncrementalBlockReport(long latency, String rpcMetricSuffix)

  - ### addReadTransferRate

    public void addReadTransferRate(long readTransferRate)

  - ### addCacheReport

    public void addCacheReport(long latency)

  - ### incrBlocksReplicated

    public void incrBlocksReplicated()

  - ### incrBlocksWritten

    public void incrBlocksWritten()

  - ### incrBlocksRemoved

    public void incrBlocksRemoved(int delta)

  - ### getBlocksRemoved

    public long getBlocksRemoved()

  - ### incrBytesWritten

    public void incrBytesWritten(int delta)

  - ### incrBlockVerificationFailures

    public void incrBlockVerificationFailures()

  - ### incrBlocksVerified

    public void incrBlocksVerified()

  - ### incrBlocksCached

    public void incrBlocksCached(int delta)

  - ### incrBlocksUncached

    public void incrBlocksUncached(int delta)

  - ### addReadBlockOp

    public void addReadBlockOp(long latency)

  - ### addWriteBlockOp

    public void addWriteBlockOp(long latency)

  - ### addReplaceBlockOp

    public void addReplaceBlockOp(long latency)

  - ### addCopyBlockOp

    public void addCopyBlockOp(long latency)

  - ### addBlockChecksumOp

    public void addBlockChecksumOp(long latency)

  - ### incrBytesRead

    public void incrBytesRead(int delta)

  - ### incrBlocksRead

    public void incrBlocksRead()

  - ### incrFsyncCount

    public void incrFsyncCount()

  - ### incrTotalWriteTime

    public void incrTotalWriteTime(long timeTaken)

  - ### incrTotalReadTime

    public void incrTotalReadTime(long timeTaken)

  - ### addPacketAckRoundTripTimeNanos

    public void addPacketAckRoundTripTimeNanos(long latencyNanos)

  - ### addFlushNanos

    public void addFlushNanos(long latencyNanos)

  - ### addFsyncNanos

    public void addFsyncNanos(long latencyNanos)

  - ### shutdown

    public void shutdown()

  - ### incrWritesFromClient

    public void incrWritesFromClient(boolean local, long size)

  - ### incrReadsFromClient

    public void incrReadsFromClient(boolean local, long size)

  - ### incrVolumeFailures

    public void incrVolumeFailures(int size)

  - ### incrSlowFlushOrSyncCount

    public void incrSlowFlushOrSyncCount()

  - ### incrSlowAckToUpstreamCount

    public void incrSlowAckToUpstreamCount()

  - ### incrDatanodeNetworkErrors

    public void incrDatanodeNetworkErrors()

  - ### incrBlocksGetLocalPathInfo

    public void incrBlocksGetLocalPathInfo()
    Increment for getBlockLocalPathInfo calls

  - ### addSendDataPacketBlockedOnNetworkNanos

    public void addSendDataPacketBlockedOnNetworkNanos(long latencyNanos)

  - ### addSendDataPacketTransferNanos

    public void addSendDataPacketTransferNanos(long latencyNanos)

  - ### incrRamDiskBlocksWrite

    public void incrRamDiskBlocksWrite()

  - ### incrRamDiskBlocksWriteFallback

    public void incrRamDiskBlocksWriteFallback()

  - ### addRamDiskBytesWrite

    public void addRamDiskBytesWrite(long bytes)

  - ### incrRamDiskBlocksReadHits

    public void incrRamDiskBlocksReadHits()

  - ### incrRamDiskBlocksEvicted

    public void incrRamDiskBlocksEvicted()

  - ### incrRamDiskBlocksEvictedWithoutRead

    public void incrRamDiskBlocksEvictedWithoutRead()

  - ### addRamDiskBlocksEvictionWindowMs

    public void addRamDiskBlocksEvictionWindowMs(long latencyMs)

  - ### incrRamDiskBlocksLazyPersisted

    public void incrRamDiskBlocksLazyPersisted()

  - ### incrRamDiskBlocksDeletedBeforeLazyPersisted

    public void incrRamDiskBlocksDeletedBeforeLazyPersisted()

  - ### incrRamDiskBytesLazyPersisted

    public void incrRamDiskBytesLazyPersisted(long bytes)

  - ### addRamDiskBlocksLazyPersistWindowMs

    public void addRamDiskBlocksLazyPersistWindowMs(long latencyMs)

  - ### resetBlocksInPendingIBR

    public void resetBlocksInPendingIBR()
    Resets blocks in pending IBR to zero.

  - ### incrBlocksInPendingIBR

    public void incrBlocksInPendingIBR()

  - ### incrBlocksReceivingInPendingIBR

    public void incrBlocksReceivingInPendingIBR()

  - ### incrBlocksReceivedInPendingIBR

    public void incrBlocksReceivedInPendingIBR()

  - ### incrBlocksDeletedInPendingIBR

    public void incrBlocksDeletedInPendingIBR()

  - ### incrECReconstructionTasks

    public void incrECReconstructionTasks()

  - ### incrECFailedReconstructionTasks

    public void incrECFailedReconstructionTasks()

  - ### incrECInvalidReconstructionTasks

    public void incrECInvalidReconstructionTasks()

  - ### getECInvalidReconstructionTasks

    public long getECInvalidReconstructionTasks()

  - ### incrDataNodeActiveXceiversCount

    public void incrDataNodeActiveXceiversCount()

  - ### decrDataNodeActiveXceiversCount

    public void decrDataNodeActiveXceiversCount()

  - ### setDataNodeActiveXceiversCount

    public void setDataNodeActiveXceiversCount(int value)

  - ### getDataNodeActiveXceiverCount

    public int getDataNodeActiveXceiverCount()

  - ### incrDataNodeReadActiveXceiversCount

    public void incrDataNodeReadActiveXceiversCount()

  - ### decrDataNodeReadActiveXceiversCount

    public void decrDataNodeReadActiveXceiversCount()

  - ### setDataNodeReadActiveXceiversCount

    public void setDataNodeReadActiveXceiversCount(int value)

  - ### incrDataNodeWriteActiveXceiversCount

    public void incrDataNodeWriteActiveXceiversCount()

  - ### decrDataNodeWriteActiveXceiversCount

    public void decrDataNodeWriteActiveXceiversCount()

  - ### setDataNodeWriteActiveXceiversCount

    public void setDataNodeWriteActiveXceiversCount(int value)

  - ### incrDataNodePacketResponderCount

    public void incrDataNodePacketResponderCount()

  - ### decrDataNodePacketResponderCount

    public void decrDataNodePacketResponderCount()

  - ### setDataNodePacketResponderCount

    public void setDataNodePacketResponderCount(int value)

  - ### getDataNodePacketResponderCount

    public int getDataNodePacketResponderCount()

  - ### incrDataNodeBlockRecoveryWorkerCount

    public void incrDataNodeBlockRecoveryWorkerCount()

  - ### decrDataNodeBlockRecoveryWorkerCount

    public void decrDataNodeBlockRecoveryWorkerCount()

  - ### setDataNodeBlockRecoveryWorkerCount

    public void setDataNodeBlockRecoveryWorkerCount(int value)

  - ### getDataNodeBlockRecoveryWorkerCount

    public int getDataNodeBlockRecoveryWorkerCount()

  - ### incrECDecodingTime

    public void incrECDecodingTime(long decodingTimeNanos)

  - ### incrECReconstructionBytesRead

    public void incrECReconstructionBytesRead(long bytes)

  - ### incrECReconstructionRemoteBytesRead

    public void incrECReconstructionRemoteBytesRead(long bytes)

  - ### incrECReconstructionBytesWritten

    public void incrECReconstructionBytesWritten(long bytes)

  - ### incrECReconstructionReadTime

    public void incrECReconstructionReadTime(long millis)

  - ### incrECReconstructionWriteTime

    public void incrECReconstructionWriteTime(long millis)

  - ### incrECReconstructionDecodingTime

    public void incrECReconstructionDecodingTime(long millis)

  - ### incrECReconstructionValidateTime

    public void incrECReconstructionValidateTime(long millis)

  - ### getDNUsageReport

    public org.apache.hadoop.hdfs.server.protocol.DataNodeUsageReport getDNUsageReport(long timeSinceLastReport)

  - ### incrActorCmdQueueLength

    public void incrActorCmdQueueLength(int delta)

  - ### incrNumProcessedCommands

    public void incrNumProcessedCommands()

  - ### addNumProcessedCommands

    public void addNumProcessedCommands(long latency)
    Add processedCommandsOp metrics.
    Parameters:
      `latency` - milliseconds of process commands

  - ### addCreateRbwOp

    public void addCreateRbwOp(long latency)
    Add addCreateRbwOp metrics.
    Parameters:
      `latency` - milliseconds of create RBW file

  - ### addRecoverRbwOp

    public void addRecoverRbwOp(long latency)
    Add addRecoverRbwOp metrics.
    Parameters:
      `latency` - milliseconds of recovery RBW file

  - ### addConvertTemporaryToRbwOp

    public void addConvertTemporaryToRbwOp(long latency)
    Add addConvertTemporaryToRbwOp metrics.
    Parameters:
      `latency` - milliseconds of convert temporary to RBW file

  - ### addCreateTemporaryOp

    public void addCreateTemporaryOp(long latency)
    Add addCreateTemporaryOp metrics.
    Parameters:
      `latency` - milliseconds of create temporary block file

  - ### addFinalizeBlockOp

    public void addFinalizeBlockOp(long latency)
    Add addFinalizeBlockOp metrics.
    Parameters:
      `latency` - milliseconds of finalize block

  - ### addUnfinalizeBlockOp

    public void addUnfinalizeBlockOp(long latency)
    Add addUnfinalizeBlockOp metrics.
    Parameters:
      `latency` - milliseconds of un-finalize block file

  - ### addCheckAndUpdateOp

    public void addCheckAndUpdateOp(long latency)
    Add addCheckAndUpdateOp metrics.
    Parameters:
      `latency` - milliseconds of check and update block file

  - ### addUpdateReplicaUnderRecoveryOp

    public void addUpdateReplicaUnderRecoveryOp(long latency)
    Add addUpdateReplicaUnderRecoveryOp metrics.
    Parameters:
      `latency` - milliseconds of update and replica under recovery block file

  - ### incrPacketsReceived

    public void incrPacketsReceived()

  - ### incrPacketsSlowWriteToMirror

    public void incrPacketsSlowWriteToMirror()

  - ### incrPacketsSlowWriteToDisk

    public void incrPacketsSlowWriteToDisk()

  - ### incrPacketsSlowWriteToOsCache

    public void incrPacketsSlowWriteToOsCache()

  - ### incrReplaceBlockOpOnSameMount

    public void incrReplaceBlockOpOnSameMount()

  - ### incrReplaceBlockOpOnSameHost

    public void incrReplaceBlockOpOnSameHost()

  - ### incrReplaceBlockOpToOtherHost

    public void incrReplaceBlockOpToOtherHost()

  - ### incrNullStorageBlockReports

    public void incrNullStorageBlockReports()

  - ### addAcquireDataSetReadLock

    public void addAcquireDataSetReadLock(long latency)

  - ### addAcquireDataSetWriteLock

    public void addAcquireDataSetWriteLock(long latency)