Class INodesInPath
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.INodesInPath
Contains INodes information resolved from a given path.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic INodesInPathappend(INodesInPath iip, INode child, byte[] childName) Extend a given INodesInPath with a child INode.getINode(int i) INode[]intFor non-snapshot paths, return the latest snapshot id found in the path.getPath()getPath(int pos) byte[]getPathComponent(int i) byte[][]intFor snapshot paths, return the id of the snapshot specified in the path.booleanisDescendant(INodeDirectory inodeDirectory) Verify if thisINodesInPathis a descendant of the requestedINodeDirectory.booleanisRaw()intlength()static INodesInPathreplace(INodesInPath iip, int pos, INode inode) Replace an inode of the given INodesInPath in the given position.toString()
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Method Details
-
replace
Replace an inode of the given INodesInPath in the given position. We do a deep copy of the INode array.- Parameters:
pos- the position of the replacementinode- the new inode- Returns:
- a new INodesInPath instance
-
append
Extend a given INodesInPath with a child INode. The child INode will be appended to the end of the new INodesInPath. -
getLatestSnapshotId
public int getLatestSnapshotId()For non-snapshot paths, return the latest snapshot id found in the path. -
getPathSnapshotId
public int getPathSnapshotId()For snapshot paths, return the id of the snapshot specified in the path. For non-snapshot paths, returnSnapshot.CURRENT_STATE_ID. -
getINode
- Returns:
- the i-th inode if i >= 0; otherwise, i < 0, return the (length + i)-th inode.
-
getLastINode
- Returns:
- the last inode.
-
getPathComponents
public byte[][] getPathComponents() -
getPathComponent
public byte[] getPathComponent(int i) -
getPath
- Returns:
- the full path in string form
-
getParentPath
-
getPath
-
length
public int length() -
getINodesArray
-
getParentINodesInPath
- Returns:
- an INodesInPath instance containing all the INodes in the parent path. We do a deep copy here.
-
isDescendant
Verify if thisINodesInPathis a descendant of the requestedINodeDirectory.- Parameters:
inodeDirectory- the ancestor directory- Returns:
- true if this INodesInPath is a descendant of inodeDirectory
-
getExistingINodes
- Returns:
- a new INodesInPath instance that only contains existing INodes. Note that this method only handles non-snapshot paths.
-
isRaw
public boolean isRaw()- Returns:
- if this is a /.reserved/raw path.
-
toString
-