增加hdfs删除目录代码注释

This commit is contained in:
LingZhaoHui 2024-04-13 23:45:19 +08:00
parent 8bf19a216c
commit 1c64c6aa3c
Signed by: zeekling
GPG Key ID: D96E4E75267CA2CC

View File

@ -59,6 +59,7 @@ static long delete(FSDirectory fsd, INodesInPath iip,
ReclaimContext context = new ReclaimContext(
fsd.getBlockStoragePolicySuite(), collectedBlocks, removedINodes,
removedUCFiles);
// 更核心的删除代码再这个函数里面会调用destroyAndCollectBlocks删除block
if (unprotectedDelete(fsd, iip, context, mtime)) {
filesRemoved = context.quotaDelta().getNsDelta();
fsn.removeSnapshottableDirs(snapshottableDirs);
@ -255,6 +256,7 @@ private static boolean unprotectedDelete(FSDirectory fsd, INodesInPath iip,
// collect block and update quota
if (!targetNode.isInLatestSnapshot(latestSnapshot)) {
// 真正删除代码
targetNode.destroyAndCollectBlocks(reclaimContext);
} else {
targetNode.cleanSubtree(reclaimContext, CURRENT_STATE_ID, latestSnapshot);