Ver código fonte

HADOOP-10546. Javadoc and other small fixes for extended attributes in hadoop-common. Contributed by Charles Lamb.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-2006@1590786 13f79535-47bb-0310-9956-ffa450edef68
Andrew Wang 11 anos atrás
pai
commit
22a604bb75

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES-HDFS-2006.txt

@@ -11,6 +11,9 @@ HDFS-2006 (Unreleased)
   HADOOP-10520. Extended attributes definition and FileSystem APIs for
   extended attributes. (Yi Liu via wang)
 
+  HADOOP-10546. Javadoc and other small fixes for extended attributes in
+  hadoop-common. (Charles Lamb via wang)
+
   OPTIMIZATIONS
 
   BUG FIXES

+ 55 - 47
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java

@@ -17,7 +17,6 @@
  */
 package org.apache.hadoop.fs;
 
-
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.lang.reflect.Constructor;
@@ -1040,18 +1039,18 @@ public abstract class AbstractFileSystem {
   }
 
   /**
-   * Set the xattr of a file or directory.
-   * Name must be prefixed with user/trusted/security/system which
-   * followed by ".", For example "user.attr".
+   * Set an xattr of a file or directory.
+   * The name must be prefixed with user/trusted/security/system and
+   * followed by ".". For example, "user.attr".
    * <p/>
-   * A regular user only can set xattr of "user" namespace.
-   * A super user can set xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only set an xattr for the "user" namespace.
+   * The super user can set an xattr of either the "user" or "trusted" namespaces.
+   * The xattrs of the "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
-   * For xattr of "user" namespace, its access permissions are
-   * defined by the file or directory permission bits.
-   * XAttr will be set only when login user has correct permissions.
+   * The access permissions of an xattr in the "user" namespace are
+   * defined by the file and directory permission bits.
+   * An xattr can only be set when the logged-in user has the correct permissions.
    * If the xattr exists, it will be replaced.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
@@ -1069,18 +1068,19 @@ public abstract class AbstractFileSystem {
   }
 
   /**
-   * Set the xattr of a file or directory.
-   * Name must be prefixed with user/trusted/security/system which
-   * followed by ".", For example "user.attr".
+   * Set an xattr of a file or directory.
+   * The name must be prefixed with user/trusted/security/system and
+   * followed by ".". For example, "user.attr".
    * <p/>
-   * A regular user only can set xattr of "user" namespace.
-   * A super user can set xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only set an xattr for the "user" namespace.
+   * The super user can set an xattr of either the "user" or "trusted" namespaces.
+   * The xattrs of the "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
-   * For xattr of "user" namespace, its access permissions are
-   * defined by the file or directory permission bits.
-   * XAttr will be set only when login user has correct permissions.
+   * The access permissions of an xattr in the "user" namespace are
+   * defined by the file and directory permission bits.
+   * An xattr can only be set when the logged-in user has the correct permissions.
+   * If the xattr exists, it will be replaced.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>
@@ -1098,15 +1098,16 @@ public abstract class AbstractFileSystem {
   }
 
   /**
-   * Get xattr of a file or directory.
-   * Name must be prefixed with user/trusted/security/system.
+   * Get an xattr for a file or directory.
+   * The name must be prefixed with user/trusted/security/system and
+   * followed by ".". For example, "user.attr".
    * <p/>
-   * A regular user only can get xattr of "user" namespace.
-   * A super user can get xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only get an xattr for the "user" namespace.
+   * The super user can get an xattr of either the "user" or "trusted" namespaces.
+   * The xattrs of the "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
-   * XAttr will be returned only when login user has correct permissions.
+   * An xattr will only be returned when the logged-in user has the correct permissions.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>
@@ -1122,13 +1123,14 @@ public abstract class AbstractFileSystem {
   }
 
   /**
-   * Get all xattrs of a file or directory.
-   * Only xattrs which login user has correct permissions will be returned.
+   * Get all of the xattrs for a file or directory.
+   * Only those xattrs for which the logged-in user has permissions to view
+   * are returned.
    * <p/>
-   * A regular user only can get xattr of "user" namespace.
-   * A super user can get xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only get xattrs for the "user" namespace.
+   * The super user can only get xattrs for "user" and "trusted" namespaces.
+   * The xattr of "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>
@@ -1143,14 +1145,14 @@ public abstract class AbstractFileSystem {
   }
 
   /**
-   * Get the xattrs of a file or directory.
-   * Name must be prefixed with user/trusted/security/system.
-   * Only xattrs which login user has correct permissions will be returned.
+   * Get all of the xattrs for a file or directory.
+   * Only those xattrs for which the logged-in user has permissions to view
+   * are returned.
    * <p/>
-   * A regular user only can get xattr of "user" namespace.
-   * A super user can get xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only get xattrs for the "user" namespace.
+   * The super user can only get xattrs for "user" and "trusted" namespaces.
+   * The xattr of "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>
@@ -1167,13 +1169,19 @@ public abstract class AbstractFileSystem {
   }
 
   /**
-   * Remove xattr of a file or directory.
-   * Name must be prefixed with user/trusted/security/system.
+   * Remove an xattr of a file or directory.
+   * The name must be prefixed with user/trusted/security/system and
+   * followed by ".". For example, "user.attr".
    * <p/>
-   * A regular user only can remove xattr of "user" namespace.
-   * A super user can remove xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only remove an xattr for the "user" namespace.
+   * The super user can remove an xattr of either the "user" or "trusted" namespaces.
+   * The xattrs of the "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
+   * <p/>
+   * The access permissions of an xattr in the "user" namespace are
+   * defined by the file and directory permission bits.
+   * An xattr can only be set when the logged-in user has the correct permissions.
+   * If the xattr exists, it will be replaced.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>

+ 61 - 51
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileContext.java

@@ -2296,18 +2296,18 @@ public final class FileContext {
   }
 
   /**
-   * Set the xattr of a file or directory.
-   * Name must be prefixed with user/trusted/security/system which
-   * followed by ".", For example "user.attr".
+   * Set an xattr of a file or directory.
+   * The name must be prefixed with user/trusted/security/system and
+   * followed by ".". For example, "user.attr".
    * <p/>
-   * A regular user only can set xattr of "user" namespace.
-   * A super user can set xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only set an xattr for the "user" namespace.
+   * The super user can set an xattr of either the "user" or "trusted" namespaces.
+   * The xattrs of the "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
-   * For xattr of "user" namespace, its access permissions are
-   * defined by the file or directory permission bits.
-   * XAttr will be set only when login user has correct permissions.
+   * The access permissions of an xattr in the "user" namespace are
+   * defined by the file and directory permission bits.
+   * An xattr can only be set when the logged-in user has the correct permissions.
    * If the xattr exists, it will be replaced.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
@@ -2325,18 +2325,19 @@ public final class FileContext {
   }
 
   /**
-   * Set the xattr of a file or directory.
-   * Name must be prefixed with user/trusted/security/system which
-   * followed by ".", For example "user.attr".
+   * Set an xattr of a file or directory.
+   * The name must be prefixed with user/trusted/security/system and
+   * followed by ".". For example, "user.attr".
    * <p/>
-   * A regular user only can set xattr of "user" namespace.
-   * A super user can set xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only set an xattr for the "user" namespace.
+   * The super user can set an xattr of either the "user" or "trusted" namespaces.
+   * The xattrs of the "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
-   * For xattr of "user" namespace, its access permissions are
-   * defined by the file or directory permission bits.
-   * XAttr will be set only when login user has correct permissions.
+   * The access permissions of an xattr in the "user" namespace are
+   * defined by the file and directory permission bits.
+   * An xattr can only be set when the logged-in user has the correct permissions.
+   * If the xattr exists, it will be replaced.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>
@@ -2349,7 +2350,7 @@ public final class FileContext {
    */
   public void setXAttr(Path path, final String name, final byte[] value,
       final EnumSet<XAttrSetFlag> flag) throws IOException {
-    Path absF = fixRelativePart(path);
+    final Path absF = fixRelativePart(path);
     new FSLinkResolver<Void>() {
       @Override
       public Void next(final AbstractFileSystem fs, final Path p)
@@ -2361,15 +2362,17 @@ public final class FileContext {
   }
 
   /**
-   * Get xattr of a file or directory.
-   * Name must be prefixed with user/trusted/security/system.
+   * Get an xattr for a file or directory.
+   * The name must be prefixed with user/trusted/security/system and
+   * followed by ".". For example, "user.attr".
    * <p/>
-   * A regular user only can get xattr of "user" namespace.
-   * A super user can get xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * 
+   * A regular user can only get an xattr for the "user" namespace.
+   * The super user can get an xattr of either the "user" or "trusted" namespaces.
+   * The xattrs of the "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
-   * XAttr will be returned only when login user has correct permissions.
+   * An xattr will only be returned when the logged-in user has the correct permissions.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>
@@ -2380,7 +2383,7 @@ public final class FileContext {
    * @throws IOException
    */
   public byte[] getXAttr(Path path, final String name) throws IOException {
-    Path absF = fixRelativePart(path);
+    final Path absF = fixRelativePart(path);
     return new FSLinkResolver<byte[]>() {
       @Override
       public byte[] next(final AbstractFileSystem fs, final Path p)
@@ -2391,13 +2394,14 @@ public final class FileContext {
   }
 
   /**
-   * Get all xattrs of a file or directory.
-   * Only xattrs which login user has correct permissions will be returned.
+   * Get all of the xattrs for a file or directory.
+   * Only those xattrs for which the logged-in user has permissions to view
+   * are returned.
    * <p/>
-   * A regular user only can get xattr of "user" namespace.
-   * A super user can get xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only get xattrs for the "user" namespace.
+   * The super user can only get xattrs for "user" and "trusted" namespaces.
+   * The xattr of "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>
@@ -2407,7 +2411,7 @@ public final class FileContext {
    * @throws IOException
    */
   public Map<String, byte[]> getXAttrs(Path path) throws IOException {
-    Path absF = fixRelativePart(path);
+    final Path absF = fixRelativePart(path);
     return new FSLinkResolver<Map<String, byte[]>>() {
       @Override
       public Map<String, byte[]> next(final AbstractFileSystem fs, final Path p)
@@ -2418,14 +2422,14 @@ public final class FileContext {
   }
 
   /**
-   * Get the xattrs of a file or directory.
-   * Name must be prefixed with user/trusted/security/system.
-   * Only xattrs which login user has correct permissions will be returned.
+   * Get all of the xattrs for a file or directory.
+   * Only those xattrs for which the logged-in user has permissions to view
+   * are returned.
    * <p/>
-   * A regular user only can get xattr of "user" namespace.
-   * A super user can get xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only get xattrs for the "user" namespace.
+   * The super user can only get xattrs for "user" and "trusted" namespaces.
+   * The xattr of "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>
@@ -2437,7 +2441,7 @@ public final class FileContext {
    */
   public Map<String, byte[]> getXAttrs(Path path, final List<String> names)
       throws IOException {
-    Path absF = fixRelativePart(path);
+    final Path absF = fixRelativePart(path);
     return new FSLinkResolver<Map<String, byte[]>>() {
       @Override
       public Map<String, byte[]> next(final AbstractFileSystem fs, final Path p)
@@ -2448,13 +2452,19 @@ public final class FileContext {
   }
 
   /**
-   * Remove xattr of a file or directory.
-   * Name must be prefixed with user/trusted/security/system.
+   * Remove an xattr of a file or directory.
+   * The name must be prefixed with user/trusted/security/system and
+   * followed by ".". For example, "user.attr".
    * <p/>
-   * A regular user only can remove xattr of "user" namespace.
-   * A super user can remove xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only remove an xattr for the "user" namespace.
+   * The super user can remove an xattr of either the "user" or "trusted" namespaces.
+   * The xattrs of the "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
+   * <p/>
+   * The access permissions of an xattr in the "user" namespace are
+   * defined by the file and directory permission bits.
+   * An xattr can only be set when the logged-in user has the correct permissions.
+   * If the xattr exists, it will be replaced.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>
@@ -2464,7 +2474,7 @@ public final class FileContext {
    * @throws IOException
    */
   public void removeXAttr(Path path, final String name) throws IOException {
-    Path absF = fixRelativePart(path);
+    final Path absF = fixRelativePart(path);
     new FSLinkResolver<Void>() {
       @Override
       public Void next(final AbstractFileSystem fs, final Path p)

+ 56 - 46
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java

@@ -2351,18 +2351,18 @@ public abstract class FileSystem extends Configured implements Closeable {
   }
 
   /**
-   * Set the xattr of a file or directory.
-   * Name must be prefixed with user/trusted/security/system which
-   * followed by ".", For example "user.attr".
+   * Set an xattr of a file or directory.
+   * The name must be prefixed with user/trusted/security/system and
+   * followed by ".". For example, "user.attr".
    * <p/>
-   * A regular user only can set xattr of "user" namespace.
-   * A super user can set xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only set an xattr for the "user" namespace.
+   * The super user can set an xattr of either the "user" or "trusted" namespaces.
+   * The xattrs of the "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
-   * For xattr of "user" namespace, its access permissions are
-   * defined by the file or directory permission bits.
-   * XAttr will be set only when login user has correct permissions.
+   * The access permissions of an xattr in the "user" namespace are
+   * defined by the file and directory permission bits.
+   * An xattr can only be set when the logged-in user has the correct permissions.
    * If the xattr exists, it will be replaced.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
@@ -2380,18 +2380,19 @@ public abstract class FileSystem extends Configured implements Closeable {
   }
 
   /**
-   * Set the xattr of a file or directory.
-   * Name must be prefixed with user/trusted/security/system which
-   * followed by ".", For example "user.attr".
+   * Set an xattr of a file or directory.
+   * The name must be prefixed with user/trusted/security/system and
+   * followed by ".". For example, "user.attr".
    * <p/>
-   * A regular user only can set xattr of "user" namespace.
-   * A super user can set xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only set an xattr for the "user" namespace.
+   * The super user can set an xattr of either the "user" or "trusted" namespaces.
+   * The xattrs of the "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
-   * For xattr of "user" namespace, its access permissions are
-   * defined by the file or directory permission bits.
-   * XAttr will be set only when login user has correct permissions.
+   * The access permissions of an xattr in the "user" namespace are
+   * defined by the file and directory permission bits.
+   * An xattr can only be set when the logged-in user has the correct permissions.
+   * If the xattr exists, it will be replaced.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>
@@ -2409,15 +2410,17 @@ public abstract class FileSystem extends Configured implements Closeable {
   }
 
   /**
-   * Get xattr of a file or directory.
-   * Name must be prefixed with user/trusted/security/system.
+   * Get an xattr for a file or directory.
+   * The name must be prefixed with user/trusted/security/system and
+   * followed by ".". For example, "user.attr".
    * <p/>
-   * A regular user only can get xattr of "user" namespace.
-   * A super user can get xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * 
+   * A regular user can only get an xattr for the "user" namespace.
+   * The super user can get an xattr of either the "user" or "trusted" namespaces.
+   * The xattrs of the "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
-   * XAttr will be returned only when login user has correct permissions.
+   * An xattr will only be returned when the logged-in user has the correct permissions.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>
@@ -2433,13 +2436,14 @@ public abstract class FileSystem extends Configured implements Closeable {
   }
 
   /**
-   * Get all xattrs of a file or directory.
-   * Only xattrs which login user has correct permissions will be returned.
+   * Get all of the xattrs for a file or directory.
+   * Only those xattrs for which the logged-in user has permissions to view
+   * are returned.
    * <p/>
-   * A regular user only can get xattr of "user" namespace.
-   * A super user can get xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only get xattrs for the "user" namespace.
+   * The super user can only get xattrs for "user" and "trusted" namespaces.
+   * The xattr of "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>
@@ -2454,14 +2458,14 @@ public abstract class FileSystem extends Configured implements Closeable {
   }
 
   /**
-   * Get the xattrs of a file or directory.
-   * Name must be prefixed with user/trusted/security/system.
-   * Only xattrs which login user has correct permissions will be returned.
+   * Get all of the xattrs for a file or directory.
+   * Only those xattrs for which the logged-in user has permissions to view
+   * are returned.
    * <p/>
-   * A regular user only can get xattr of "user" namespace.
-   * A super user can get xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only get xattrs for the "user" namespace.
+   * The super user can only get xattrs for "user" and "trusted" namespaces.
+   * The xattr of "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>
@@ -2478,13 +2482,19 @@ public abstract class FileSystem extends Configured implements Closeable {
   }
 
   /**
-   * Remove xattr of a file or directory.
-   * Name must be prefixed with user/trusted/security/system.
+   * Remove an xattr of a file or directory.
+   * The name must be prefixed with user/trusted/security/system and
+   * followed by ".". For example, "user.attr".
    * <p/>
-   * A regular user only can remove xattr of "user" namespace.
-   * A super user can remove xattr of "user" and "trusted" namespace.
-   * XAttr of "security" and "system" namespace is only used/exposed
-   * internally to the FS impl.
+   * A regular user can only remove an xattr for the "user" namespace.
+   * The super user can remove an xattr of either the "user" or "trusted" namespaces.
+   * The xattrs of the "security" and "system" namespaces are only used/exposed 
+   * internally by/to the FS impl.
+   * <p/>
+   * The access permissions of an xattr in the "user" namespace are
+   * defined by the file and directory permission bits.
+   * An xattr can only be set when the logged-in user has the correct permissions.
+   * If the xattr exists, it will be replaced.
    * <p/>
    * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
    * http://en.wikipedia.org/wiki/Extended_file_attributes</a>

+ 3 - 3
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/XAttrSetFlag.java

@@ -53,18 +53,18 @@ public enum XAttrSetFlag {
   public static void validate(String xAttrName, boolean xAttrExists,
       EnumSet<XAttrSetFlag> flag) throws IOException {
     if (flag == null || flag.isEmpty()) {
-      throw new HadoopIllegalArgumentException("Should specify set flag");
+      throw new HadoopIllegalArgumentException("A flag must be specified.");
     }
 
     if (xAttrExists) {
       if (!flag.contains(REPLACE)) {
         throw new IOException("XAttr: " + xAttrName +
-            " already exists. REPLACE flag must be specified.");
+            " already exists. The REPLACE flag must be specified.");
       }
     } else {
       if (!flag.contains(CREATE)) {
         throw new IOException("XAttr: " + xAttrName +
-            " does not exist. CREATE flag must be specified.");
+            " does not exist. The CREATE flag must be specified.");
       }
     }
   }