Class XAttr

java.lang.Object
org.apache.hadoop.fs.XAttr

@Private public class XAttr extends Object
XAttr is the POSIX Extended Attribute model similar to that found in traditional Operating Systems. Extended Attributes consist of one or more name/value pairs associated with a file or directory. Five namespaces are defined: user, trusted, security, system and raw. 1) USER namespace attributes may be used by any user to store arbitrary information. Access permissions in this namespace are defined by a file directory's permission bits. For sticky directories, only the owner and privileged user can write attributes.
2) TRUSTED namespace attributes are only visible and accessible to privileged users. This namespace is available from both user space (filesystem API) and fs kernel.
3) SYSTEM namespace attributes are used by the fs kernel to store system objects. This namespace is only available in the fs kernel. It is not visible to users.
4) SECURITY namespace attributes are used by the fs kernel for security features. It is not visible to users.
5) RAW namespace attributes are used for internal system attributes that sometimes need to be exposed. Like SYSTEM namespace attributes they are not visible to the user except when getXAttr/getXAttrs is called on a file or directory in the /.reserved/raw HDFS directory hierarchy. These attributes can only be accessed by the superuser.

See Also:
  • Method Details

    • getNameSpace

      public XAttr.NameSpace getNameSpace()
    • getName

      public String getName()
    • getValue

      public byte[] getValue()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsIgnoreValue

      public boolean equalsIgnoreValue(Object obj)
      Similar to equals(Object), except ignores the XAttr value.
      Parameters:
      obj - to compare equality
      Returns:
      if the XAttrs are equal, ignoring the XAttr value
    • toString

      public String toString()
      Overrides:
      toString in class Object