|
[
Permlink
| « Hide
]
Hairong Kuang added a comment - 02/May/08 05:54 PM
Deisgn document is attached.
+1 This sounds like a good design to me. I assume that one could set the quota on the root directory to something based on the amount of memory available on the namenode, as the simplest means of control, right?
> I assume that one could set the quota on the root directory to something based on the amount of memory available on the namenode, as the simplest means of control, right?
Doug, yes, you are right. This patch has the following major changes:
1. Support two adminstrative commands: setQuota and clrQuota; 2. Add an option -q to the count command that prints the quota of a directory; 3. Change operations mkdirs, create, and rename to respect quota; 4. All directories save its quota to the image file. The code to load an fsimage form disk to memory should try to avoid object allocation if possible, this speeds up namenode restart times. FSEditLog.readInt() allocates an IntWritbale every time it is invoked. Is this method being used at fsimage loading time?
Yes, instead of allocating a new IntWritale, I should allocate a static IntWritable and reuse this variable every time reading an integer from fsimage.
A slightly modified design document that matches the quota implementation.
Konstantin, thanks a lot for your comments. I agree with most of them except for
Comment 2: AccessControlException concerns about user identity. But QuotaExceededException has nothing to do with users and groups. So I would prefer to make it be an IOException. Comments 8, 9: Currently int would be enough for counting namespace size. But if we concern about the backward compatibility and future support, I will make both quota and count to be long. Comments 11: I prefer to make the checking and updating count to be an atomic operation in stead of breaking it into two operations. Even with your approach, there is a risk of inconsistency if there is a runtime exception in between the tree update and the count update. This patch does the followings:
1. incorporate Konstantin and Dhruba's comments; 2. allows globs and multiple directories as the arguments to setQuota and clrQuota commands; 3. has a unit test TestQuota. 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:
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12383155/quota1.patch against trunk revision 662569. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 24 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. -1 javac. The applied patch generated 412 javac compiler warnings (more than the trunk's current 410 warnings). +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2541/testReport/ This message is automatically generated. This patch incorporates most of Nicholas' comments.
Two minor comments to the new patch. Otherwise, everything looks good to me.
Long was saved to the disk using the serialization method in LongWritable so we need to use the deserialization method in LongWritable to read it out.
I incorporated the second comment in the new patch. -1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12383338/quota3.patch against trunk revision 662913. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 27 new or modified tests. -1 patch. The patch command could not apply the patch. Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2560/console This message is automatically generated.
The patch looks good. -1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12383338/quota3.patch against trunk revision 662976. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 27 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. -1 javac. The applied patch generated 411 javac compiler warnings (more than the trunk's current 409 warnings). +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2569/testReport/ This message is automatically generated. 1, FSDirectory.updateCount() is changed to be updateCountForInodeWithQuota.
2. I still keep quota & count to be long. So in the future when dfs grows, we do not need to make any change. The patch Incorporated rest of Konstantin's comments. > I think INodeDirectoryWithQuota should stay inside INode.java. Otherwise all other subclasses should be factored out too.
Yes, all other subclasses should be factored out too. We should fix it in HADOOP-1826. +1 patch looks good -1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12383403/quota4.patch against trunk revision 663370. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 27 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. -1 javac. The applied patch generated 449 javac compiler warnings (more than the trunk's current 447 warnings). +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. -1 contrib tests. The patch failed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2578/testReport/ This message is automatically generated. > 2. I still keep quota & count to be long.
Yes keep them long, that is what I meant to say. The contrib test failure does not seem to be related to the patch, the previous build failed the same test. +1 The failed tests exist in the trunk. They does not seem to be related to the patch. The increased 2 javac warnings are caused by using UTF8 to save path names into the edit log.
I just committed this. By the way, I reverted the patch and applied it again since some files were missing in the first commit and the trunk build was broken due to the missing files.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||