Class XAttrStorage

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

@Private public class XAttrStorage extends Object
XAttrStorage is used to read and set xattrs for an inode.
  • Constructor Details

    • XAttrStorage

      public XAttrStorage()
  • Method Details

    • readINodeXAttrByPrefixedName

      public static org.apache.hadoop.fs.XAttr readINodeXAttrByPrefixedName(INode inode, int snapshotId, String prefixedName)
      Reads the extended attribute of an inode by name with prefix.

      Parameters:
      inode - INode to read
      snapshotId - the snapshotId of the requested path
      prefixedName - xAttr name with prefix
      Returns:
      the xAttr
    • readINodeXAttrs

      public static List<org.apache.hadoop.fs.XAttr> readINodeXAttrs(INodeAttributes inodeAttr)
      Reads the existing extended attributes of an inode.

      Must be called while holding the FSDirectory read lock.

      Parameters:
      inodeAttr - INodeAttributes to read.
      Returns:
      XAttr list.
    • updateINodeXAttrs

      public static void updateINodeXAttrs(INode inode, List<org.apache.hadoop.fs.XAttr> xAttrs, int snapshotId) throws org.apache.hadoop.hdfs.protocol.QuotaExceededException
      Update xattrs of inode.

      Must be called while holding the FSDirectory write lock.

      Parameters:
      inode - INode to update
      xAttrs - to update xAttrs.
      snapshotId - id of the latest snapshot of the inode
      Throws:
      org.apache.hadoop.hdfs.protocol.QuotaExceededException