Class RBFMetrics
java.lang.Object
org.apache.hadoop.hdfs.server.federation.metrics.RBFMetrics
- All Implemented Interfaces:
FederationMBean,RouterMBean
@Metrics(name="RBFActivity",
about="RBF metrics",
context="dfs")
public class RBFMetrics
extends Object
implements RouterMBean, FederationMBean
Implementation of the Router metrics collector.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Unregister the JMX beans.Gets the block pool ids of the namenodes.Gets the cluster ids of the namenodes.Get the compilation date of the router.Get the compilation info of the router.intGet the number of corrupts files.longGet the current number of delegation tokens in memory.longGets the total number of erasure coded low redundancy blocks on the cluster with the highest risk of loss.longGets the total number of replicated low redundancy blocks on the cluster with the highest risk of loss.Get the host and port of the router.Get the mount table for the federated filesystem or null if failure.Get information about all the namenodes in the federation or null if failure.Get the latest info for each registered nameservice.Get Max, Median, Min and Standard Deviation of DataNodes usage.longGets the total number of badly distributed blocks.longGets the total number of missing blocks on the cluster with replication factor 1.longGet the number of blocks in the federation.intGet the number of dead datanodes.intGet the number of dead decommissioned datanodes.intGet the number of live decommissioned datanodes.intGet the number of decommissioning datanodes.intGet the number of datanodes which are entering maintenance.intGet the number of expired namenodes.longGet the number of files in the federation.intGet the number of dead datanodes which are under maintenance.intGet the number of live datanodes which are under maintenance.intGet the number of live datanodes.intGet the number of namenodes.intGet the number of nameservices in the federation.longGet the number of pending deletion blocks in the federation.longGet the number of pending replication blocks in the federation.longGet the number of under replicated blocks in the federation.longGet the number of missing blocks in the federation.intGet the number of stale datanodes.intReturns the number of paths to be processed by storage policy satisfier.longGet the total remote storage capacity mounted in the federated cluster.longGet the remaining capacity of the federated cluster.Get the remaining capacity (big integer) of the federated cluster.intGets the count of the currently running router federation rename jobs.Get the identifier of the router.Get the latest state of all routers.When the router started.Get the current state of the router.Gets the safemode status.longBlocks scheduled for replication.intGets the count of the currently running jobs in the scheduler.Get the top delegation token owners(realUser).longGet the total capacity of the federated cluster.Get the total capacity (big integer) of the federated cluster.longGet the used capacity of the federated cluster.Get the used capacity (big integer) of the federated cluster.Get the version of the router.booleanGets if security is enabled.voidsetEnableGetDNUsage(boolean enableGetDNUsage)
-
Constructor Details
-
RBFMetrics
- Throws:
IOException
-
-
Method Details
-
setEnableGetDNUsage
@VisibleForTesting public void setEnableGetDNUsage(boolean enableGetDNUsage) -
close
public void close()Unregister the JMX beans. -
getNamenodes
Description copied from interface:FederationMBeanGet information about all the namenodes in the federation or null if failure.- Specified by:
getNamenodesin interfaceFederationMBean- Returns:
- JSON with all the Namenodes.
-
getNameservices
Description copied from interface:FederationMBeanGet the latest info for each registered nameservice.- Specified by:
getNameservicesin interfaceFederationMBean- Returns:
- JSON with all the nameservices.
-
getMountTable
Description copied from interface:FederationMBeanGet the mount table for the federated filesystem or null if failure.- Specified by:
getMountTablein interfaceFederationMBean- Returns:
- JSON with the mount table.
-
getRouters
Description copied from interface:FederationMBeanGet the latest state of all routers.- Specified by:
getRoutersin interfaceFederationMBean- Returns:
- JSON with all the known routers or null if failure.
-
getTotalCapacity
public long getTotalCapacity()Description copied from interface:FederationMBeanGet the total capacity of the federated cluster. The number could overflow if too big. In that case useFederationMBean.getTotalCapacityBigInt()instead.- Specified by:
getTotalCapacityin interfaceFederationMBean- Returns:
- Total capacity of the federated cluster.
-
getRemainingCapacity
public long getRemainingCapacity()Description copied from interface:FederationMBeanGet the remaining capacity of the federated cluster. The number could overflow if too big. In that case useFederationMBean.getRemainingCapacityBigInt()instead.- Specified by:
getRemainingCapacityin interfaceFederationMBean- Returns:
- Remaining capacity of the federated cluster.
-
getUsedCapacity
public long getUsedCapacity()Description copied from interface:FederationMBeanGet the used capacity of the federated cluster. The number could overflow if too big. In that case useFederationMBean.getUsedCapacityBigInt()instead.- Specified by:
getUsedCapacityin interfaceFederationMBean- Returns:
- Used capacity of the federated cluster.
-
getTotalCapacityBigInt
Description copied from interface:FederationMBeanGet the total capacity (big integer) of the federated cluster.- Specified by:
getTotalCapacityBigIntin interfaceFederationMBean- Returns:
- Total capacity of the federated cluster.
-
getRemainingCapacityBigInt
Description copied from interface:FederationMBeanGet the remaining capacity (big integer) of the federated cluster.- Specified by:
getRemainingCapacityBigIntin interfaceFederationMBean- Returns:
- Remaining capacity of the federated cluster.
-
getProvidedSpace
public long getProvidedSpace()Description copied from interface:FederationMBeanGet the total remote storage capacity mounted in the federated cluster.- Specified by:
getProvidedSpacein interfaceFederationMBean- Returns:
- Remote capacity of the federated cluster.
-
getUsedCapacityBigInt
Description copied from interface:FederationMBeanGet the used capacity (big integer) of the federated cluster.- Specified by:
getUsedCapacityBigIntin interfaceFederationMBean- Returns:
- Used capacity of the federated cluster.
-
getNumNameservices
public int getNumNameservices()Description copied from interface:FederationMBeanGet the number of nameservices in the federation.- Specified by:
getNumNameservicesin interfaceFederationMBean- Returns:
- Number of nameservices in the federation.
-
getNumNamenodes
public int getNumNamenodes()Description copied from interface:FederationMBeanGet the number of namenodes.- Specified by:
getNumNamenodesin interfaceFederationMBean- Returns:
- Number of namenodes.
-
getNumExpiredNamenodes
public int getNumExpiredNamenodes()Description copied from interface:FederationMBeanGet the number of expired namenodes.- Specified by:
getNumExpiredNamenodesin interfaceFederationMBean- Returns:
- Number of expired namenodes.
-
getNumLiveNodes
@Metric({"NumLiveNodes","Number of live data nodes"}) public int getNumLiveNodes()Description copied from interface:FederationMBeanGet the number of live datanodes.- Specified by:
getNumLiveNodesin interfaceFederationMBean- Returns:
- Number of live datanodes.
-
getNumDeadNodes
@Metric({"NumDeadNodes","Number of dead data nodes"}) public int getNumDeadNodes()Description copied from interface:FederationMBeanGet the number of dead datanodes.- Specified by:
getNumDeadNodesin interfaceFederationMBean- Returns:
- Number of dead datanodes.
-
getNumStaleNodes
@Metric({"NumStaleNodes","Number of stale data nodes"}) public int getNumStaleNodes()Description copied from interface:FederationMBeanGet the number of stale datanodes.- Specified by:
getNumStaleNodesin interfaceFederationMBean- Returns:
- Number of stale datanodes.
-
getNumDecommissioningNodes
@Metric({"NumDecommissioningNodes","Number of Decommissioning data nodes"}) public int getNumDecommissioningNodes()Description copied from interface:FederationMBeanGet the number of decommissioning datanodes.- Specified by:
getNumDecommissioningNodesin interfaceFederationMBean- Returns:
- Number of decommissioning datanodes.
-
getNumDecomLiveNodes
@Metric({"NumDecomLiveNodes","Number of decommissioned Live data nodes"}) public int getNumDecomLiveNodes()Description copied from interface:FederationMBeanGet the number of live decommissioned datanodes.- Specified by:
getNumDecomLiveNodesin interfaceFederationMBean- Returns:
- Number of live decommissioned datanodes.
-
getNumDecomDeadNodes
@Metric({"NumDecomDeadNodes","Number of decommissioned dead data nodes"}) public int getNumDecomDeadNodes()Description copied from interface:FederationMBeanGet the number of dead decommissioned datanodes.- Specified by:
getNumDecomDeadNodesin interfaceFederationMBean- Returns:
- Number of dead decommissioned datanodes.
-
getNumInMaintenanceLiveDataNodes
@Metric({"NumInMaintenanceLiveDataNodes","Number of IN_MAINTENANCE live data nodes"}) public int getNumInMaintenanceLiveDataNodes()Description copied from interface:FederationMBeanGet the number of live datanodes which are under maintenance.- Specified by:
getNumInMaintenanceLiveDataNodesin interfaceFederationMBean- Returns:
- Number of live datanodes which are under maintenance.
-
getNumInMaintenanceDeadDataNodes
@Metric({"NumInMaintenanceDeadDataNodes","Number of IN_MAINTENANCE dead data nodes"}) public int getNumInMaintenanceDeadDataNodes()Description copied from interface:FederationMBeanGet the number of dead datanodes which are under maintenance.- Specified by:
getNumInMaintenanceDeadDataNodesin interfaceFederationMBean- Returns:
- Number of dead datanodes which are under maintenance.
-
getNumEnteringMaintenanceDataNodes
@Metric({"NumEnteringMaintenanceDataNodes","Number of ENTERING_MAINTENANCE data nodes"}) public int getNumEnteringMaintenanceDataNodes()Description copied from interface:FederationMBeanGet the number of datanodes which are entering maintenance.- Specified by:
getNumEnteringMaintenanceDataNodesin interfaceFederationMBean- Returns:
- Number of datanodes which are entering maintenance.
-
getNodeUsage
Description copied from interface:FederationMBeanGet Max, Median, Min and Standard Deviation of DataNodes usage.- Specified by:
getNodeUsagein interfaceFederationMBean- Returns:
- the DataNode usage information, as a JSON string.
-
getNumBlocks
@Metric({"NumBlocks","Total number of blocks"}) public long getNumBlocks()Description copied from interface:FederationMBeanGet the number of blocks in the federation.- Specified by:
getNumBlocksin interfaceFederationMBean- Returns:
- Number of blocks in the federation.
-
getNumOfMissingBlocks
@Metric({"NumOfMissingBlocks","Number of missing blocks"}) public long getNumOfMissingBlocks()Description copied from interface:FederationMBeanGet the number of missing blocks in the federation.- Specified by:
getNumOfMissingBlocksin interfaceFederationMBean- Returns:
- Number of missing blocks in the federation.
-
getNumOfBlocksPendingReplication
@Metric({"NumOfBlocksPendingReplication","Number of blocks pending replication"}) public long getNumOfBlocksPendingReplication()Description copied from interface:FederationMBeanGet the number of pending replication blocks in the federation.- Specified by:
getNumOfBlocksPendingReplicationin interfaceFederationMBean- Returns:
- Number of pending replication blocks in the federation.
-
getNumOfBlocksUnderReplicated
@Metric({"NumOfBlocksUnderReplicated","Number of blocks under replication"}) public long getNumOfBlocksUnderReplicated()Description copied from interface:FederationMBeanGet the number of under replicated blocks in the federation.- Specified by:
getNumOfBlocksUnderReplicatedin interfaceFederationMBean- Returns:
- Number of under replicated blocks in the federation.
-
getNumOfBlocksPendingDeletion
@Metric({"NumOfBlocksPendingDeletion","Number of blocks pending deletion"}) public long getNumOfBlocksPendingDeletion()Description copied from interface:FederationMBeanGet the number of pending deletion blocks in the federation.- Specified by:
getNumOfBlocksPendingDeletionin interfaceFederationMBean- Returns:
- Number of pending deletion blocks in the federation.
-
getNumFiles
@Metric({"NumFiles","Number of files"}) public long getNumFiles()Description copied from interface:FederationMBeanGet the number of files in the federation.- Specified by:
getNumFilesin interfaceFederationMBean- Returns:
- Number of files in the federation.
-
getRouterStarted
Description copied from interface:RouterMBeanWhen the router started.- Specified by:
getRouterStartedin interfaceFederationMBean- Specified by:
getRouterStartedin interfaceRouterMBean- Returns:
- Date as a string the router started.
-
getVersion
Description copied from interface:RouterMBeanGet the version of the router.- Specified by:
getVersionin interfaceFederationMBean- Specified by:
getVersionin interfaceRouterMBean- Returns:
- Version of the router.
-
getCompiledDate
Description copied from interface:RouterMBeanGet the compilation date of the router.- Specified by:
getCompiledDatein interfaceFederationMBean- Specified by:
getCompiledDatein interfaceRouterMBean- Returns:
- Compilation date of the router.
-
getCompileInfo
Description copied from interface:RouterMBeanGet the compilation info of the router.- Specified by:
getCompileInfoin interfaceFederationMBean- Specified by:
getCompileInfoin interfaceRouterMBean- Returns:
- Compilation info of the router.
-
getHostAndPort
Description copied from interface:RouterMBeanGet the host and port of the router.- Specified by:
getHostAndPortin interfaceFederationMBean- Specified by:
getHostAndPortin interfaceRouterMBean- Returns:
- Host and port of the router.
-
getRouterId
Description copied from interface:RouterMBeanGet the identifier of the router.- Specified by:
getRouterIdin interfaceFederationMBean- Specified by:
getRouterIdin interfaceRouterMBean- Returns:
- Identifier of the router.
-
getClusterId
Description copied from interface:RouterMBeanGets the cluster ids of the namenodes.- Specified by:
getClusterIdin interfaceFederationMBean- Specified by:
getClusterIdin interfaceRouterMBean- Returns:
- the cluster ids of the namenodes.
-
getBlockPoolId
Description copied from interface:RouterMBeanGets the block pool ids of the namenodes.- Specified by:
getBlockPoolIdin interfaceFederationMBean- Specified by:
getBlockPoolIdin interfaceRouterMBean- Returns:
- the block pool ids of the namenodes.
-
getRouterStatus
Description copied from interface:RouterMBeanGet the current state of the router.- Specified by:
getRouterStatusin interfaceFederationMBean- Specified by:
getRouterStatusin interfaceRouterMBean- Returns:
- String label for the current router state.
-
getCurrentTokensCount
@Metric({"CurrentTokensCount","Number of router\'s current tokens"}) public long getCurrentTokensCount()Description copied from interface:RouterMBeanGet the current number of delegation tokens in memory.- Specified by:
getCurrentTokensCountin interfaceFederationMBean- Specified by:
getCurrentTokensCountin interfaceRouterMBean- Returns:
- number of DTs
-
getTopTokenRealOwners
Description copied from interface:RouterMBeanGet the top delegation token owners(realUser).- Specified by:
getTopTokenRealOwnersin interfaceRouterMBean- Returns:
- Json string of owners to token counts
-
isSecurityEnabled
public boolean isSecurityEnabled()Description copied from interface:RouterMBeanGets if security is enabled.- Specified by:
isSecurityEnabledin interfaceFederationMBean- Specified by:
isSecurityEnabledin interfaceRouterMBean- Returns:
- true, if security is enabled.
-
getCorruptFilesCount
public int getCorruptFilesCount()Description copied from interface:FederationMBeanGet the number of corrupts files.- Specified by:
getCorruptFilesCountin interfaceFederationMBean- Returns:
- the total number of corrupt files.
-
getScheduledReplicationBlocks
public long getScheduledReplicationBlocks()Description copied from interface:FederationMBeanBlocks scheduled for replication.- Specified by:
getScheduledReplicationBlocksin interfaceFederationMBean- Returns:
- num of blocks scheduled for replication.
-
getNumberOfMissingBlocksWithReplicationFactorOne
public long getNumberOfMissingBlocksWithReplicationFactorOne()Description copied from interface:FederationMBeanGets the total number of missing blocks on the cluster with replication factor 1.- Specified by:
getNumberOfMissingBlocksWithReplicationFactorOnein interfaceFederationMBean- Returns:
- the total number of missing blocks on the cluster with replication factor 1.
-
getHighestPriorityLowRedundancyReplicatedBlocks
public long getHighestPriorityLowRedundancyReplicatedBlocks()Description copied from interface:FederationMBeanGets the total number of replicated low redundancy blocks on the cluster with the highest risk of loss.- Specified by:
getHighestPriorityLowRedundancyReplicatedBlocksin interfaceFederationMBean- Returns:
- the total number of low redundancy blocks on the cluster with the highest risk of loss.
-
getNumberOfBadlyDistributedBlocks
public long getNumberOfBadlyDistributedBlocks()Description copied from interface:FederationMBeanGets the total number of badly distributed blocks.- Specified by:
getNumberOfBadlyDistributedBlocksin interfaceFederationMBean- Returns:
- the total number of badly distrubted blocks.
-
getHighestPriorityLowRedundancyECBlocks
public long getHighestPriorityLowRedundancyECBlocks()Description copied from interface:FederationMBeanGets the total number of erasure coded low redundancy blocks on the cluster with the highest risk of loss.- Specified by:
getHighestPriorityLowRedundancyECBlocksin interfaceFederationMBean- Returns:
- the total number of low redundancy blocks on the cluster with the highest risk of loss.
-
getPendingSPSPaths
public int getPendingSPSPaths()Description copied from interface:FederationMBeanReturns the number of paths to be processed by storage policy satisfier.- Specified by:
getPendingSPSPathsin interfaceFederationMBean- Returns:
- The number of paths to be processed by sps.
-
getRouterFederationRenameCount
@Metric({"RouterFederationRenameCount","Number of federation rename"}) public int getRouterFederationRenameCount()Description copied from interface:RouterMBeanGets the count of the currently running router federation rename jobs.- Specified by:
getRouterFederationRenameCountin interfaceRouterMBean- Returns:
- the count of the currently running router federation rename jobs.
-
getSchedulerJobCount
@Metric({"SchedulerJobCount","Number of scheduler job"}) public int getSchedulerJobCount()Description copied from interface:RouterMBeanGets the count of the currently running jobs in the scheduler. It includes both the submitted and the recovered jobs.- Specified by:
getSchedulerJobCountin interfaceRouterMBean- Returns:
- the count of the currently running jobs in the scheduler.
-
getSafemode
Description copied from interface:RouterMBeanGets the safemode status.- Specified by:
getSafemodein interfaceRouterMBean- Returns:
- the safemode status.
-