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

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

1. Should FileStatus should also include length, blockSize and isDirectory?  
The FileSystem methods getLength(), getBlockSize(), and isDirectory() could 
then be defined in terms of getStatus().  This is compatible with what unix 
does internally, but not with java.io.File, and is also probably compatible 
with most distributed filesystems, where RPCs are at a premium, and it is best 
to bundle more information into a single call.

2. The six booleans in the FileStatus constructor are error prone.  Rather a 
single int parameter and constants would be easier to use.  Perhaps something 
like:

public static final int OWNER_READ = 1;
public static final int OWNER_WRITE = 2;
public static final int OWNER_RW = 3;

public static final int GROUP_READ = 8;
public static final int GROUP_WRITE = 16;
public static final int GROUP_RW = 24;

public static final int OTHER_READ = 64;
public static final int OTHER_WRITE = 128;
public static final int OTHER_RW = 196;

public static final int PERMIT_ALL = 0xffffffff;

This way one can construct a FileStatus with something like:

FileStatus status = new FileStatus(Path, user, group, PERMIT_ALL);
FileStatus status = new FileStatus(Path, user, group, OWNER_RW | GROUP_READ);




> 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, 
> hadoop-user-munncha.patch7
>
>
> 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