Class INodesInPath

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.INodesInPath

public class INodesInPath extends Object
Contains INodes information resolved from a given path.
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
  • Method Details

    • replace

      public static INodesInPath replace(INodesInPath iip, int pos, INode inode)
      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 replacement
      inode - the new inode
      Returns:
      a new INodesInPath instance
    • append

      public static INodesInPath append(INodesInPath iip, INode child, byte[] childName)
      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, return Snapshot.CURRENT_STATE_ID.
    • getINode

      public INode getINode(int i)
      Returns:
      the i-th inode if i >= 0; otherwise, i < 0, return the (length + i)-th inode.
    • getLastINode

      public INode getLastINode()
      Returns:
      the last inode.
    • getPathComponents

      public byte[][] getPathComponents()
    • getPathComponent

      public byte[] getPathComponent(int i)
    • getPath

      public String getPath()
      Returns:
      the full path in string form
    • getParentPath

      public String getParentPath()
    • getPath

      public String getPath(int pos)
    • length

      public int length()
    • getINodesArray

      public INode[] getINodesArray()
    • getParentINodesInPath

      public INodesInPath getParentINodesInPath()
      Returns:
      an INodesInPath instance containing all the INodes in the parent path. We do a deep copy here.
    • isDescendant

      public boolean isDescendant(INodeDirectory inodeDirectory)
      Verify if this INodesInPath is a descendant of the requested INodeDirectory.
      Parameters:
      inodeDirectory - the ancestor directory
      Returns:
      true if this INodesInPath is a descendant of inodeDirectory
    • getExistingINodes

      public INodesInPath 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

      public String toString()
      Overrides:
      toString in class Object