Class DirectoryWithSnapshotFeature
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.snapshot.DirectoryWithSnapshotFeature
- All Implemented Interfaces:
INode.Feature
- Direct Known Subclasses:
DirectorySnapshottableFeature
Feature used to store and process the snapshot diff information for a
directory. In particular, it contains a directory diff list recording changes
made to the directory and its children for each snapshot.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe difference of anINodeDirectorybetween two snapshots.static classA list of directory diffs. -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddChild(INodeDirectory parent, INode inode, boolean setModTime, int latestSnapshotId) Add an inode into parent's children list.voidcleanDirectory(INode.ReclaimContext reclaimContext, INodeDirectory currentINode, int snapshot, int prior) voidclear(INode.ReclaimContext reclaimContext, INodeDirectory currentINode) voidcomputeQuotaUsage4CurrentDirectory(BlockStoragePolicySuite bsps, byte storagePolicyId) static voiddestroyDstSubtree(INode.ReclaimContext reclaimContext, INode inode, int snapshot, int prior) Destroy a subtree under a DstReference node.getChild(INodeDirectory currentINode, byte[] name, int snapshotId) getChildrenList(INodeDirectory currentINode, int snapshotId) getDiffs()intvoidgetSnapshotDirectory(List<INodeDirectory> snapshotDir) Get all the directories that are stored in some snapshot but not in the current children list.booleanremoveChild(INodeDirectory parent, INode child, int latestSnapshotId) Remove an inode from parent's children list.saveChild2Snapshot(INodeDirectory currentINode, INode child, int latestSnapshotId, INode snapshotCopy) Used to record the modification of a symlink nodetoString()
-
Constructor Details
-
DirectoryWithSnapshotFeature
-
-
Method Details
-
destroyDstSubtree
public static void destroyDstSubtree(INode.ReclaimContext reclaimContext, INode inode, int snapshot, int prior) Destroy a subtree under a DstReference node. -
getLastSnapshotId
public int getLastSnapshotId()- Returns:
- the last snapshot.
-
getDiffs
- Returns:
- the snapshot diff list.
-
getSnapshotDirectory
Get all the directories that are stored in some snapshot but not in the current children list. These directories are equivalent to the directories stored in the deletes lists. -
addChild
public boolean addChild(INodeDirectory parent, INode inode, boolean setModTime, int latestSnapshotId) Add an inode into parent's children list. The caller of this method needs to make sure that parent is in the given snapshot "latest". -
removeChild
Remove an inode from parent's children list. The caller of this method needs to make sure that parent is in the given snapshot "latest". -
getChildrenList
- Returns:
- If there is no corresponding directory diff for the given snapshot, this means that the current children list should be returned for the snapshot. Otherwise we calculate the children list for the snapshot and return it.
-
getChild
-
saveChild2Snapshot
public INode saveChild2Snapshot(INodeDirectory currentINode, INode child, int latestSnapshotId, INode snapshotCopy) Used to record the modification of a symlink node -
clear
-
computeQuotaUsage4CurrentDirectory
public QuotaCounts computeQuotaUsage4CurrentDirectory(BlockStoragePolicySuite bsps, byte storagePolicyId) -
computeContentSummary4Snapshot
public void computeContentSummary4Snapshot(BlockStoragePolicySuite bsps, ContentCounts counts) throws org.apache.hadoop.security.AccessControlException - Throws:
org.apache.hadoop.security.AccessControlException
-
cleanDirectory
public void cleanDirectory(INode.ReclaimContext reclaimContext, INodeDirectory currentINode, int snapshot, int prior) -
toString
-