Author: rangadi
Date: Wed Jun 24 18:26:17 2009
New Revision: 788109
URL: http://svn.apache.org/viewvc?rev=788109&view=rev
Log:
HDFS-438. Improve help message for space quota command. (Raghu Angadi)
Modified:
hadoop/hdfs/trunk/CHANGES.txt
hadoop/hdfs/trunk/src/docs/src/documentation/content/xdocs/hdfs_quota_admin_guide.xml
hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java
hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/cli/testHDFSConf.xml
Modified: hadoop/hdfs/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=788109&r1=788108&r2=788109&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Wed Jun 24 18:26:17 2009
@@ -31,3 +31,10 @@
HDFS-195. Handle expired tokens when write pipeline is restablished.
(Kan Zhang via rangadi)
+
+Release 0.20.1 - Unreleased
+
+ IMPROVEMENTS
+
+ HDFS-438. Improve help message for space quota command. (Raghu Angadi)
+
Modified:
hadoop/hdfs/trunk/src/docs/src/documentation/content/xdocs/hdfs_quota_admin_guide.xml
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/docs/src/documentation/content/xdocs/hdfs_quota_admin_guide.xml?rev=788109&r1=788108&r2=788109&view=diff
==============================================================================
---
hadoop/hdfs/trunk/src/docs/src/documentation/content/xdocs/hdfs_quota_admin_guide.xml
(original)
+++
hadoop/hdfs/trunk/src/docs/src/documentation/content/xdocs/hdfs_quota_admin_guide.xml
Wed Jun 24 18:26:17 2009
@@ -73,7 +73,8 @@
directory has no quota. </li>
<li> <code>dfsadmin -setSpaceQuota <N>
<directory>...<directory></code> <br /> Set the space quota to be
-N bytes for each directory. N can also be specified with a binary prefix for
convenience, for e.g. 50g for 50 gigabytes and
+N bytes for each directory. This is a hard limit on total size of all the
files under the directory tree.
+The space quota takes replication also into account, i.e. one GB of data with
replication of 3 consumes 3GB of quota. N can also be specified with a binary
prefix for convenience, for e.g. 50g for 50 gigabytes and
2t for 2 terabytes etc. Best effort for each directory, with faults reported
if <code>N</code> is
neither zero nor a positive integer, the directory does not exist or it is a
file, or the directory would immediately exceed
the new quota. </li>
Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java?rev=788109&r1=788108&r2=788109&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java
(original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java Wed
Jun 24 18:26:17 2009
@@ -201,8 +201,10 @@
"-"+NAME+" <quota> <dirname>...<dirname>";
private static final String DESCRIPTION = USAGE + ": " +
"Set the disk space quota <quota> for each directory <dirName>.\n" +
- "\t\tThe directory quota is a long integer that puts a hard limit\n" +
- "\t\ton the number of names in the directory tree.\n" +
+ "\t\tThe space quota is a long integer that puts a hard limit\n" +
+ "\t\ton the total size of all the files under the directory tree.\n" +
+ "\t\tThe extra space required for replication is also counted. E.g.\n" +
+ "\t\ta 1GB file with replication of 3 consumes 3GB of the quota.\n\n" +
"\t\tQuota can also be speciefied with a binary prefix for terabytes,\n"
+
"\t\tpetabytes etc (e.g. 50t is 50TB, 5m is 5MB, 3p is 3PB).\n" +
"\t\tBest effort for the directory, with faults reported if\n" +
@@ -542,13 +544,13 @@
System.out.println(upgradeProgress);
} else if ("metasave".equals(cmd)) {
System.out.println(metaSave);
- } else if (SetQuotaCommand.matches(cmd)) {
+ } else if (SetQuotaCommand.matches("-"+cmd)) {
System.out.println(SetQuotaCommand.DESCRIPTION);
- } else if (ClearQuotaCommand.matches(cmd)) {
+ } else if (ClearQuotaCommand.matches("-"+cmd)) {
System.out.println(ClearQuotaCommand.DESCRIPTION);
- } else if (SetSpaceQuotaCommand.matches(cmd)) {
+ } else if (SetSpaceQuotaCommand.matches("-"+cmd)) {
System.out.println(SetSpaceQuotaCommand.DESCRIPTION);
- } else if (ClearSpaceQuotaCommand.matches(cmd)) {
+ } else if (ClearSpaceQuotaCommand.matches("-"+cmd)) {
System.out.println(ClearSpaceQuotaCommand.DESCRIPTION);
} else if ("refreshServiceAcl".equals(cmd)) {
System.out.println(refreshServiceAcl);
Modified: hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/cli/testHDFSConf.xml
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/cli/testHDFSConf.xml?rev=788109&r1=788108&r2=788109&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/cli/testHDFSConf.xml
(original)
+++ hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/cli/testHDFSConf.xml Wed
Jun 24 18:26:17 2009
@@ -16068,19 +16068,15 @@
</comparator>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^( |\t)*The directory quota is a long integer that
puts a hard limit( )*</expected-output>
+ <expected-output>^( |\t)*The space quota is a long integer that puts
a hard limit( )*</expected-output>
</comparator>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^( |\t)*on the number of names in the directory
tree.( )*</expected-output>
+ <expected-output>^( |\t)*on the total size of all the files under
the directory tree.( )*</expected-output>
</comparator>
<comparator>
<type>RegexpComparator</type>
- <expected-output>^( |\t)*2. user is not an administrator.(
)*</expected-output>
- </comparator>
- <comparator>
- <type>RegexpComparator</type>
- <expected-output>^( |\t)*It does not fault if the directory has no
quota.( )*</expected-output>
+ <expected-output>^( |\t)*2. user is not an administrator, or(
)*</expected-output>
</comparator>
</comparators>
</test>