Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,17 @@ public class DFSConfigKeys extends CommonConfigurationKeys {
"dfs.namenode.block.deletion.increment";
public static final int DFS_NAMENODE_BLOCK_DELETION_INCREMENT_DEFAULT = 1000;

/** The limit of single lock holding duration.*/
public static final String DFS_NAMENODE_BLOCK_DELETION_LOCK_THRESHOLD_MS =
"dfs.namenode.block.deletion.lock.threshold.ms";
public static final int DFS_NAMENODE_BLOCK_DELETION_LOCK_THRESHOLD_MS_DEFAULT =
50;
/** The sleep interval for releasing lock.*/
public static final String DFS_NAMENODE_BLOCK_DELETION_UNLOCK_INTERVAL_MS =
"dfs.namenode.block.deletion.unlock.interval.ms";
public static final int DFS_NAMENODE_BLOCK_DELETION_UNLOCK_INTERVAL_MS_DEFAULT =
10;

public static final String DFS_NAMENODE_SNAPSHOT_CAPTURE_OPENFILES =
HdfsClientConfigKeys.DFS_NAMENODE_SNAPSHOT_CAPTURE_OPENFILES;
public static final boolean DFS_NAMENODE_SNAPSHOT_CAPTURE_OPENFILES_DEFAULT =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ public class BlockManager implements BlockStatsMXBean {
private volatile long lowRedundancyBlocksCount = 0L;
private volatile long scheduledReplicationBlocksCount = 0L;

private final long deleteBlockLockTimeMs = 500;
private final long deleteBlockUnlockIntervalTimeMs = 100;
private final long deleteBlockLockTimeMs;
private final long deleteBlockUnlockIntervalTimeMs;

/** flag indicating whether replication queues have been initialized */
private boolean initializedReplQueues;
Expand Down Expand Up @@ -487,6 +487,12 @@ public BlockManager(final Namesystem namesystem, boolean haEnabled,
startupDelayBlockDeletionInMs = conf.getLong(
DFSConfigKeys.DFS_NAMENODE_STARTUP_DELAY_BLOCK_DELETION_SEC_KEY,
DFSConfigKeys.DFS_NAMENODE_STARTUP_DELAY_BLOCK_DELETION_SEC_DEFAULT) * 1000L;
deleteBlockLockTimeMs = conf.getLong(
DFSConfigKeys.DFS_NAMENODE_BLOCK_DELETION_LOCK_THRESHOLD_MS,
DFSConfigKeys.DFS_NAMENODE_BLOCK_DELETION_LOCK_THRESHOLD_MS_DEFAULT);
deleteBlockUnlockIntervalTimeMs = conf.getLong(
DFSConfigKeys.DFS_NAMENODE_BLOCK_DELETION_UNLOCK_INTERVAL_MS,
DFSConfigKeys.DFS_NAMENODE_BLOCK_DELETION_UNLOCK_INTERVAL_MS_DEFAULT);
invalidateBlocks = new InvalidateBlocks(
datanodeManager.getBlockInvalidateLimit(),
startupDelayBlockDeletionInMs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6109,6 +6109,25 @@
</description>
</property>

<property>
<name>dfs.namenode.block.deletion.lock.threshold.ms</name>
<value>50</value>
<description>
The limit of single time lock holding duration for the block asynchronous
deletion thread.
</description>
</property>

<property>
<name>dfs.namenode.block.deletion.unlock.interval.ms</name>
<value>10</value>
<description>
The sleep interval for yield lock.
When the single time lock holding duration of the block asynchronous deletion
thread exceeds limit, sleeping to yield lock.
</description>
</property>

<property>
<name>dfs.namenode.rpc-address.auxiliary-ports</name>
<value></value>
Expand Down