hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uma Maheswara Rao G (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-10521) FsShell commands for extended attributes.
Date Sun, 27 Apr 2014 06:21:16 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-10521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13982201#comment-13982201
] 

Uma Maheswara Rao G commented on HADOOP-10521:
----------------------------------------------

Regarding to Enum#valueOf, how does below code piece look?
Of course guava library does that Illegalargumentexception handling and return null to us,
if there is no enum value exist.
{code}
private final static Function<String, ENCODE> encodeValueOfFunc = Enums
      .valueOfFunction(ENCODE.class);
.........
.........
.........
if (en != null) {
  encode = encodeValueOfFunc.apply(en);
}
Preconditions.checkArgument(encode != null,
          "Invalid/unsupported econding option specified: en=" + en);

Test:
 runCommand(new String[] { "-getfattr", "-e", "invalid","-n", "xattrname", "/file1"  });
result:
-getfattr: Invalid/unsupported encoding option specified: en=invalid
{code}

> 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)

Mime
View raw message