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

Doug Cutting commented on HADOOP-1298:
--------------------------------------

1. New public methods on public classes must have informative javadoc comments.

2. There should always be a space before '{'.

3. I don't see a need for an "executable" permission.  Read & write should be 
sufficient for now, no?  We can add this later if we need it.

4. In FSPermissions you have both a 'String permissions' and 'boolean readable; 
boolean writable;'.  This looks redundant to me. I'd expect something more like:
  
  private static final int OWNER_WRITABLE = ...;
  ...
  private int permissions;
  public int getPermissions();
  public String getPermissionsAsString();
  public boolean isOwnerWritable() { 
    return (permissions & OWNER_WRITABLE) != 0;
  }
  public boolean isOwnerReadable() { ... };
  public boolean isGroupWritable(); { ... };
  public boolean isGroupReadable(); { ... };
  public boolean isOtherWritable(); { ... };
  public boolean isOtherReadable(); { ... };

5. Let's rename FSPermissions to be FileStatus, by analogy with the stat() 
system call.  Then, in the future we can add modified date, etc. to this.  The 
FileSystem method to access this should then be getFileStatus(Path).

6. ClientContext should be in the dfs package, since it's not used in the 
generic API.

7. The default permission/status should not be null, but either be abstract or 
return a permission that permits everything.

8. Don't we need a 'chown' method too?

9. The cache of FileSystem instances (FileSystem.CACHE) should be keyed by 
Configuration in addition to scheme and authority, so that 
FileSystem.get(URI,Configuration) will return different instances for the same 
path if the configuration (i.e., user) differs.

I have not yet had a chance to look closely at the implementation of 
permissions in DFS.

> adding user info to file
> ------------------------
>
>                 Key: HADOOP-1298
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1298
>             Project: Hadoop
>          Issue Type: New Feature
>          Components: dfs, fs
>            Reporter: Kurtis Heimerl
>         Attachments: hadoop-user-munncha.patch, hadoop-user-munncha.patch, 
> hadoop-user-munncha.patch, hadoop-user-munncha.patch4, 
> hadoop-user-munncha.patch5, hadoop-user-munncha.patch6
>
>
> I'm working on adding a permissions model to hadoop's DFS. The first step is 
> this change, which associates user info with files. Following this I'll 
> assoicate permissions info, then block methods based on that user info, then 
> authorization of the user info. 
> So, right now i've implemented adding user info to files. I'm looking for 
> feedback before I clean this up and make it offical. 
> I wasn't sure what release, i'm working off trunk. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to