/** Serialize {@link #deleted} */ private void writeDeleted(DataOutput out, ReferenceMap referenceMap) throws IOException { final List<INode> deleted = getDeletedUnmodifiable(); out.writeInt(deleted.size()); for (INode node : deleted) { FSImageSerialization.saveINode2Image(node, out, true, referenceMap); } }
/** Get the list of INodeDirectory contained in the deleted list */ private void getDirsInDeleted(List<INodeDirectory> dirList) { for (INode node : getDeletedUnmodifiable()) { if (node.isDirectory()) { dirList.add(node.asDirectory()); } } } }
final List<INode> dlist = diff.getDeletedUnmodifiable(); int size = dlist.size(); ListIterator<INode> iterator = lastIndex != -1 ?
if (priorDiff != null && priorDiff.getSnapshotId() == prior) { priorCreated = cloneDiffList(priorDiff.diff.getCreatedUnmodifiable()); priorDeleted = cloneDiffList(priorDiff.diff.getDeletedUnmodifiable()); for (INode dNode : priorDiff.diff.getDeletedUnmodifiable()) { if (priorDeleted == null || !priorDeleted.containsKey(dNode)) { cleanDeletedINode(reclaimContext, dNode, snapshot, prior);
List<INode> deleted = diff.getChildrenDiff().getDeletedUnmodifiable(); INode previousNode = null; boolean misordered = false;
DirectoryDiff priorDiff = diffList.getDiffById(prior); if (priorDiff != null && priorDiff.getSnapshotId() == prior) { List<INode> dList = priorDiff.diff.getDeletedUnmodifiable(); excludedNodes = cloneDiffList(dList);
for (INode dnode : dirDiff.getDeletedUnmodifiable()) { RenameEntry entry = renameMap.get(dnode.getId()); if (entry != null && entry.isRename()) {
/** Add a dir-diff pair */ void addDirDiff(INodeDirectory dir, byte[][] relativePath, ChildrenDiff diff) { dirDiffMap.put(dir, diff); diffMap.put(dir, relativePath); // detect rename for (INode created : diff.getCreatedUnmodifiable()) { if (created.isReference()) { RenameEntry entry = getEntry(created.getId()); if (entry.getTargetPath() == null) { entry.setTarget(created, relativePath); } } } for (INode deleted : diff.getDeletedUnmodifiable()) { if (deleted instanceof INodeReference.WithName) { RenameEntry entry = getEntry(deleted.getId()); entry.setSource(deleted, relativePath); } } }
public QuotaCounts computeQuotaUsage4CurrentDirectory( BlockStoragePolicySuite bsps, byte storagePolicyId) { final QuotaCounts counts = new QuotaCounts.Builder().build(); for(DirectoryDiff d : diffs) { for(INode deleted : d.getChildrenDiff().getDeletedUnmodifiable()) { final byte childPolicyId = deleted.getStoragePolicyIDForQuota( storagePolicyId); counts.add(deleted.computeQuotaUsage(bsps, childPolicyId, false, Snapshot.CURRENT_STATE_ID)); } } return counts; }
public void computeContentSummary4Snapshot(final BlockStoragePolicySuite bsps, final ContentCounts counts) throws AccessControlException { // Create a new blank summary context for blocking processing of subtree. ContentSummaryComputationContext summary = new ContentSummaryComputationContext(bsps); for(DirectoryDiff d : diffs) { for(INode deleted : d.getChildrenDiff().getDeletedUnmodifiable()) { deleted.computeContentSummary(Snapshot.CURRENT_STATE_ID, summary); } } // Add the counts from deleted trees. counts.addContents(summary.getCounts()); }
/** clear the deleted list */ private void destroyDeletedList(INode.ReclaimContext reclaimContext) { for (INode d : getDeletedUnmodifiable()) { d.destroyAndCollectBlocks(reclaimContext); } clearDeleted(); }