Updated on 2024-12-13 GMT+08:00

Asynchronously Deleting HDFS Data

Scenario

The HDFS asynchronous deletion feature is used to delete large directories. Deleting blocks asynchronously with traffic control can effectively shorten the continuous lock period.

This function is available in MRS 3.5.0 or later only.

Procedure

  1. Go to the All Configurations page of HDFS by referring to Modifying Cluster Service Configuration Parameters.
  2. Enter the parameter name in the search box and modify the HDFS service-level parameter as you need.

    Table 1 Parameters for configuring HDFS asynchronous deletion

    Parameter

    Description

    Default Value

    dfs.namenode.block.deletion.async

    Whether to enable asynchronous block deletion.

    true

    dfs.namenode.block.deletion.lock.threshold.ms

    Maximum duration for continuously lock a directory or file. After asynchronous block deletion is enabled, the specified maximum value is applied. Unit: millisecond

    50

    dfs.namenode.block.deletion.lock.threshold.ms

    Temporary unlock duration when the lock duration exceeds the maximum. Unit: millisecond

    10

  3. Save the configuration.
  4. Click the Instances tab, select all instances whose configurations have expired, choose More > Restart Instance, and restart the instances as prompted.