hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Nauroth (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-5608) WebHDFS: implement GETACLSTATUS and SETACL.
Date Sat, 18 Jan 2014 06:22:19 GMT

    [ https://issues.apache.org/jira/browse/HDFS-5608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13875564#comment-13875564

Chris Nauroth commented on HDFS-5608:

Thanks for the new patch, Sachin.  There is enough code in the feature branch now that I was
able to apply this patch and do some manual testing of WebHDFS setting and getting an ACL.
 Cool!  Here are a few more notes:

# We committed HDFS-5612 and HDFS-5758 to the feature branch today.  Now that these are done,
you're unblocked to write full end-to-end tests that set and get ACLs through WebHDFS.  I
think we can include those tests in this patch.
# {{JsonUtil#toJsonString}}: This version of the method is producing invalid JSON, because
the strings don't have quotes around them.  I apologize if my earlier comment was unclear.
 The former method's logic was correct, but I wondered if we could simplify by skipping the
part that copies the entries list.  I was able to correct the method by going back to your
old version and then simplifying it as follows.  Let's use this version:
  public static String toJsonString(final AclStatus status) {
    if (status == null) {
      return null;
    final Map<String, Object> m = new TreeMap<String, Object>();
    m.put("owner", status.getOwner());
    m.put("group", status.getGroup());
    m.put("stickyBit", status.isStickyBit());
    m.put("entries", status.getEntries());
    return JSON.toString(m);
# {{JsonUtil#toAclStatus}}: In the if-then-else chain that sets ACL entry type, each conditional
evalutes {{index++}} independently.  I think this means {{index}} goes out of bounds.  I think
this needs to be incremented just once before or after the whole if-then-else chain.
# There are still some lines going past the 80-character limit in {{NamenodeWebHdfsMethods}}
and {{JsonUtil}}.  Some of these are unavoidable, like long string literals that would read
awkwardly if we split them across multiple lines and concatenated.  Other occurrences could
be wrapped though.  {{WebhdfsFileSystem}} still has some tabs.

> -------------------------------------------
>                 Key: HDFS-5608
>                 URL: https://issues.apache.org/jira/browse/HDFS-5608
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: webhdfs
>    Affects Versions: HDFS ACLs (HDFS-4685)
>            Reporter: Chris Nauroth
>            Assignee: Sachin Jose
>         Attachments: HDFS-5608.0.patch, HDFS-5608.1.patch, HDFS-5608.2.patch
> Implement and test {{GETACLS}} and {{SETACL}} in WebHDFS.

This message was sent by Atlassian JIRA

View raw message