增加hdfs删除目录代码注释
This commit is contained in:
parent
8bf19a216c
commit
1c64c6aa3c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user