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 Details

  • Method Details

    • setEnableGetDNUsage

      @VisibleForTesting public void setEnableGetDNUsage(boolean enableGetDNUsage)
    • close

      public void close()
      Unregister the JMX beans.
    • getNamenodes

      public String getNamenodes()
      Description copied from interface: FederationMBean
      Get information about all the namenodes in the federation or null if failure.
      Specified by:
      getNamenodes in interface FederationMBean
      Returns:
      JSON with all the Namenodes.
    • getNameservices

      public String getNameservices()
      Description copied from interface: FederationMBean
      Get the latest info for each registered nameservice.
      Specified by:
      getNameservices in interface FederationMBean
      Returns:
      JSON with all the nameservices.
    • getMountTable

      public String getMountTable()
      Description copied from interface: FederationMBean
      Get the mount table for the federated filesystem or null if failure.
      Specified by:
      getMountTable in interface FederationMBean
      Returns:
      JSON with the mount table.
    • getRouters

      public String getRouters()
      Description copied from interface: FederationMBean
      Get the latest state of all routers.
      Specified by:
      getRouters in interface FederationMBean
      Returns:
      JSON with all the known routers or null if failure.
    • getTotalCapacity

      public long getTotalCapacity()
      Description copied from interface: FederationMBean
      Get the total capacity of the federated cluster. The number could overflow if too big. In that case use FederationMBean.getTotalCapacityBigInt() instead.
      Specified by:
      getTotalCapacity in interface FederationMBean
      Returns:
      Total capacity of the federated cluster.
    • getRemainingCapacity

      public long getRemainingCapacity()
      Description copied from interface: FederationMBean
      Get the remaining capacity of the federated cluster. The number could overflow if too big. In that case use FederationMBean.getRemainingCapacityBigInt() instead.
      Specified by:
      getRemainingCapacity in interface FederationMBean
      Returns:
      Remaining capacity of the federated cluster.
    • getUsedCapacity

      public long getUsedCapacity()
      Description copied from interface: FederationMBean
      Get the used capacity of the federated cluster. The number could overflow if too big. In that case use FederationMBean.getUsedCapacityBigInt() instead.
      Specified by:
      getUsedCapacity in interface FederationMBean
      Returns:
      Used capacity of the federated cluster.
    • getTotalCapacityBigInt

      public BigInteger getTotalCapacityBigInt()
      Description copied from interface: FederationMBean
      Get the total capacity (big integer) of the federated cluster.
      Specified by:
      getTotalCapacityBigInt in interface FederationMBean
      Returns:
      Total capacity of the federated cluster.
    • getRemainingCapacityBigInt

      public BigInteger getRemainingCapacityBigInt()
      Description copied from interface: FederationMBean
      Get the remaining capacity (big integer) of the federated cluster.
      Specified by:
      getRemainingCapacityBigInt in interface FederationMBean
      Returns:
      Remaining capacity of the federated cluster.
    • getProvidedSpace

      public long getProvidedSpace()
      Description copied from interface: FederationMBean
      Get the total remote storage capacity mounted in the federated cluster.
      Specified by:
      getProvidedSpace in interface FederationMBean
      Returns:
      Remote capacity of the federated cluster.
    • getUsedCapacityBigInt

      public BigInteger getUsedCapacityBigInt()
      Description copied from interface: FederationMBean
      Get the used capacity (big integer) of the federated cluster.
      Specified by:
      getUsedCapacityBigInt in interface FederationMBean
      Returns:
      Used capacity of the federated cluster.
    • getNumNameservices

      public int getNumNameservices()
      Description copied from interface: FederationMBean
      Get the number of nameservices in the federation.
      Specified by:
      getNumNameservices in interface FederationMBean
      Returns:
      Number of nameservices in the federation.
    • getNumNamenodes

      public int getNumNamenodes()
      Description copied from interface: FederationMBean
      Get the number of namenodes.
      Specified by:
      getNumNamenodes in interface FederationMBean
      Returns:
      Number of namenodes.
    • getNumExpiredNamenodes

      public int getNumExpiredNamenodes()
      Description copied from interface: FederationMBean
      Get the number of expired namenodes.
      Specified by:
      getNumExpiredNamenodes in interface FederationMBean
      Returns:
      Number of expired namenodes.
    • getNumLiveNodes

      @Metric({"NumLiveNodes","Number of live data nodes"}) public int getNumLiveNodes()
      Description copied from interface: FederationMBean
      Get the number of live datanodes.
      Specified by:
      getNumLiveNodes in interface FederationMBean
      Returns:
      Number of live datanodes.
    • getNumDeadNodes

      @Metric({"NumDeadNodes","Number of dead data nodes"}) public int getNumDeadNodes()
      Description copied from interface: FederationMBean
      Get the number of dead datanodes.
      Specified by:
      getNumDeadNodes in interface FederationMBean
      Returns:
      Number of dead datanodes.
    • getNumStaleNodes

      @Metric({"NumStaleNodes","Number of stale data nodes"}) public int getNumStaleNodes()
      Description copied from interface: FederationMBean
      Get the number of stale datanodes.
      Specified by:
      getNumStaleNodes in interface FederationMBean
      Returns:
      Number of stale datanodes.
    • getNumDecommissioningNodes

      @Metric({"NumDecommissioningNodes","Number of Decommissioning data nodes"}) public int getNumDecommissioningNodes()
      Description copied from interface: FederationMBean
      Get the number of decommissioning datanodes.
      Specified by:
      getNumDecommissioningNodes in interface FederationMBean
      Returns:
      Number of decommissioning datanodes.
    • getNumDecomLiveNodes

      @Metric({"NumDecomLiveNodes","Number of decommissioned Live data nodes"}) public int getNumDecomLiveNodes()
      Description copied from interface: FederationMBean
      Get the number of live decommissioned datanodes.
      Specified by:
      getNumDecomLiveNodes in interface FederationMBean
      Returns:
      Number of live decommissioned datanodes.
    • getNumDecomDeadNodes

      @Metric({"NumDecomDeadNodes","Number of decommissioned dead data nodes"}) public int getNumDecomDeadNodes()
      Description copied from interface: FederationMBean
      Get the number of dead decommissioned datanodes.
      Specified by:
      getNumDecomDeadNodes in interface FederationMBean
      Returns:
      Number of dead decommissioned datanodes.
    • getNumInMaintenanceLiveDataNodes

      @Metric({"NumInMaintenanceLiveDataNodes","Number of IN_MAINTENANCE live data nodes"}) public int getNumInMaintenanceLiveDataNodes()
      Description copied from interface: FederationMBean
      Get the number of live datanodes which are under maintenance.
      Specified by:
      getNumInMaintenanceLiveDataNodes in interface FederationMBean
      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: FederationMBean
      Get the number of dead datanodes which are under maintenance.
      Specified by:
      getNumInMaintenanceDeadDataNodes in interface FederationMBean
      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: FederationMBean
      Get the number of datanodes which are entering maintenance.
      Specified by:
      getNumEnteringMaintenanceDataNodes in interface FederationMBean
      Returns:
      Number of datanodes which are entering maintenance.
    • getNodeUsage

      public String getNodeUsage()
      Description copied from interface: FederationMBean
      Get Max, Median, Min and Standard Deviation of DataNodes usage.
      Specified by:
      getNodeUsage in interface FederationMBean
      Returns:
      the DataNode usage information, as a JSON string.
    • getNumBlocks

      @Metric({"NumBlocks","Total number of blocks"}) public long getNumBlocks()
      Description copied from interface: FederationMBean
      Get the number of blocks in the federation.
      Specified by:
      getNumBlocks in interface FederationMBean
      Returns:
      Number of blocks in the federation.
    • getNumOfMissingBlocks

      @Metric({"NumOfMissingBlocks","Number of missing blocks"}) public long getNumOfMissingBlocks()
      Description copied from interface: FederationMBean
      Get the number of missing blocks in the federation.
      Specified by:
      getNumOfMissingBlocks in interface FederationMBean
      Returns:
      Number of missing blocks in the federation.
    • getNumOfBlocksPendingReplication

      @Metric({"NumOfBlocksPendingReplication","Number of blocks pending replication"}) public long getNumOfBlocksPendingReplication()
      Description copied from interface: FederationMBean
      Get the number of pending replication blocks in the federation.
      Specified by:
      getNumOfBlocksPendingReplication in interface FederationMBean
      Returns:
      Number of pending replication blocks in the federation.
    • getNumOfBlocksUnderReplicated

      @Metric({"NumOfBlocksUnderReplicated","Number of blocks under replication"}) public long getNumOfBlocksUnderReplicated()
      Description copied from interface: FederationMBean
      Get the number of under replicated blocks in the federation.
      Specified by:
      getNumOfBlocksUnderReplicated in interface FederationMBean
      Returns:
      Number of under replicated blocks in the federation.
    • getNumOfBlocksPendingDeletion

      @Metric({"NumOfBlocksPendingDeletion","Number of blocks pending deletion"}) public long getNumOfBlocksPendingDeletion()
      Description copied from interface: FederationMBean
      Get the number of pending deletion blocks in the federation.
      Specified by:
      getNumOfBlocksPendingDeletion in interface FederationMBean
      Returns:
      Number of pending deletion blocks in the federation.
    • getNumFiles

      @Metric({"NumFiles","Number of files"}) public long getNumFiles()
      Description copied from interface: FederationMBean
      Get the number of files in the federation.
      Specified by:
      getNumFiles in interface FederationMBean
      Returns:
      Number of files in the federation.
    • getRouterStarted

      public String getRouterStarted()
      Description copied from interface: RouterMBean
      When the router started.
      Specified by:
      getRouterStarted in interface FederationMBean
      Specified by:
      getRouterStarted in interface RouterMBean
      Returns:
      Date as a string the router started.
    • getVersion

      public String getVersion()
      Description copied from interface: RouterMBean
      Get the version of the router.
      Specified by:
      getVersion in interface FederationMBean
      Specified by:
      getVersion in interface RouterMBean
      Returns:
      Version of the router.
    • getCompiledDate

      public String getCompiledDate()
      Description copied from interface: RouterMBean
      Get the compilation date of the router.
      Specified by:
      getCompiledDate in interface FederationMBean
      Specified by:
      getCompiledDate in interface RouterMBean
      Returns:
      Compilation date of the router.
    • getCompileInfo

      public String getCompileInfo()
      Description copied from interface: RouterMBean
      Get the compilation info of the router.
      Specified by:
      getCompileInfo in interface FederationMBean
      Specified by:
      getCompileInfo in interface RouterMBean
      Returns:
      Compilation info of the router.
    • getHostAndPort

      public String getHostAndPort()
      Description copied from interface: RouterMBean
      Get the host and port of the router.
      Specified by:
      getHostAndPort in interface FederationMBean
      Specified by:
      getHostAndPort in interface RouterMBean
      Returns:
      Host and port of the router.
    • getRouterId

      public String getRouterId()
      Description copied from interface: RouterMBean
      Get the identifier of the router.
      Specified by:
      getRouterId in interface FederationMBean
      Specified by:
      getRouterId in interface RouterMBean
      Returns:
      Identifier of the router.
    • getClusterId

      public String getClusterId()
      Description copied from interface: RouterMBean
      Gets the cluster ids of the namenodes.
      Specified by:
      getClusterId in interface FederationMBean
      Specified by:
      getClusterId in interface RouterMBean
      Returns:
      the cluster ids of the namenodes.
    • getBlockPoolId

      public String getBlockPoolId()
      Description copied from interface: RouterMBean
      Gets the block pool ids of the namenodes.
      Specified by:
      getBlockPoolId in interface FederationMBean
      Specified by:
      getBlockPoolId in interface RouterMBean
      Returns:
      the block pool ids of the namenodes.
    • getRouterStatus

      public String getRouterStatus()
      Description copied from interface: RouterMBean
      Get the current state of the router.
      Specified by:
      getRouterStatus in interface FederationMBean
      Specified by:
      getRouterStatus in interface RouterMBean
      Returns:
      String label for the current router state.
    • getCurrentTokensCount

      @Metric({"CurrentTokensCount","Number of router\'s current tokens"}) public long getCurrentTokensCount()
      Description copied from interface: RouterMBean
      Get the current number of delegation tokens in memory.
      Specified by:
      getCurrentTokensCount in interface FederationMBean
      Specified by:
      getCurrentTokensCount in interface RouterMBean
      Returns:
      number of DTs
    • getTopTokenRealOwners

      public String getTopTokenRealOwners()
      Description copied from interface: RouterMBean
      Get the top delegation token owners(realUser).
      Specified by:
      getTopTokenRealOwners in interface RouterMBean
      Returns:
      Json string of owners to token counts
    • isSecurityEnabled

      public boolean isSecurityEnabled()
      Description copied from interface: RouterMBean
      Gets if security is enabled.
      Specified by:
      isSecurityEnabled in interface FederationMBean
      Specified by:
      isSecurityEnabled in interface RouterMBean
      Returns:
      true, if security is enabled.
    • getCorruptFilesCount

      public int getCorruptFilesCount()
      Description copied from interface: FederationMBean
      Get the number of corrupts files.
      Specified by:
      getCorruptFilesCount in interface FederationMBean
      Returns:
      the total number of corrupt files.
    • getScheduledReplicationBlocks

      public long getScheduledReplicationBlocks()
      Description copied from interface: FederationMBean
      Blocks scheduled for replication.
      Specified by:
      getScheduledReplicationBlocks in interface FederationMBean
      Returns:
      num of blocks scheduled for replication.
    • getNumberOfMissingBlocksWithReplicationFactorOne

      public long getNumberOfMissingBlocksWithReplicationFactorOne()
      Description copied from interface: FederationMBean
      Gets the total number of missing blocks on the cluster with replication factor 1.
      Specified by:
      getNumberOfMissingBlocksWithReplicationFactorOne in interface FederationMBean
      Returns:
      the total number of missing blocks on the cluster with replication factor 1.
    • getHighestPriorityLowRedundancyReplicatedBlocks

      public long getHighestPriorityLowRedundancyReplicatedBlocks()
      Description copied from interface: FederationMBean
      Gets the total number of replicated low redundancy blocks on the cluster with the highest risk of loss.
      Specified by:
      getHighestPriorityLowRedundancyReplicatedBlocks in interface FederationMBean
      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: FederationMBean
      Gets the total number of badly distributed blocks.
      Specified by:
      getNumberOfBadlyDistributedBlocks in interface FederationMBean
      Returns:
      the total number of badly distrubted blocks.
    • getHighestPriorityLowRedundancyECBlocks

      public long getHighestPriorityLowRedundancyECBlocks()
      Description copied from interface: FederationMBean
      Gets the total number of erasure coded low redundancy blocks on the cluster with the highest risk of loss.
      Specified by:
      getHighestPriorityLowRedundancyECBlocks in interface FederationMBean
      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: FederationMBean
      Returns the number of paths to be processed by storage policy satisfier.
      Specified by:
      getPendingSPSPaths in interface FederationMBean
      Returns:
      The number of paths to be processed by sps.
    • getRouterFederationRenameCount

      @Metric({"RouterFederationRenameCount","Number of federation rename"}) public int getRouterFederationRenameCount()
      Description copied from interface: RouterMBean
      Gets the count of the currently running router federation rename jobs.
      Specified by:
      getRouterFederationRenameCount in interface RouterMBean
      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: RouterMBean
      Gets the count of the currently running jobs in the scheduler. It includes both the submitted and the recovered jobs.
      Specified by:
      getSchedulerJobCount in interface RouterMBean
      Returns:
      the count of the currently running jobs in the scheduler.
    • getSafemode

      public String getSafemode()
      Description copied from interface: RouterMBean
      Gets the safemode status.
      Specified by:
      getSafemode in interface RouterMBean
      Returns:
      the safemode status.