[
https://issues.apache.org/jira/browse/HADOOP-10521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13981857#comment-13981857
]
Yi Liu commented on HADOOP-10521:
---------------------------------
Thanks Chris.
{quote} getfattr uses _Enum#valueOf_ to parse the encoding. When there is no
enum value matching the string, Java throws an exception with a fairly ugly
message that propagates all the way back to the user's console. (See below.)
You might want to consider catching this and instead throwing a
_HadoopIllegalArgumentException_ with a friendlier error message {quote}
I will do that.
{quote} Is there a reason that both _CommandFormat_ and
_StringUtils#popOptionWithArgument_ were used? {quote}
_CommandFormat_ is not good for option with argument, fox example "-n user.attr
-v 123456". Of course it can, but if we pass all the options to
_CommandFormat_, I don't want to assume the first one is argument for -n and
next one is argument for -v, they could be in any order.
Right, only use one helper class will looks consistent, we can use
_StringUtils.popOptionWithArgument_ and _StringUtils.popOption_.
By the way, using _StringUtils.popOptionWithArgument_ and
_StringUtils.popOption_ will iterate args list for every opt. We can improve
the _CommandFormat_ to support option with argument, since we just iterate args
list one time for all opts in _CommandFormat_. Should I do this?
> FsShell commands for extended attributes.
> -----------------------------------------
>
> Key: HADOOP-10521
> URL: https://issues.apache.org/jira/browse/HADOOP-10521
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs
> Affects Versions: HDFS XAttrs (HDFS-2006)
> Reporter: Yi Liu
> Assignee: Yi Liu
> Attachments: HADOOP-10521.1.patch, HADOOP-10521.2.patch,
> HADOOP-10521.3.patch, HADOOP-10521.patch
>
>
> “setfattr” and “getfattr” commands are added to FsShell for XAttr, and these
> are the same as in Linux.
--
This message was sent by Atlassian JIRA
(v6.2#6252)