Class XAttrHelper

java.lang.Object
org.apache.hadoop.hdfs.XAttrHelper

@Private public class XAttrHelper extends Object
  • Constructor Details

    • XAttrHelper

      public XAttrHelper()
  • Method Details

    • buildXAttr

      public static XAttr buildXAttr(String name)
      Build XAttr from xattr name with prefix.
    • buildXAttr

      public static XAttr buildXAttr(String name, byte[] value)
      Build XAttr from name with prefix and value. Name can not be null. Value can be null. The name and prefix are validated. Both name and namespace are case sensitive.
    • buildXAttrAsList

      public static List<XAttr> buildXAttrAsList(String name)
      Build xattr name with prefix as XAttr list.
    • getFirstXAttrValue

      public static byte[] getFirstXAttrValue(List<XAttr> xAttrs)
      Get value of first xattr from XAttr list
    • getFirstXAttr

      public static XAttr getFirstXAttr(List<XAttr> xAttrs)
      Get first xattr from XAttr list
    • buildXAttrMap

      public static Map<String,byte[]> buildXAttrMap(List<XAttr> xAttrs)
      Build xattr map from XAttr list, the key is xattr name with prefix, and value is xattr value.
    • getPrefixedName

      public static String getPrefixedName(XAttr xAttr)
      Get name with prefix from XAttr
    • getPrefixedName

      public static String getPrefixedName(XAttr.NameSpace ns, String name)
    • buildXAttrs

      public static List<XAttr> buildXAttrs(List<String> names)
      Build XAttr list from xattr name list.