[
https://issues.apache.org/jira/browse/HADOOP-3187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601813#action_12601813
]
Tsz Wo (Nicholas), SZE commented on HADOOP-3187:
------------------------------------------------
I like the idea of defining an abstract class for all shell commands. Not able
to review the whole patch yet. Here are some comments:
- It is good to move CommandFormat to fs.shell package
- Instead of initializing Command.args in subclasses, it is better to
initialize in Command constructor.
- In Command, the default constructor can be removed. Members like fs and args
can be declared as final.
- ContentSummary.HEADER should be final. This is probably my fault when I
introduced it.
- For parsing String to get the first line, it is more efficient to use
substring(...) than split(...)
{code}
int eol = s.indexOf('\n');
String firstline = eol<0? s: s.substring(0, eol);
{code}
- In QuotaExceededException, constructors QuotaExceededException(String msg)
and QuotaExceededException(String path, long quota, long count) are not used
anywhere. I suggest to remove them. When creating an instance by
QuotaExceededException(long quota, long count), the error message does not look
nice since path=="". QuotaException sounds better to me and it includes all
quota related issues.
- INodeDirectoryWithQuota should be defined in a new file
INodeDirectoryWithQuota.java
- verifyQuota(long quota, long count) should be static.
- When setting quota, it is good to check whether the new quota is a positive
integer. Right now the new quota will be compared with the count and if the
new quota <0, a QuotaExceededException will be thrown after a long calculation.
> Quotas for name space management
> --------------------------------
>
> Key: HADOOP-3187
> URL: https://issues.apache.org/jira/browse/HADOOP-3187
> Project: Hadoop Core
> Issue Type: New Feature
> Reporter: Robert Chansler
> Assignee: Hairong Kuang
> Fix For: 0.18.0
>
> Attachments: quota.patch, quota1.patch, QuotasDesign.pdf,
> QuotasDesign1.pdf
>
>
> Create a quota mechanism for name space management.
> Quota set at a directory by super user restricts that number of names in and
> below that directory.
> Quota tested by create() and rename().
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.