Exemple #1
0
        public override void DestroyAndCollectBlocks(BlockStoragePolicySuite bsps, INode.BlocksMapUpdateInfo
                                                     collectedBlocks, IList <INode> removedINodes)
        {
            if (blocks != null && collectedBlocks != null)
            {
                foreach (BlockInfoContiguous blk in blocks)
                {
                    collectedBlocks.AddDeleteBlock(blk);
                    blk.SetBlockCollection(null);
                }
            }
            SetBlocks(null);
            if (GetAclFeature() != null)
            {
                AclStorage.RemoveAclFeature(GetAclFeature());
            }
            Clear();
            removedINodes.AddItem(this);
            FileWithSnapshotFeature sf = GetFileWithSnapshotFeature();

            if (sf != null)
            {
                sf.GetDiffs().DestroyAndCollectSnapshotBlocks(collectedBlocks);
                sf.ClearDiffs();
            }
        }
Exemple #2
0
        internal override void RemoveAclFeature()
        {
            AclFeature f = GetAclFeature();

            Preconditions.CheckNotNull(f);
            RemoveFeature(f);
            AclStorage.RemoveAclFeature(f);
        }
        public override void DestroyAndCollectBlocks(BlockStoragePolicySuite bsps, INode.BlocksMapUpdateInfo
                                                     collectedBlocks, IList <INode> removedINodes)
        {
            DirectoryWithSnapshotFeature sf = GetDirectoryWithSnapshotFeature();

            if (sf != null)
            {
                sf.Clear(bsps, this, collectedBlocks, removedINodes);
            }
            foreach (INode child in GetChildrenList(Org.Apache.Hadoop.Hdfs.Server.Namenode.Snapshot.Snapshot
                                                    .CurrentStateId))
            {
                child.DestroyAndCollectBlocks(bsps, collectedBlocks, removedINodes);
            }
            if (GetAclFeature() != null)
            {
                AclStorage.RemoveAclFeature(GetAclFeature());
            }
            Clear();
            removedINodes.AddItem(this);
        }