NamenodeFsck (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.namenode, class: NamenodeFsck

Package org.apache.hadoop.hdfs.server.namenode

# Class NamenodeFsck

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.NamenodeFsck

All Implemented Interfaces:
  `org.apache.hadoop.hdfs.protocol.datatransfer.sasl.DataEncryptionKeyFactory`

@Private public class NamenodeFsck extends Object implements org.apache.hadoop.hdfs.protocol.datatransfer.sasl.DataEncryptionKeyFactory
This class provides rudimentary checking of DFS volumes for errors and sub-optimal conditions.

The tool scans all files and directories, starting from an indicated root path and its descendants. The following abnormal conditions are detected and handled:

- files with blocks that are completely missing from all datanodes.
  In this case the tool can perform one of the following actions:
  - move corrupted files to /lost+found directory on DFS (`doMove`). Remaining data blocks are saved as a block chains, representing longest consecutive series of valid blocks.
  - delete corrupted files (`doDelete`)
- detect files with under-replicated or over-replicated blocks

Additionally, the tool collects a detailed overall DFS statistics, and optionally can print detailed statistics on block locations and replication factors of each file.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `CORRUPT_STATUS`
  `static final String`
  `DECOMMISSIONED_STATUS`
  `static final String`
  `DECOMMISSIONING_STATUS`
  `static final String`
  `ENTERING_MAINTENANCE_STATUS`
  `static final String`
  `EXCESS_STATUS`
  `static final String`
  `FAILURE_STATUS`
  `static final String`
  `HEALTHY_STATUS`
  `static final String`
  `IN_MAINTENANCE_STATUS`
  `static final org.slf4j.Logger`
  `LOG`
  `static final String`
  `NONEXISTENT_STATUS`
  `static final String`
  `STALE_STATUS`
  `static final String`
  `UNDEFINED`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `blockIdCK(String blockId)`
  Check block information given a blockId number
  `void`
  `fsck()`
  Check files on DFS, starting from the indicated path.
  `String`
  `getAuditSource()`
  `org.apache.hadoop.hdfs.security.token.block.DataEncryptionKey`
  `newDataEncryptionKey()`

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

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

- ## Field Details

  - ### LOG

    public static final org.slf4j.Logger LOG

  - ### CORRUPT_STATUS

    public static final String CORRUPT_STATUS
    See Also:
      - Constant Field Values

  - ### HEALTHY_STATUS

    public static final String HEALTHY_STATUS
    See Also:
      - Constant Field Values

  - ### DECOMMISSIONING_STATUS

    public static final String DECOMMISSIONING_STATUS
    See Also:
      - Constant Field Values

  - ### DECOMMISSIONED_STATUS

    public static final String DECOMMISSIONED_STATUS
    See Also:
      - Constant Field Values

  - ### ENTERING_MAINTENANCE_STATUS

    public static final String ENTERING_MAINTENANCE_STATUS
    See Also:
      - Constant Field Values

  - ### IN_MAINTENANCE_STATUS

    public static final String IN_MAINTENANCE_STATUS
    See Also:
      - Constant Field Values

  - ### STALE_STATUS

    public static final String STALE_STATUS
    See Also:
      - Constant Field Values

  - ### EXCESS_STATUS

    public static final String EXCESS_STATUS
    See Also:
      - Constant Field Values

  - ### NONEXISTENT_STATUS

    public static final String NONEXISTENT_STATUS
    See Also:
      - Constant Field Values

  - ### FAILURE_STATUS

    public static final String FAILURE_STATUS
    See Also:
      - Constant Field Values

  - ### UNDEFINED

    public static final String UNDEFINED
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getAuditSource

    public String getAuditSource()

  - ### blockIdCK

    public void blockIdCK(String blockId)
    Check block information given a blockId number

  - ### fsck

    public void fsck() throws org.apache.hadoop.security.AccessControlException
    Check files on DFS, starting from the indicated path.
    Throws:
      `org.apache.hadoop.security.AccessControlException`

  - ### newDataEncryptionKey

    public org.apache.hadoop.hdfs.security.token.block.DataEncryptionKey newDataEncryptionKey() throws IOException
    Specified by:
      `newDataEncryptionKey` in interface `org.apache.hadoop.hdfs.protocol.datatransfer.sasl.DataEncryptionKeyFactory`
    Throws:
      `IOException`