Browse Source

HDFS-438. Improve help message for space quota command. (Raghu Angadi)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20@788181 13f79535-47bb-0310-9956-ffa450edef68
Raghu Angadi 16 năm trước cách đây
mục cha
commit
76d5fa5081

+ 2 - 0
CHANGES.txt

@@ -26,6 +26,8 @@ Release 0.20.1 - Unreleased
     HADOOP-4372. Improves the way history filenames are obtained and manipulated.
     (Amar Kamat via ddas)
 
+    HDFS-438. Improve help message for space quota command. (Raghu Angadi)
+
   OPTIMIZATIONS
 
   BUG FIXES

+ 2 - 1
src/docs/src/documentation/content/xdocs/hdfs_quota_admin_guide.xml

@@ -68,7 +68,8 @@ effort for each directory, with faults reported if the directory does not exist
 directory has no quota. </li>
 
  <li> <code>dfsadmin -setSpaceQuota &lt;N> &lt;directory>...&lt;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>

+ 8 - 6
src/hdfs/org/apache/hadoop/hdfs/tools/DFSAdmin.java

@@ -196,8 +196,10 @@ public class DFSAdmin extends FsShell {
       "-"+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" +
@@ -492,13 +494,13 @@ public class DFSAdmin extends FsShell {
       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);