Class FSNamesystem

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.FSNamesystem
All Implemented Interfaces:
ECBlockGroupsMBean, FSNamesystemMBean, ReplicatedBlocksMBean, NameNodeMXBean, Namesystem, SafeMode, RwLock

@Private @Metrics(context="dfs") public class FSNamesystem extends Object implements Namesystem, FSNamesystemMBean, NameNodeMXBean, ReplicatedBlocksMBean, ECBlockGroupsMBean
FSNamesystem is a container of both transient and persisted name-space state, and does all the book-keeping work on a NameNode. Its roles are briefly described below: 1) Is the container for BlockManager, DatanodeManager, DelegationTokens, LeaseManager, etc. services. 2) RPC calls that modify or inspect the name-space should get delegated here. 3) Anything that touches only blocks (eg. block reports), it delegates to BlockManager. 4) Anything that touches only file information (eg. permissions, mkdirs), it delegates to FSDirectory. 5) Anything that crosses two of the above components should be coordinated here. 6) Logs mutations to FSEditLog. This class and its contents keep: 1) Valid fsname --> blocklist (kept on disk, logged) 2) Set of all valid blocks (inverted #1) 3) block --> machinelist (kept in memory, rebuilt dynamically from reports) 4) machine --> blocklist (inverted #2) 5) LRU cache of updated-heartbeat machines
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
    • DFS_NAMENODE_SNAPSHOT_TRASHROOT_ENABLED

      public static final String DFS_NAMENODE_SNAPSHOT_TRASHROOT_ENABLED
      See Also:
    • DFS_NAMENODE_SNAPSHOT_TRASHROOT_ENABLED_DEFAULT

      public static final boolean DFS_NAMENODE_SNAPSHOT_TRASHROOT_ENABLED_DEFAULT
      See Also:
    • AUDIT_LOG

      public static final org.slf4j.Logger AUDIT_LOG
      Logger for audit events, noting successful FSNamesystem operations. Emits to FSNamesystem.audit at INFO. Each event causes a set of tab-separated key=value pairs to be written for the following properties: ugi=<ugi in RPC> ip=<remote IP> cmd=<command> src=<src path> dst=<dst path (optional)> perm=<permissions (optional)>
  • Method Details

    • setImageLoaded

      protected void setImageLoaded(boolean flag)
    • getLazyPersistFileScrubberTS

      @VisibleForTesting public long getLazyPersistFileScrubberTS()
      Used as ad hoc to check the time stamp of the last full cycle of lazyPersistFileScrubber daemon. This is used by the Junit tests to block until lazyPersistFileScrubberTS is updated.
      Returns:
      the current lazyPersistFileScrubberTS if lazyPersistFileScrubber is not null.
    • isHaEnabled

      public boolean isHaEnabled()
    • getAuditLoggers

      @VisibleForTesting public List<AuditLogger> getAuditLoggers()
    • getRetryCache

      @VisibleForTesting public org.apache.hadoop.ipc.RetryCache getRetryCache()
    • getLeaseRecheckIntervalMs

      @VisibleForTesting public long getLeaseRecheckIntervalMs()
    • getMaxLockHoldToReleaseLeaseMs

      @VisibleForTesting public long getMaxLockHoldToReleaseLeaseMs()
    • getMaxListOpenFilesResponses

      public int getMaxListOpenFilesResponses()
    • getProvider

      @VisibleForTesting public org.apache.hadoop.crypto.key.KeyProviderCryptoExtension getProvider()
    • startSecretManagerIfNecessary

      public void startSecretManagerIfNecessary()
      Specified by:
      startSecretManagerIfNecessary in interface Namesystem
    • inTransitionToActive

      public boolean inTransitionToActive()
      Specified by:
      inTransitionToActive in interface Namesystem
      Returns:
      Whether the namenode is transitioning to active state and is in the middle of the starting active services.
    • checkOperation

      public void checkOperation(NameNode.OperationCategory op) throws org.apache.hadoop.ipc.StandbyException
      Throws:
      org.apache.hadoop.ipc.StandbyException
    • getNamespaceDirs

      public static Collection<URI> getNamespaceDirs(org.apache.hadoop.conf.Configuration conf)
    • getRequiredNamespaceEditsDirs

      public static Collection<URI> getRequiredNamespaceEditsDirs(org.apache.hadoop.conf.Configuration conf)
      Get all edits dirs which are required. If any shared edits dirs are configured, these are also included in the set of required dirs.
      Parameters:
      conf - the HDFS configuration.
      Returns:
      all required dirs.
    • getNamespaceEditsDirs

      public static List<URI> getNamespaceEditsDirs(org.apache.hadoop.conf.Configuration conf) throws IOException
      Return an ordered list of edits directories to write to. The list is ordered such that all shared edits directories are ordered before non-shared directories, and any duplicates are removed. The order they are specified in the configuration is retained.
      Returns:
      Collection of shared edits directories.
      Throws:
      IOException - if multiple shared edits directories are configured
    • getNamespaceEditsDirs

      public static List<URI> getNamespaceEditsDirs(org.apache.hadoop.conf.Configuration conf, boolean includeShared) throws IOException
      Throws:
      IOException
    • getSharedEditsDirs

      public static List<URI> getSharedEditsDirs(org.apache.hadoop.conf.Configuration conf)
      Returns edit directories that are shared between primary and secondary.
      Parameters:
      conf - configuration
      Returns:
      collection of edit directories from conf
    • readLock

      public void readLock(RwLockMode lockMode)
      Description copied from interface: RwLock
      Acquire read lock.
      Specified by:
      readLock in interface RwLock
      Parameters:
      lockMode - The lock type for acquiring a read lock
    • readLockInterruptibly

      public void readLockInterruptibly(RwLockMode lockMode) throws InterruptedException
      Description copied from interface: RwLock
      Acquire read lock, unless interrupted while waiting.
      Specified by:
      readLockInterruptibly in interface RwLock
      Parameters:
      lockMode - The lock type for acquiring a read lock
      Throws:
      InterruptedException - if the thread is interrupted
    • readUnlock

      public void readUnlock(RwLockMode lockMode, String opName)
      Description copied from interface: RwLock
      Release read lock with operation name.
      Specified by:
      readUnlock in interface RwLock
      Parameters:
      lockMode - The lock type for releasing the read lock
      opName - Option name.
    • readUnlock

      public void readUnlock(String opName, Supplier<String> lockReportInfoSupplier)
    • readUnlock

      public void readUnlock(RwLockMode lockMode, String opName, Supplier<String> lockReportInfoSupplier)
    • writeLock

      public void writeLock(RwLockMode lockMode)
      Description copied from interface: RwLock
      Acquire write lock.
      Specified by:
      writeLock in interface RwLock
      Parameters:
      lockMode - The lock type for acquiring a write lock
    • writeLockInterruptibly

      public void writeLockInterruptibly(RwLockMode lockMode) throws InterruptedException
      Description copied from interface: RwLock
      Acquire write lock, unless interrupted while waiting.
      Specified by:
      writeLockInterruptibly in interface RwLock
      Parameters:
      lockMode - The lock type for acquiring a write lock
      Throws:
      InterruptedException - if the thread is interrupted
    • writeUnlock

      public void writeUnlock(RwLockMode lockMode, String opName)
      Description copied from interface: RwLock
      Release write lock with operation name.
      Specified by:
      writeUnlock in interface RwLock
      Parameters:
      lockMode - The lock type for releasing the write lock
      opName - Option name.
    • writeUnlock

      public void writeUnlock(String opName, boolean suppressWriteLockReport)
    • writeUnlock

      public void writeUnlock(RwLockMode lockMode, String opName, boolean suppressWriteLockReport)
    • writeUnlock

      public void writeUnlock(String opName, Supplier<String> lockReportInfoSupplier)
    • writeUnlock

      public void writeUnlock(RwLockMode lockMode, String opName, Supplier<String> lockReportInfoSupplier)
    • hasWriteLock

      public boolean hasWriteLock(RwLockMode lockMode)
      Description copied from interface: RwLock
      Check if the current thread holds write lock.
      Specified by:
      hasWriteLock in interface RwLock
      Parameters:
      lockMode - The lock type used to check whether a write lock is held
      Returns:
      true if the write lock is held by the current thread, else false.
    • hasReadLock

      public boolean hasReadLock(RwLockMode lockMode)
      Description copied from interface: RwLock
      Check if the current thread holds read lock.
      Specified by:
      hasReadLock in interface RwLock
      Parameters:
      lockMode - The lock type used to check whether a read lock is held
      Returns:
      true if the read lock is held by the current thread, else false
    • getReadHoldCount

      public int getReadHoldCount()
    • cpLock

      public void cpLock()
      Lock the checkpoint lock
    • cpLockInterruptibly

      public void cpLockInterruptibly() throws InterruptedException
      Lock the checkpoint lock interrupibly
      Throws:
      InterruptedException
    • cpUnlock

      public void cpUnlock()
      Unlock the checkpoint lock
    • isRunning

      public boolean isRunning()
      Description copied from interface: Namesystem
      Is this name system running?
      Specified by:
      isRunning in interface Namesystem
    • isInStandbyState

      public boolean isInStandbyState()
    • getBlocks

      public BlocksWithLocations getBlocks(org.apache.hadoop.hdfs.protocol.DatanodeID datanode, long size, long minimumBlockSize, long timeInterval, org.apache.hadoop.fs.StorageType storageType) throws IOException
      return a list of blocks & their locations on datanode whose total size is size
      Parameters:
      datanode - on which blocks are located
      size - total size of blocks
      minimumBlockSize - each block should be of this minimum Block Size
      timeInterval - prefer to get blocks which are belong to the cold files accessed before the time interval
      storageType - the given storage type StorageType
      Throws:
      IOException
    • getFilesBlockingDecom

      public org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries<org.apache.hadoop.hdfs.protocol.OpenFileEntry> getFilesBlockingDecom(long prevId, String path)
    • getServerDefaults

      @VisibleForTesting public org.apache.hadoop.fs.FsServerDefaults getServerDefaults() throws org.apache.hadoop.ipc.StandbyException
      Throws:
      org.apache.hadoop.ipc.StandbyException
    • isInSnapshot

      public boolean isInSnapshot(long blockCollectionID)
      Specified by:
      isInSnapshot in interface Namesystem
    • getBlockCollection

      public INodeFile getBlockCollection(long id)
      Specified by:
      getBlockCollection in interface Namesystem
    • getSrcPathsHash

      public byte[] getSrcPathsHash(String[] srcs)
    • getFSImage

      public FSImage getFSImage()
    • getEditLog

      public FSEditLog getEditLog()
    • getMissingBlocksCount

      @Metric({"MissingBlocks","Number of missing blocks"}) public long getMissingBlocksCount()
    • getMissingReplOneBlocksCount

      @Metric({"MissingReplOneBlocks","Number of missing blocks with replication factor 1"}) public long getMissingReplOneBlocksCount()
    • getBadlyDistributedBlocksCount

      @Metric({"BadlyDistBlocks","Number of Badly Distributed Blocks"}) public long getBadlyDistributedBlocksCount()
    • getExpiredHeartbeats

      @Metric(value={"ExpiredHeartbeats","Number of expired heartbeats"}, type=COUNTER) public int getExpiredHeartbeats()
    • getTransactionsSinceLastCheckpoint

      @Metric({"TransactionsSinceLastCheckpoint","Number of transactions since last checkpoint"}) public long getTransactionsSinceLastCheckpoint()
    • getTransactionsSinceLastLogRoll

      @Metric({"TransactionsSinceLastLogRoll","Number of transactions since last edit log roll"}) public long getTransactionsSinceLastLogRoll()
    • getLastWrittenTransactionId

      @Metric({"LastWrittenTransactionId","Transaction ID written to the edit log"}) public long getLastWrittenTransactionId()
    • getLastCheckpointTime

      @Metric({"LastCheckpointTime","Time in milliseconds since the epoch of the last checkpoint"}) public long getLastCheckpointTime()
    • getCapacityTotal

      @Metric({"CapacityTotal","Total raw capacity of data nodes in bytes"}) public long getCapacityTotal()
      Description copied from interface: FSNamesystemMBean
      Total storage capacity
      Specified by:
      getCapacityTotal in interface FSNamesystemMBean
      Returns:
      - total capacity in bytes
    • getCapacityTotalGB

      @Metric({"CapacityTotalGB","Total raw capacity of data nodes in GB"}) public float getCapacityTotalGB()
    • getCapacityUsed

      @Metric({"CapacityUsed","Total used capacity across all data nodes in bytes"}) public long getCapacityUsed()
      Description copied from interface: FSNamesystemMBean
      Used storage capacity
      Specified by:
      getCapacityUsed in interface FSNamesystemMBean
      Returns:
      - used capacity in bytes
    • getCapacityUsedGB

      @Metric({"CapacityUsedGB","Total used capacity across all data nodes in GB"}) public float getCapacityUsedGB()
    • getCapacityRemaining

      @Metric({"CapacityRemaining","Remaining capacity in bytes"}) public long getCapacityRemaining()
      Description copied from interface: FSNamesystemMBean
      Free (unused) storage capacity
      Specified by:
      getCapacityRemaining in interface FSNamesystemMBean
      Returns:
      - free capacity in bytes
    • getProvidedCapacityTotal

      @Metric({"ProvidedCapacityTotal","Total space used in PROVIDED storage in bytes"}) public long getProvidedCapacityTotal()
      Description copied from interface: FSNamesystemMBean
      Total PROVIDED storage capacity.
      Specified by:
      getProvidedCapacityTotal in interface FSNamesystemMBean
      Returns:
      - total PROVIDED storage capacity in bytes
    • getCapacityRemainingGB

      @Metric({"CapacityRemainingGB","Remaining capacity in GB"}) public float getCapacityRemainingGB()
    • getCapacityUsedNonDFS

      @Metric({"CapacityUsedNonDFS","Total space used by data nodes for non DFS purposes in bytes"}) public long getCapacityUsedNonDFS()
    • getTotalLoad

      @Metric public int getTotalLoad()
      Total number of connections.
      Specified by:
      getTotalLoad in interface FSNamesystemMBean
      Returns:
      - total load of FSNamesystem
    • getNumSnapshottableDirs

      @Metric({"SnapshottableDirectories","Number of snapshottable directories"}) public int getNumSnapshottableDirs()
    • getNumSnapshots

      @Metric({"Snapshots","The number of snapshots"}) public int getNumSnapshots()
    • getSnapshotStats

      public String getSnapshotStats()
      Description copied from interface: FSNamesystemMBean
      The statistics of snapshots
      Specified by:
      getSnapshotStats in interface FSNamesystemMBean
    • getNumEncryptionZones

      @Metric({"NumEncryptionZones","The number of encryption zones"}) public int getNumEncryptionZones()
      Description copied from interface: FSNamesystemMBean
      Return the number of encryption zones in the system.
      Specified by:
      getNumEncryptionZones in interface FSNamesystemMBean
    • getCurrentTokensCount

      @Metric({"CurrentTokensCount","The number of delegation tokens"}) public long getCurrentTokensCount()
      Description copied from interface: FSNamesystemMBean
      Get the current number of delegation tokens in memory.
      Specified by:
      getCurrentTokensCount in interface FSNamesystemMBean
      Returns:
      number of DTs
    • getPendingSPSPaths

      @Metric({"PendingSPSPaths","The number of paths to be processed by storage policy satisfier"}) public int getPendingSPSPaths()
      Description copied from interface: FSNamesystemMBean
      Returns the number of paths to be processed by storage policy satisfier.
      Specified by:
      getPendingSPSPaths in interface FSNamesystemMBean
      Returns:
      The number of paths to be processed by sps.
    • getReconstructionQueuesInitProgress

      @Metric public float getReconstructionQueuesInitProgress()
      Get the progress of the reconstruction queues initialisation.
      Specified by:
      getReconstructionQueuesInitProgress in interface FSNamesystemMBean
      Returns:
      Returns values between 0 and 1 for the progress.
    • getFsLockQueueLength

      @Metric({"LockQueueLength","Number of threads waiting to acquire FSNameSystemLock"}) public int getFsLockQueueLength()
      Returns the length of the wait Queue for the FSNameSystemLock. A larger number here indicates lots of threads are waiting for FSNameSystemLock.
      Specified by:
      getFsLockQueueLength in interface FSNamesystemMBean
      Returns:
      int - Number of Threads waiting to acquire FSNameSystemLock
    • getNumOfReadLockLongHold

      @Metric(value={"ReadLockLongHoldCount","The number of time the read lock has been held for longer than the threshold"}, type=COUNTER) public long getNumOfReadLockLongHold()
    • getNumOfWriteLockLongHold

      @Metric(value={"WriteLockLongHoldCount","The number of time the write lock has been held for longer than the threshold"}, type=COUNTER) public long getNumOfWriteLockLongHold()
    • getBlocksTotal

      @Metric public long getBlocksTotal()
      Get the total number of blocks in the system.
      Specified by:
      getBlocksTotal in interface FSNamesystemMBean
      Returns:
      - number of allocated blocks
    • getNumFilesUnderConstruction

      @Metric({"NumFilesUnderConstruction","Number of files under construction"}) public long getNumFilesUnderConstruction()
      Get the number of files under construction in the system.
    • getNumActiveClients

      @Metric({"NumActiveClients","Number of active clients holding lease"}) public long getNumActiveClients()
      Get the total number of active clients holding lease in the system.
    • getCompleteBlocksTotal

      public long getCompleteBlocksTotal()
      Get the total number of COMPLETE blocks in the system. For safe mode only complete blocks are counted. This is invoked only during NN startup and checkpointing.
    • isInSafeMode

      public boolean isInSafeMode()
      Description copied from interface: SafeMode
      Is the system in safe mode?
      Specified by:
      isInSafeMode in interface SafeMode
    • isInStartupSafeMode

      public boolean isInStartupSafeMode()
      Description copied from interface: SafeMode
      Is the system in startup safe mode, i.e. the system is starting up with safe mode turned on automatically?
      Specified by:
      isInStartupSafeMode in interface SafeMode
    • processIncrementalBlockReport

      public void processIncrementalBlockReport(org.apache.hadoop.hdfs.protocol.DatanodeID nodeID, StorageReceivedDeletedBlocks srdb) throws IOException
      Throws:
      IOException
    • getMaxObjects

      public long getMaxObjects()
      Description copied from interface: FSNamesystemMBean
      Return the maximum number of inodes in the file system
      Specified by:
      getMaxObjects in interface FSNamesystemMBean
    • getFilesTotal

      @Metric public long getFilesTotal()
      Description copied from interface: FSNamesystemMBean
      Total number of files and directories
      Specified by:
      getFilesTotal in interface FSNamesystemMBean
      Returns:
      - num of files and directories
    • getPendingReplicationBlocks

      @Metric @Deprecated public long getPendingReplicationBlocks()
      Deprecated.
      Get aggregated count of all blocks pending to be reconstructed.
      Specified by:
      getPendingReplicationBlocks in interface FSNamesystemMBean
    • getPendingReconstructionBlocks

      @Metric public long getPendingReconstructionBlocks()
      Get aggregated count of all blocks pending to be reconstructed.
      Specified by:
      getPendingReconstructionBlocks in interface FSNamesystemMBean
      Returns:
      Number of blocks to be replicated.
    • getUnderReplicatedBlocks

      @Metric @Deprecated public long getUnderReplicatedBlocks()
      Deprecated.
      Get aggregated count of all blocks with low redundancy.
      Specified by:
      getUnderReplicatedBlocks in interface FSNamesystemMBean
    • getLowRedundancyBlocks

      @Metric public long getLowRedundancyBlocks()
      Get aggregated count of all blocks with low redundancy.
      Specified by:
      getLowRedundancyBlocks in interface FSNamesystemMBean
      Returns:
      Number of blocks with low redundancy.
    • getCorruptReplicaBlocks

      @Metric({"CorruptBlocks","Number of blocks with corrupt replicas"}) public long getCorruptReplicaBlocks()
      Returns number of blocks with corrupt replicas
    • getScheduledReplicationBlocks

      @Metric public long getScheduledReplicationBlocks()
      Description copied from interface: FSNamesystemMBean
      Blocks scheduled for replication
      Specified by:
      getScheduledReplicationBlocks in interface FSNamesystemMBean
      Returns:
      - num of blocks scheduled for replication
    • getPendingDeletionBlocks

      @Metric public long getPendingDeletionBlocks()
      Description copied from interface: FSNamesystemMBean
      Number of blocks pending deletion
      Specified by:
      getPendingDeletionBlocks in interface FSNamesystemMBean
      Returns:
      number of blocks pending deletion
    • getLowRedundancyReplicatedBlocks

      @Metric({"LowRedundancyReplicatedBlocks","Number of low redundancy replicated blocks"}) public long getLowRedundancyReplicatedBlocks()
      Description copied from interface: ReplicatedBlocksMBean
      Return low redundancy blocks count.
      Specified by:
      getLowRedundancyReplicatedBlocks in interface ReplicatedBlocksMBean
    • getCorruptReplicatedBlocks

      @Metric({"CorruptReplicatedBlocks","Number of corrupted replicated blocks"}) public long getCorruptReplicatedBlocks()
      Description copied from interface: ReplicatedBlocksMBean
      Return corrupt blocks count.
      Specified by:
      getCorruptReplicatedBlocks in interface ReplicatedBlocksMBean
    • getMissingReplicatedBlocks

      @Metric({"MissingReplicatedBlocks","Number of missing replicated blocks"}) public long getMissingReplicatedBlocks()
      Description copied from interface: ReplicatedBlocksMBean
      Return missing blocks count.
      Specified by:
      getMissingReplicatedBlocks in interface ReplicatedBlocksMBean
    • getMissingReplicationOneBlocks

      @Metric({"MissingReplicationOneBlocks","Number of missing replicated blocks with replication factor 1"}) public long getMissingReplicationOneBlocks()
      Description copied from interface: ReplicatedBlocksMBean
      Return count of missing blocks with replication factor one.
      Specified by:
      getMissingReplicationOneBlocks in interface ReplicatedBlocksMBean
    • getBadlyDistributedBlocks

      @Metric({"BadlyDistributedBlocks","Number of badly distributed blocks"}) public long getBadlyDistributedBlocks()
      Description copied from interface: ReplicatedBlocksMBean
      Return count of badly distributed blocks
      Specified by:
      getBadlyDistributedBlocks in interface ReplicatedBlocksMBean
    • getHighestPriorityLowRedundancyReplicatedBlocks

      @Metric({"HighestPriorityLowRedundancyReplicatedBlocks","Number of replicated blocks which have the highest risk of loss."}) public long getHighestPriorityLowRedundancyReplicatedBlocks()
      Description copied from interface: NameNodeMXBean
      Gets the total number of replicated low redundancy blocks on the cluster with the highest risk of loss.
      Specified by:
      getHighestPriorityLowRedundancyReplicatedBlocks in interface NameNodeMXBean
      Returns:
      the total number of low redundancy blocks on the cluster with the highest risk of loss.
    • getHighestPriorityLowRedundancyECBlocks

      @Metric({"HighestPriorityLowRedundancyECBlocks","Number of erasure coded blocks which have the highest risk of loss."}) public long getHighestPriorityLowRedundancyECBlocks()
      Description copied from interface: NameNodeMXBean
      Gets the total number of erasure coded low redundancy blocks on the cluster with the highest risk of loss.
      Specified by:
      getHighestPriorityLowRedundancyECBlocks in interface NameNodeMXBean
      Returns:
      the total number of low redundancy blocks on the cluster with the highest risk of loss.
    • getBytesInFutureReplicatedBlocks

      @Metric({"BytesInFutureReplicatedBlocks","Total bytes in replicated blocks with future generation stamp"}) public long getBytesInFutureReplicatedBlocks()
      Description copied from interface: ReplicatedBlocksMBean
      Return total bytes of future blocks.
      Specified by:
      getBytesInFutureReplicatedBlocks in interface ReplicatedBlocksMBean
    • getPendingDeletionReplicatedBlocks

      @Metric({"PendingDeletionReplicatedBlocks","Number of replicated blocks that are pending deletion"}) public long getPendingDeletionReplicatedBlocks()
      Description copied from interface: ReplicatedBlocksMBean
      Return count of blocks that are pending deletion.
      Specified by:
      getPendingDeletionReplicatedBlocks in interface ReplicatedBlocksMBean
    • getTotalReplicatedBlocks

      @Metric({"TotalReplicatedBlocks","Total number of replicated blocks"}) public long getTotalReplicatedBlocks()
      Description copied from interface: ReplicatedBlocksMBean
      Return total number of replicated blocks.
      Specified by:
      getTotalReplicatedBlocks in interface ReplicatedBlocksMBean
    • getLowRedundancyECBlockGroups

      @Metric({"LowRedundancyECBlockGroups","Number of erasure coded block groups with low redundancy"}) public long getLowRedundancyECBlockGroups()
      Description copied from interface: ECBlockGroupsMBean
      Return count of erasure coded block groups with low redundancy.
      Specified by:
      getLowRedundancyECBlockGroups in interface ECBlockGroupsMBean
    • getCorruptECBlockGroups

      @Metric({"CorruptECBlockGroups","Number of erasure coded block groups that are corrupt"}) public long getCorruptECBlockGroups()
      Description copied from interface: ECBlockGroupsMBean
      Return count of erasure coded block groups that are corrupt.
      Specified by:
      getCorruptECBlockGroups in interface ECBlockGroupsMBean
    • getMissingECBlockGroups

      @Metric({"MissingECBlockGroups","Number of erasure coded block groups that are missing"}) public long getMissingECBlockGroups()
      Description copied from interface: ECBlockGroupsMBean
      Return count of erasure coded block groups that are missing.
      Specified by:
      getMissingECBlockGroups in interface ECBlockGroupsMBean
    • getBytesInFutureECBlockGroups

      @Metric({"BytesInFutureECBlockGroups","Total bytes in erasure coded block groups with future generation stamp"}) public long getBytesInFutureECBlockGroups()
      Description copied from interface: ECBlockGroupsMBean
      Return total bytes of erasure coded future block groups.
      Specified by:
      getBytesInFutureECBlockGroups in interface ECBlockGroupsMBean
    • getPendingDeletionECBlocks

      @Metric({"PendingDeletionECBlocks","Number of erasure coded blocks that are pending deletion"}) public long getPendingDeletionECBlocks()
      Description copied from interface: ECBlockGroupsMBean
      Return count of erasure coded blocks that are pending deletion.
      Specified by:
      getPendingDeletionECBlocks in interface ECBlockGroupsMBean
    • getTotalECBlockGroups

      @Metric({"TotalECBlockGroups","Total number of erasure coded block groups"}) public long getTotalECBlockGroups()
      Description copied from interface: ECBlockGroupsMBean
      Return total number of erasure coded block groups.
      Specified by:
      getTotalECBlockGroups in interface ECBlockGroupsMBean
    • getEnabledEcPolicies

      @Metric({"EnabledEcPolicies","Enabled erasure coding policies"}) public String getEnabledEcPolicies()
      Get the enabled erasure coding policies separated with comma.
      Specified by:
      getEnabledEcPolicies in interface ECBlockGroupsMBean
      Returns:
      the enabled erasure coding policies separated with comma.
    • getBlockDeletionStartTime

      public long getBlockDeletionStartTime()
      Description copied from interface: FSNamesystemMBean
      Time when block deletions will begin
      Specified by:
      getBlockDeletionStartTime in interface FSNamesystemMBean
      Returns:
      time when block deletions will begin
    • getExcessBlocks

      @Metric public long getExcessBlocks()
    • getNumTimedOutPendingReconstructions

      @Metric public long getNumTimedOutPendingReconstructions()
    • getPostponedMisreplicatedBlocks

      @Metric public long getPostponedMisreplicatedBlocks()
    • getPendingDataNodeMessageCount

      @Metric public int getPendingDataNodeMessageCount()
    • getHAState

      @Metric public String getHAState()
    • getMillisSinceLastLoadedEdits

      @Metric public long getMillisSinceLastLoadedEdits()
    • getBlockCapacity

      @Metric public int getBlockCapacity()
    • getState

      public org.apache.hadoop.ha.HAServiceProtocol.HAServiceState getState()
    • getFSState

      public String getFSState()
      Description copied from interface: FSNamesystemMBean
      The state of the file system: Safemode or Operational
      Specified by:
      getFSState in interface FSNamesystemMBean
      Returns:
      the state
    • getNumLiveDataNodes

      @Metric({"NumLiveDataNodes","Number of datanodes which are currently live"}) public int getNumLiveDataNodes()
      Description copied from interface: FSNamesystemMBean
      Number of Live data nodes
      Specified by:
      getNumLiveDataNodes in interface FSNamesystemMBean
      Returns:
      number of live data nodes
    • getNumDeadDataNodes

      @Metric({"NumDeadDataNodes","Number of datanodes which are currently dead"}) public int getNumDeadDataNodes()
      Description copied from interface: FSNamesystemMBean
      Number of dead data nodes
      Specified by:
      getNumDeadDataNodes in interface FSNamesystemMBean
      Returns:
      number of dead data nodes
    • getNumDecomLiveDataNodes

      @Metric({"NumDecomLiveDataNodes","Number of datanodes which have been decommissioned and are now live"}) public int getNumDecomLiveDataNodes()
      Description copied from interface: FSNamesystemMBean
      Number of decommissioned Live data nodes
      Specified by:
      getNumDecomLiveDataNodes in interface FSNamesystemMBean
      Returns:
      number of decommissioned live data nodes
    • getNumDecomDeadDataNodes

      @Metric({"NumDecomDeadDataNodes","Number of datanodes which have been decommissioned and are now dead"}) public int getNumDecomDeadDataNodes()
      Description copied from interface: FSNamesystemMBean
      Number of decommissioned dead data nodes
      Specified by:
      getNumDecomDeadDataNodes in interface FSNamesystemMBean
      Returns:
      number of decommissioned dead data nodes
    • getNumInServiceLiveDataNodes

      @Metric({"NumInServiceLiveDataNodes","Number of live datanodes which are currently in service"}) public int getNumInServiceLiveDataNodes()
      Specified by:
      getNumInServiceLiveDataNodes in interface FSNamesystemMBean
      Returns:
      Number of in-service data nodes, where NumInServiceDataNodes = NumLiveDataNodes - NumDecomLiveDataNodes - NumInMaintenanceLiveDataNodes
    • getVolumeFailuresTotal

      @Metric({"VolumeFailuresTotal","Total number of volume failures across all Datanodes"}) public int getVolumeFailuresTotal()
      Description copied from interface: FSNamesystemMBean
      Number of failed data volumes across all live data nodes.
      Specified by:
      getVolumeFailuresTotal in interface FSNamesystemMBean
      Returns:
      number of failed data volumes across all live data nodes
    • getEstimatedCapacityLostTotal

      @Metric({"EstimatedCapacityLostTotal","An estimate of the total capacity lost due to volume failures"}) public long getEstimatedCapacityLostTotal()
      Description copied from interface: FSNamesystemMBean
      Returns an estimate of total capacity lost due to volume failures in bytes across all live data nodes.
      Specified by:
      getEstimatedCapacityLostTotal in interface FSNamesystemMBean
      Returns:
      estimate of total capacity lost in bytes
    • getNumDecommissioningDataNodes

      @Metric({"NumDecommissioningDataNodes","Number of datanodes in decommissioning state"}) public int getNumDecommissioningDataNodes()
      Description copied from interface: FSNamesystemMBean
      Number of data nodes that are in the decommissioning state
      Specified by:
      getNumDecommissioningDataNodes in interface FSNamesystemMBean
    • getNumStaleDataNodes

      @Metric({"StaleDataNodes","Number of datanodes marked stale due to delayed heartbeat"}) public int getNumStaleDataNodes()
      Description copied from interface: FSNamesystemMBean
      Number of stale data nodes
      Specified by:
      getNumStaleDataNodes in interface FSNamesystemMBean
      Returns:
      number of stale data nodes
    • getNumStaleStorages

      @Metric({"NumStaleStorages","Number of storages marked as content stale"}) public int getNumStaleStorages()
      Storages are marked as "content stale" after NN restart or fails over and before NN receives the first Heartbeat followed by the first Blockreport.
      Specified by:
      getNumStaleStorages in interface FSNamesystemMBean
      Returns:
      number of content stale storages
    • getTopUserOpCounts

      public String getTopUserOpCounts()
      Description copied from interface: FSNamesystemMBean
      Returns a nested JSON object listing the top users for different RPC operations over tracked time windows.
      Specified by:
      getTopUserOpCounts in interface FSNamesystemMBean
      Returns:
      JSON string
    • logUpdateMasterKey

      public void logUpdateMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey key)
      Log the updateMasterKey operation to edit logs.
      Parameters:
      key - new delegation key.
    • logExpireDelegationToken

      public void logExpireDelegationToken(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier id)
      Log the cancellation of expired tokens to edit logs.
      Parameters:
      id - token identifier to cancel
    • getVersion

      public String getVersion()
      Class representing Namenode information for JMX interfaces.
      Specified by:
      getVersion in interface NameNodeMXBean
      Returns:
      the version.
    • getUsed

      public long getUsed()
      Description copied from interface: NameNodeMXBean
      Gets the used space by data nodes.
      Specified by:
      getUsed in interface NameNodeMXBean
      Returns:
      the used space by data nodes.
    • getFree

      public long getFree()
      Description copied from interface: NameNodeMXBean
      Gets total non-used raw bytes.
      Specified by:
      getFree in interface NameNodeMXBean
      Returns:
      total non-used raw bytes.
    • getTotal

      public long getTotal()
      Description copied from interface: NameNodeMXBean
      Gets total raw bytes including non-dfs used space.
      Specified by:
      getTotal in interface NameNodeMXBean
      Returns:
      the total raw bytes including non-dfs used space.
    • getProvidedCapacity

      public long getProvidedCapacity()
      Description copied from interface: NameNodeMXBean
      Gets capacity of the provided storage mounted, in bytes.
      Specified by:
      getProvidedCapacity in interface NameNodeMXBean
      Returns:
      the total raw bytes present in the provided storage.
    • getSafemode

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

      public boolean isUpgradeFinalized()
      Description copied from interface: NameNodeMXBean
      Checks if upgrade is finalized.
      Specified by:
      isUpgradeFinalized in interface NameNodeMXBean
      Returns:
      true, if upgrade is finalized.
    • getNonDfsUsedSpace

      public long getNonDfsUsedSpace()
      Description copied from interface: NameNodeMXBean
      Gets total used space by data nodes for non DFS purposes such as storing temporary files on the local file system.
      Specified by:
      getNonDfsUsedSpace in interface NameNodeMXBean
      Returns:
      the non dfs space of the cluster.
    • getPercentUsed

      public float getPercentUsed()
      Description copied from interface: NameNodeMXBean
      Gets the total used space by data nodes as percentage of total capacity.
      Specified by:
      getPercentUsed in interface NameNodeMXBean
      Returns:
      the percentage of used space on the cluster.
    • getBlockPoolUsedSpace

      public long getBlockPoolUsedSpace()
      Description copied from interface: NameNodeMXBean
      Get the total space used by the block pools of this namenode.
      Specified by:
      getBlockPoolUsedSpace in interface NameNodeMXBean
      Returns:
      the total space used by the block pools of this namenode.
    • getPercentBlockPoolUsed

      public float getPercentBlockPoolUsed()
      Description copied from interface: NameNodeMXBean
      Get the total space used by the block pool as percentage of total capacity.
      Specified by:
      getPercentBlockPoolUsed in interface NameNodeMXBean
      Returns:
      the total space used by the block pool as percentage of total capacity.
    • getPercentRemaining

      public float getPercentRemaining()
      Description copied from interface: NameNodeMXBean
      Gets the total remaining space by data nodes as percentage of total capacity.
      Specified by:
      getPercentRemaining in interface NameNodeMXBean
      Returns:
      the percentage of the remaining space on the cluster.
    • getCacheCapacity

      public long getCacheCapacity()
      Description copied from interface: NameNodeMXBean
      Gets the total cache capacity of the datanode (in bytes).
      Specified by:
      getCacheCapacity in interface NameNodeMXBean
      Returns:
      the total cache capacity of the datanode (in bytes).
    • getCacheUsed

      public long getCacheUsed()
      Description copied from interface: NameNodeMXBean
      Gets the amount of cache used by the datanode (in bytes).
      Specified by:
      getCacheUsed in interface NameNodeMXBean
      Returns:
      the amount of cache used by the datanode (in bytes).
    • getTotalBlocks

      public long getTotalBlocks()
      Description copied from interface: NameNodeMXBean
      Gets the total numbers of blocks on the cluster.
      Specified by:
      getTotalBlocks in interface NameNodeMXBean
      Returns:
      the total number of blocks of the cluster.
    • getNumberOfMissingBlocks

      public long getNumberOfMissingBlocks()
      Description copied from interface: NameNodeMXBean
      Gets the total number of missing blocks on the cluster.
      Specified by:
      getNumberOfMissingBlocks in interface NameNodeMXBean
      Returns:
      the total number of missing blocks on the cluster.
    • getNumberOfMissingBlocksWithReplicationFactorOne

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

      public long getNumberOfBadlyDistributedBlocks()
      Description copied from interface: NameNodeMXBean
      Gets the total number of badly distributed blocks.
      Specified by:
      getNumberOfBadlyDistributedBlocks in interface NameNodeMXBean
      Returns:
      the total number of badly distrubted blocks.
    • getThreads

      public int getThreads()
      Description copied from interface: NameNodeMXBean
      Gets the number of threads.
      Specified by:
      getThreads in interface NameNodeMXBean
      Returns:
      the number of threads.
    • getLiveNodes

      public String getLiveNodes()
      Returned information is a JSON representation of map with host name as the key and value is a map of live node attribute keys to its values.
      Specified by:
      getLiveNodes in interface NameNodeMXBean
      Returns:
      the live node information.
    • getDeadNodes

      public String getDeadNodes()
      Returned information is a JSON representation of map with host name as the key and value is a map of dead node attribute keys to its values.
      Specified by:
      getDeadNodes in interface NameNodeMXBean
      Returns:
      the dead node information.
    • getDecomNodes

      public String getDecomNodes()
      Returned information is a JSON representation of map with host name as the key and value is a map of decommissioning node attribute keys to its values.
      Specified by:
      getDecomNodes in interface NameNodeMXBean
      Returns:
      the decommissioning node information.
    • getEnteringMaintenanceNodes

      public String getEnteringMaintenanceNodes()
      Returned information is a JSON representation of map with host name of nodes entering maintenance as the key and value as a map of various node attributes to its values.
      Specified by:
      getEnteringMaintenanceNodes in interface NameNodeMXBean
      Returns:
      the information on nodes entering maintenance.
    • getClusterId

      public String getClusterId()
      Description copied from interface: NameNodeMXBean
      Gets the cluster id.
      Specified by:
      getClusterId in interface NameNodeMXBean
      Returns:
      the cluster id.
    • getBlockPoolId

      public String getBlockPoolId()
      Description copied from interface: NameNodeMXBean
      Gets the block pool id.
      Specified by:
      getBlockPoolId in interface NameNodeMXBean
      Returns:
      the block pool id.
    • getNameDirStatuses

      public String getNameDirStatuses()
      Description copied from interface: NameNodeMXBean
      Get status information about the directories storing image and edits logs of the NN.
      Specified by:
      getNameDirStatuses in interface NameNodeMXBean
      Returns:
      the name dir status information, as a JSON string.
    • getNodeUsage

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

      public String getNameJournalStatus()
      Description copied from interface: NameNodeMXBean
      Get status information about the journals of the NN.
      Specified by:
      getNameJournalStatus in interface NameNodeMXBean
      Returns:
      the name journal status information, as a JSON string.
    • getJournalTransactionInfo

      public String getJournalTransactionInfo()
      Description copied from interface: NameNodeMXBean
      Get information about the transaction ID, including the last applied transaction ID and the most recent checkpoint's transaction ID.
      Specified by:
      getJournalTransactionInfo in interface NameNodeMXBean
      Returns:
      information about the transaction ID.
    • getNNStartedTimeInMillis

      public long getNNStartedTimeInMillis()
      Description copied from interface: NameNodeMXBean
      Gets the NN start time in milliseconds.
      Specified by:
      getNNStartedTimeInMillis in interface NameNodeMXBean
      Returns:
      the NN start time in msec.
    • getCompileInfo

      public String getCompileInfo()
      Description copied from interface: NameNodeMXBean
      Get the compilation information which contains date, user and branch.
      Specified by:
      getCompileInfo in interface NameNodeMXBean
      Returns:
      the compilation information, as a JSON string.
    • getBlockManager

      public BlockManager getBlockManager()
      Returns:
      the block manager.
    • setBlockManagerForTesting

      @VisibleForTesting public void setBlockManagerForTesting(BlockManager bm)
    • getFSDirectory

      public FSDirectory getFSDirectory()
      Specified by:
      getFSDirectory in interface Namesystem
      Returns:
      the FSDirectory.
    • setFSDirectory

      @VisibleForTesting public void setFSDirectory(FSDirectory dir)
      Set the FSDirectory.
    • getCacheManager

      public CacheManager getCacheManager()
      Specified by:
      getCacheManager in interface Namesystem
      Returns:
      the cache manager.
    • getErasureCodingPolicyManager

      public ErasureCodingPolicyManager getErasureCodingPolicyManager()
      Returns:
      the ErasureCodingPolicyManager.
    • getHAContext

      public HAContext getHAContext()
      Specified by:
      getHAContext in interface Namesystem
    • getCorruptFiles

      public String getCorruptFiles()
      Description copied from interface: NameNodeMXBean
      Get the list of corrupt files.
      Specified by:
      getCorruptFiles in interface NameNodeMXBean
      Returns:
      the list of corrupt files, as a JSON string.
    • getCorruptFilesCount

      public int getCorruptFilesCount()
      Description copied from interface: NameNodeMXBean
      Get the length of the list of corrupt files.
      Specified by:
      getCorruptFilesCount in interface NameNodeMXBean
      Returns:
      the length of the list of corrupt files.
    • getNumberOfSnapshottableDirs

      public long getNumberOfSnapshottableDirs()
      Description copied from interface: NameNodeMXBean
      Gets the total number of snapshottable dirs in the system.
      Specified by:
      getNumberOfSnapshottableDirs in interface NameNodeMXBean
      Returns:
      the total number of snapshottable dirs in the system.
    • getDistinctVersionCount

      public int getDistinctVersionCount()
      Description copied from interface: NameNodeMXBean
      Get the number of distinct versions of live datanodes.
      Specified by:
      getDistinctVersionCount in interface NameNodeMXBean
      Returns:
      the number of distinct versions of live datanodes.
    • getDistinctVersions

      public Map<String,Integer> getDistinctVersions()
      Description copied from interface: NameNodeMXBean
      Get the number of live datanodes for each distinct versions.
      Specified by:
      getDistinctVersions in interface NameNodeMXBean
      Returns:
      the number of live datanodes for each distinct versions.
    • getSoftwareVersion

      public String getSoftwareVersion()
      Description copied from interface: NameNodeMXBean
      Get the version of software running on the Namenode.
      Specified by:
      getSoftwareVersion in interface NameNodeMXBean
      Returns:
      a string representing the version.
    • getNameDirSize

      public String getNameDirSize()
      Description copied from interface: NameNodeMXBean
      Get namenode directory size.
      Specified by:
      getNameDirSize in interface NameNodeMXBean
      Returns:
      namenode directory size.
    • verifyToken

      public void verifyToken(org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier identifier, byte[] password) throws org.apache.hadoop.security.token.SecretManager.InvalidToken, org.apache.hadoop.ipc.RetriableException
      Verifies that the given identifier and password are valid and match.
      Parameters:
      identifier - Token identifier.
      password - Password in the token.
      Throws:
      org.apache.hadoop.security.token.SecretManager.InvalidToken
      org.apache.hadoop.ipc.RetriableException
    • getEditLogTailer

      @VisibleForTesting public EditLogTailer getEditLogTailer()
    • getStandbyLastCheckpointTime

      @VisibleForTesting public long getStandbyLastCheckpointTime()
    • setEditLogTailerForTests

      @VisibleForTesting public void setEditLogTailerForTests(EditLogTailer tailer)
    • getFsLockForTests

      @VisibleForTesting public ReentrantReadWriteLock getFsLockForTests()
    • getCpLockForTests

      @VisibleForTesting public ReentrantLock getCpLockForTests()
    • setNNResourceChecker

      @VisibleForTesting public void setNNResourceChecker(NameNodeResourceChecker nnResourceChecker)
    • getSnapshotManager

      public SnapshotManager getSnapshotManager()
    • getSnapshottableDirListing

      public org.apache.hadoop.hdfs.protocol.SnapshottableDirectoryStatus[] getSnapshottableDirListing() throws IOException
      Get the list of snapshottable directories that are owned by the current user. Return all the snapshottable directories if the current user is a super user.
      Returns:
      The list of all the current snapshottable directories.
      Throws:
      IOException - If an I/O error occurred.
    • getSnapshotListing

      public org.apache.hadoop.hdfs.protocol.SnapshotStatus[] getSnapshotListing(String snapshotRoot) throws IOException
      Get the list of snapshots for a given snapshottable directory.
      Returns:
      The list of all the snapshots for a snapshottable directory
      Throws:
      IOException
    • gcDeletedSnapshot

      public void gcDeletedSnapshot(String snapshotRoot, String snapshotName) throws IOException
      Throws:
      IOException
    • setCreatedRollbackImages

      public void setCreatedRollbackImages(boolean created)
    • getRollingUpgradeInfo

      public org.apache.hadoop.hdfs.protocol.RollingUpgradeInfo getRollingUpgradeInfo()
    • isNeedRollbackFsImage

      public boolean isNeedRollbackFsImage()
    • setNeedRollbackFsImage

      public void setNeedRollbackFsImage(boolean needRollbackFsImage)
    • getRollingUpgradeStatus

      public org.apache.hadoop.hdfs.protocol.RollingUpgradeInfo.Bean getRollingUpgradeStatus()
      Description copied from interface: NameNodeMXBean
      Gets the RollingUpgrade information.
      Specified by:
      getRollingUpgradeStatus in interface NameNodeMXBean
      Returns:
      Rolling upgrade information if an upgrade is in progress. Else (e.g. if there is no upgrade or the upgrade is finalized), returns null.
    • isRollingUpgrade

      public boolean isRollingUpgrade()
      Is rolling upgrade in progress?
    • getEffectiveLayoutVersion

      public int getEffectiveLayoutVersion()
      Returns the layout version in effect. Under normal operation, this is the same as the software's current layout version, defined in NameNodeLayoutVersion.CURRENT_LAYOUT_VERSION. During a rolling upgrade, this can retain the layout version that was persisted to metadata prior to starting the rolling upgrade, back to a lower bound defined in NameNodeLayoutVersion.MINIMUM_COMPATIBLE_LAYOUT_VERSION. New fsimage files and edit log segments will continue to be written with this older layout version, so that the files are still readable by the old software version if the admin chooses to downgrade.
      Returns:
      layout version in effect
    • getECTopologyResultForPolicies

      public org.apache.hadoop.hdfs.protocol.ECTopologyVerifierResult getECTopologyResultForPolicies(String[] policyNames) throws IOException
      Verifies if the given policies are supported in the given cluster setup. If not policy is specified checks for all enabled policies.
      Parameters:
      policyNames - name of policies.
      Returns:
      the result if the given policies are supported in the cluster setup
      Throws:
      IOException
    • removeXattr

      public void removeXattr(long id, String xattrName) throws IOException
      Description copied from interface: Namesystem
      Remove xAttr from the inode.
      Specified by:
      removeXattr in interface Namesystem
      Throws:
      IOException
    • checkAndProvisionSnapshotTrashRoots

      public void checkAndProvisionSnapshotTrashRoots()
      Check if snapshot roots are created for all existing snapshottable directories. Create them if not. Only the active NameNode needs to execute this in HA setup once it is out of safe mode. The function gets called while exiting safe mode or post starting the services in Active NameNode, but comes into effect post whichever event happens later.
      Specified by:
      checkAndProvisionSnapshotTrashRoots in interface Namesystem
    • getTotalSyncCount

      @Metric({"TotalSyncCount","Total number of sync operations performed on edit logs"}) public long getTotalSyncCount()
      Return total number of Sync Operations on FSEditLog.
      Specified by:
      getTotalSyncCount in interface FSNamesystemMBean
    • getTotalSyncTimes

      @Metric({"TotalSyncTimes","Total time spend in sync operation on various edit logs"}) public String getTotalSyncTimes()
      Return total time spent doing sync operations on FSEditLog.
      Specified by:
      getTotalSyncTimes in interface FSNamesystemMBean
    • getBytesInFuture

      public long getBytesInFuture()
      Gets number of bytes in the blocks in future generation stamps.
      Returns:
      number of bytes that can be deleted if exited from safe mode.
    • getNumInMaintenanceLiveDataNodes

      @Metric({"NumInMaintenanceLiveDataNodes","Number of live Datanodes which are in maintenance state"}) public int getNumInMaintenanceLiveDataNodes()
      Specified by:
      getNumInMaintenanceLiveDataNodes in interface FSNamesystemMBean
      Returns:
      Number of IN_MAINTENANCE live data nodes
    • getNumInMaintenanceDeadDataNodes

      @Metric({"NumInMaintenanceDeadDataNodes","Number of dead Datanodes which are in maintenance state"}) public int getNumInMaintenanceDeadDataNodes()
      Specified by:
      getNumInMaintenanceDeadDataNodes in interface FSNamesystemMBean
      Returns:
      Number of IN_MAINTENANCE dead data nodes
    • getNumEnteringMaintenanceDataNodes

      @Metric({"NumEnteringMaintenanceDataNodes","Number of Datanodes that are entering the maintenance state"}) public int getNumEnteringMaintenanceDataNodes()
      Specified by:
      getNumEnteringMaintenanceDataNodes in interface FSNamesystemMBean
      Returns:
      Number of ENTERING_MAINTENANCE data nodes
    • getVerifyECWithTopologyResult

      public String getVerifyECWithTopologyResult()
      Description copied from interface: NameNodeMXBean
      Verifies whether the cluster setup can support all enabled EC policies.
      Specified by:
      getVerifyECWithTopologyResult in interface NameNodeMXBean
      Returns:
      the result of the verification.
    • checkErasureCodingSupported

      public void checkErasureCodingSupported(String operationName) throws UnsupportedActionException
      Check whether operation is supported.
      Parameters:
      operationName - the name of operation.
      Throws:
      UnsupportedActionException - throws UAE if not supported.
    • setMetricsEnabled

      public void setMetricsEnabled(boolean metricsEnabled)
    • isMetricsEnabled

      @VisibleForTesting public boolean isMetricsEnabled()
    • setReadLockReportingThresholdMs

      public void setReadLockReportingThresholdMs(long readLockReportingThresholdMs)
    • getReadLockReportingThresholdMs

      @VisibleForTesting public long getReadLockReportingThresholdMs()
    • setWriteLockReportingThresholdMs

      public void setWriteLockReportingThresholdMs(long writeLockReportingThresholdMs)
    • getWriteLockReportingThresholdMs

      @VisibleForTesting public long getWriteLockReportingThresholdMs()