HDFS-16524. Recover the original config dfs.namenode.block.deletion.increment

This commit is contained in:
jinbiao.sun 2022-09-03 15:41:58 +08:00
parent e741926f75
commit 8f55bb8a1d
3 changed files with 14 additions and 2 deletions

View File

@ -495,6 +495,10 @@ public class DFSConfigKeys extends CommonConfigurationKeys {
public static final int DFS_NAMENODE_BLOCK_DELETION_UNLOCK_INTERVAL_MS_DEFAULT =
10;
/** Block deletion increment. */
public static final String DFS_NAMENODE_BLOCK_DELETION_INCREMENT_KEY =
"dfs.namenode.block.deletion.increment";
public static final int DFS_NAMENODE_BLOCK_DELETION_INCREMENT_DEFAULT = 1000;
/** Block deletion asynchronous. */
public static final String DFS_NAMENODE_BLOCK_DELETION_ASYNC_KEY = "dfs.namenode.block.deletion.async";
public static final boolean DFS_NAMENODE_BLOCK_DELETION_ASYNC_DEFAULT = true;

View File

@ -501,6 +501,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
private final String supergroup;
private final boolean standbyShouldCheckpoint;
private final boolean isSnapshotTrashRootEnabled;
private final boolean blockDeletionAsync;
private final int blockDeletionIncrement;
private final int snapshotDiffReportLimit;
/**
@ -1064,6 +1066,12 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
this.allowOwnerSetQuota = conf.getBoolean(
DFSConfigKeys.DFS_PERMISSIONS_ALLOW_OWNER_SET_QUOTA_KEY,
DFSConfigKeys.DFS_PERMISSIONS_ALLOW_OWNER_SET_QUOTA_DEFAULT);
this.blockDeletionAsync = conf.getBoolean(
DFSConfigKeys.DFS_NAMENODE_BLOCK_DELETION_ASYNC_KEY,
DFSConfigKeys.DFS_NAMENODE_BLOCK_DELETION_ASYNC_DEFAULT);
this.blockDeletionIncrement = conf.getInt(
DFSConfigKeys.DFS_NAMENODE_BLOCK_DELETION_INCREMENT_KEY,
DFSConfigKeys.DFS_NAMENODE_BLOCK_DELETION_INCREMENT_DEFAULT);
this.isGetBlocksCheckOperationEnabled = conf.getBoolean(
DFSConfigKeys.DFS_NAMENODE_GETBLOCKS_CHECK_OPERATION_KEY,
DFSConfigKeys.DFS_NAMENODE_GETBLOCKS_CHECK_OPERATION_DEFAULT);

View File

@ -6165,9 +6165,9 @@
<property>
<name>dfs.namenode.block.deletion.async</name>
<value>false</value>
<value>true</value>
<description>
If true, enable block deleting asynchronously
If false, disable block deleting asynchronously
</description>
</property>