Author: wang
Date: Wed May 14 01:29:36 2014
New Revision: 1594443

URL: http://svn.apache.org/r1594443
Log:
HDFS-6283. Write end user documentation for xattrs. (wang)

Modified:
    
hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/XAttrCommands.java
    
hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/site/apt/FileSystemShell.apt.vm

Modified: 
hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/XAttrCommands.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/XAttrCommands.java?rev=1594443&r1=1594442&r2=1594443&view=diff
==============================================================================
--- 
hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/XAttrCommands.java
 (original)
+++ 
hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/XAttrCommands.java
 Wed May 14 01:29:36 2014
@@ -56,14 +56,14 @@ class XAttrCommands extends FsCommand {
     public static final String DESCRIPTION =
       "Displays the extended attribute names and values (if any) for a " +
       "file or directory.\n" +
-      "-R: Recurisively list the attributes for all files and directories.\n" +
-      "-n name: Dump the named extended attribute value.\n" + 
-      "-d: Dump all extended attribute values associated with " +
-      "pathname.\n" +
-      "-e <encoding>: Encode values after retrieving them. Valid encodings " +
-      "are \"text\", \"hex\", and \"base64\". Values encoded as text " +
-      "strings are enclosed in double quotes (\"), and values encoded" +
-      " as hexadecimal and base64 are prefixed with 0x and 0s, 
respectively.\n" +
+      "-R: Recursively list the attributes for all files and directories.\n" +
+      "-n name: Dump the named extended attribute value.\n" +
+      "-d: Dump all extended attribute values associated with pathname.\n" +
+      "-e <encoding>: Encode values after retrieving them.\n" +
+      "Valid encodings are \"text\", \"hex\", and \"base64\".\n" +
+      "Values encoded as text strings are enclosed in double quotes (\"),\n" +
+      " and values encoded as hexadecimal and base64 are prefixed with\n" +
+      "0x and 0s, respectively.\n" +
       "<path>: The file or directory.\n";
     private final static Function<String, XAttrCodec> enValueOfFunc =
         Enums.valueOfFunction(XAttrCodec.class);

Modified: 
hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/site/apt/FileSystemShell.apt.vm
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/site/apt/FileSystemShell.apt.vm?rev=1594443&r1=1594442&r2=1594443&view=diff
==============================================================================
--- 
hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/site/apt/FileSystemShell.apt.vm
 (original)
+++ 
hadoop/common/branches/HDFS-2006/hadoop-common-project/hadoop-common/src/site/apt/FileSystemShell.apt.vm
 Wed May 14 01:29:36 2014
@@ -254,6 +254,35 @@ getfacl
 
    Returns 0 on success and non-zero on error.
 
+getfattr
+
+   Usage: <<<hdfs dfs -getfattr [-R] {-n name | -d} [-e en] <path> >>>
+
+   Displays the extended attribute names and values (if any) for a file or
+   directory.
+
+   Options:
+
+     * -R: Recursively list the attributes for all files and directories.
+
+     * -n name: Dump the named extended attribute value.
+
+     * -d: Dump all extended attribute values associated with pathname.
+
+     * -e <encoding>: Encode values after retrieving them. Valid encodings are 
"text", "hex", and "base64". Values encoded as text strings are enclosed in 
double quotes ("), and values encoded as hexadecimal and base64 are prefixed 
with 0x and 0s, respectively.
+
+     * <path>: The file or directory.
+
+   Examples:
+
+     * <<<hdfs dfs -getfattr -d /file>>>
+
+     * <<<hdfs dfs -getfattr -R -n user.myAttr /dir>>>
+
+   Exit Code:
+
+   Returns 0 on success and non-zero on error.
+
 getmerge
 
    Usage: <<<hdfs dfs -getmerge <src> <localdst> [addnl]>>>
@@ -450,6 +479,36 @@ setfacl
 
    Returns 0 on success and non-zero on error.
 
+setfattr
+
+   Usage: <<<hdfs dfs -setfattr {-n name [-v value] | -x name} <path> >>>
+
+   Sets an extended attribute name and value for a file or directory.
+
+   Options:
+
+     * -b: Remove all but the base ACL entries. The entries for user, group 
and others are retained for compatibility with permission bits.
+
+     * -n name: The extended attribute name.
+
+     * -v value: The extended attribute value. There are three different 
encoding methods for the value. If the argument is enclosed in double quotes, 
then the value is the string inside the quotes. If the argument is prefixed 
with 0x or 0X, then it is taken as a hexadecimal number. If the argument begins 
with 0s or 0S, then it is taken as a base64 encoding.
+
+     * -x name: Remove the extended attribute.
+
+     * <path>: The file or directory.
+
+   Examples:
+
+      * <<<hdfs dfs -setfattr -n user.myAttr -v myValue /file>>>
+
+      * <<<hdfs dfs -setfattr -n user.noValue /file>>>
+
+      * <<<hdfs dfs -setfattr -x user.myAttr /file>>>
+
+   Exit Code:
+
+   Returns 0 on success and non-zero on error.
+
 setrep
 
    Usage: <<<hdfs dfs -setrep [-R] [-w] <numReplicas> <path> >>>


Reply via email to