瀏覽代碼

HDFS-352. Documentation for saveNamespace command. Contributed by Ravi Phulari.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/trunk@788555 13f79535-47bb-0310-9956-ffa450edef68
Konstantin Shvachko 16 年之前
父節點
當前提交
93d10f28f3

+ 2 - 0
CHANGES.txt

@@ -18,6 +18,8 @@ Trunk (unreleased changes)
     HDFS-444. Allow to change probability levels dynamically in the fault
     HDFS-444. Allow to change probability levels dynamically in the fault
     injection framework.  (Konstantin Boudnik via szetszwo)
     injection framework.  (Konstantin Boudnik via szetszwo)
 
 
+    HDFS-352. Documentation for saveNamespace command. (Ravi Phulari via shv)
+
   BUG FIXES
   BUG FIXES
     HDFS-76. Better error message to users when commands fail because of 
     HDFS-76. Better error message to users when commands fail because of 
     lack of quota. Allow quota to be set even if the limit is lower than
     lack of quota. Allow quota to be set even if the limit is lower than

+ 66 - 30
src/docs/src/documentation/content/xdocs/commands_manual.xml

@@ -483,11 +483,11 @@
 					Runs a HDFS dfsadmin client.
 					Runs a HDFS dfsadmin client.
 				</p> 
 				</p> 
 				<p>
 				<p>
-					<code>Usage: hadoop dfsadmin  [</code><a href="commands_manual.html#Generic+Options">GENERIC_OPTIONS</a><code>] [-report] [-safemode enter | leave | get | wait] [-refreshNodes]
-					 [-finalizeUpgrade] [-upgradeProgress status | details | force] [-metasave filename] 
-					 [-setQuota &lt;quota&gt; &lt;dirname&gt;...&lt;dirname&gt;] [-clrQuota &lt;dirname&gt;...&lt;dirname&gt;] 
-					 [-restoreFailedStorage true|false|check] 
-					 [-help [cmd]]</code>
+					<code>Usage: hadoop dfsadmin  [</code><a href="commands_manual.html#Generic+Options">GENERIC_OPTIONS</a><code>] 
+					[-report][-safemode enter | leave | get | wait] [-saveNamespace] [-restoreFailedStorage true|false|check] [-refreshNodes] [-finalizeUpgrade]
+					[-upgradeProgress status | details | force] [-metasave filename] [-refreshServiceAcl] [-printTopology] [-setQuota &lt;quota&gt; &lt;dirname&gt;...&lt;dirname&gt;]
+					[-clrQuota &lt;dirname&gt;...&lt;dirname&gt;] [-setSpaceQuota &lt;quota&gt; &lt;dirname&gt;...&lt;dirname&gt;] [-clrSpaceQuota &lt;dirname&gt;...&lt;dirname&gt;] [-help [cmd]]
+					</code>
 				</p>
 				</p>
 				<table>
 				<table>
 			          <tr><th> COMMAND_OPTION </th><th> Description </th></tr>
 			          <tr><th> COMMAND_OPTION </th><th> Description </th></tr>
@@ -499,14 +499,68 @@
 			           <tr>
 			           <tr>
 			          	<td><code>-safemode enter | leave | get | wait</code></td>
 			          	<td><code>-safemode enter | leave | get | wait</code></td>
 			            <td>Safe mode maintenance command.
 			            <td>Safe mode maintenance command.
-                Safe mode is a Namenode state in which it <br/>
-                        1.  does not accept changes to the name space (read-only) <br/> 
-                        2.  does not replicate or delete blocks. <br/>
-                Safe mode is entered automatically at Namenode startup, and
-                leaves safe mode automatically when the configured minimum
-                percentage of blocks satisfies the minimum replication
-                condition.  Safe mode can also be entered manually, but then
+               Safe mode is a Namenode state in which it <br/>
+               1.  does not accept changes to the name space (read-only) <br/> 
+               2.  does not replicate or delete blocks. <br/>
+               Safe mode is entered automatically at Namenode startup, and
+               leaves safe mode automatically when the configured minimum
+               percentage of blocks satisfies the minimum replication
+               condition.  Safe mode can also be entered manually, but then
                 it can only be turned off manually as well.</td>
                 it can only be turned off manually as well.</td>
+			           </tr>
+			           <tr>
+			              <td><code>-saveNamesapce</code></td>
+			              <td>Save current namespace into storage directories and reset edits log.
+        Requires superuser permissions and safe mode.
+			              </td>
+			           </tr>
+			           <tr>
+			           		<td><code> -restoreFailedStorage</code></td>
+			           		<td>  Set/Unset/Check flag to attempt restore of failed storage replicas if they become available.
+        Requires superuser permissions.</td>
+			           </tr>
+			           <tr>
+			                <td><code>-refreshServiceAcl</code></td>
+			                <td> Reload the service-level authorization policy file
+        Namenode will reload the authorization policy file</td>
+			           </tr>
+			           <tr>
+			           		<td><code>-setSpaceQuota &lt;quota> &lt;dirname&gt;...&lt;dirname&gt;</code></td>
+			           		<td>Set the disk space quota &lt;quota&gt; for each directory &lt;dirName&gt;. The directory quota is a long integer that puts a hard limit
+        on the number of names in the directory tree.
+        Quota can also be speciefied with a binary prefix for terabytes,
+        petabytes etc (e.g. 50t is 50TB, 5m is 5MB, 3p is 3PB).<br/>
+        For each directory, attempt to set the quota. An error will be reported if<br/>
+        1. N is not a positive integer, or<br/>
+        2. user is not an administrator, or<br/>
+        3. the directory does not exist or is a file, or<br/>
+        4. the directory would immediately exceed the new space quota.</td>
+			           </tr>
+			           <tr>
+			           		<td><code>-clrSpaceQuota &lt;dirname&gt;...&lt;dirname&gt;</code></td>
+			           		<td> Clear the disk space quota for each directory &lt;dirName&gt;.
+        For each directory, attempt to set the quota. An error will be reported if<br/>
+        1. the directory does not exist or is a file, or<br/>
+        2. user is not an administrator.<br/>
+        It does not fault if the directory has no quota.</td>
+			           </tr>
+			            <tr>
+			          	<td><code>-setQuota &lt;quota&gt; &lt;dirname&gt;...&lt;dirname&gt;</code></td>
+			            <td>Set the quota &lt;quota&gt; for each directory &lt;dirname&gt;.
+         The directory quota is a long integer that puts a hard limit on the number of names in the directory tree.<br/>
+         For each directory, attempt to set the quota. An error will be reported if<br/>
+         1. N is not a positive integer, or<br/>
+         2. user is not an administrator, or<br/>
+         3. the directory does not exist or is a file, or<br/>
+         4. the directory would immediately exceed the new quota.</td>
+			           </tr>
+			           <tr>
+			          	<td><code>-clrQuota &lt;dirname&gt;...&lt;dirname&gt;</code></td>
+			            <td>Clear the quota for each directory &lt;dirname&gt;.<br/>
+        For each directory, attempt to set the quota. An error will be reported if<br/>
+        1. the directory does not exist or is a file, or<br/>
+        2. user is not an administrator.<br/>
+        It does not fault if the directory has no quota.</td>
 			           </tr>
 			           </tr>
 			           <tr>
 			           <tr>
 			          	<td><code>-refreshNodes</code></td>
 			          	<td><code>-refreshNodes</code></td>
@@ -540,24 +594,6 @@
                         2. Blocks waiting to be replicated<br/>
                         2. Blocks waiting to be replicated<br/>
                         3. Blocks currrently being replicated<br/>
                         3. Blocks currrently being replicated<br/>
                         4. Blocks waiting to be deleted</td>
                         4. Blocks waiting to be deleted</td>
-			           </tr>
-			           <tr>
-			          	<td><code>-setQuota &lt;quota&gt; &lt;dirname&gt;...&lt;dirname&gt;</code></td>
-			            <td>Set the quota &lt;quota&gt; for each directory &lt;dirname&gt;.
-                The directory quota is a long integer that puts a hard limit on the number of names in the directory tree.<br/>
-                Best effort for the directory, with faults reported if<br/>
-                1. N is not a positive integer, or<br/>
-                2. user is not an administrator, or<br/>
-                3. the directory does not exist or is a file, or<br/>
-                4. the directory would immediately exceed the new quota.</td>
-			           </tr>
-			           <tr>
-			          	<td><code>-clrQuota &lt;dirname&gt;...&lt;dirname&gt;</code></td>
-			            <td>Clear the quota for each directory &lt;dirname&gt;.<br/>
-                Best effort for the directory. with fault reported if<br/>
-                1. the directory does not exist or is a file, or<br/>
-                2. user is not an administrator.<br/>
-                It does not fault if the directory has no quota.</td>
 			           </tr>
 			           </tr>
 			           <tr>
 			           <tr>
 			          	<td><code>-restoreFailedStorage true | false | check</code></td>
 			          	<td><code>-restoreFailedStorage true | false | check</code></td>

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

@@ -76,7 +76,7 @@ public class DFSAdmin extends FsShell {
     private static final String USAGE = "-"+NAME+" <dirname>...<dirname>";
     private static final String USAGE = "-"+NAME+" <dirname>...<dirname>";
     private static final String DESCRIPTION = USAGE + ": " +
     private static final String DESCRIPTION = USAGE + ": " +
     "Clear the quota for each directory <dirName>.\n" +
     "Clear the quota for each directory <dirName>.\n" +
-    "\t\tBest effort for the directory. with fault reported if\n" +
+    "\t\tFor each directory, attempt to clear the quota. An error will be reported if\n" +
     "\t\t1. the directory does not exist or is a file, or\n" +
     "\t\t1. the directory does not exist or is a file, or\n" +
     "\t\t2. user is not an administrator.\n" +
     "\t\t2. user is not an administrator.\n" +
     "\t\tIt does not fault if the directory has no quota.";
     "\t\tIt does not fault if the directory has no quota.";
@@ -119,7 +119,7 @@ public class DFSAdmin extends FsShell {
       "Set the quota <quota> for each directory <dirName>.\n" + 
       "Set the quota <quota> for each directory <dirName>.\n" + 
       "\t\tThe directory quota is a long integer that puts a hard limit\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\ton the number of names in the directory tree\n" +
-      "\t\tBest effort for the directory, with faults reported if\n" +
+      "\t\tFor each directory, attempt to set the quota. An error will be reported if\n" +
       "\t\t1. N is not a positive integer, or\n" +
       "\t\t1. N is not a positive integer, or\n" +
       "\t\t2. user is not an administrator, or\n" +
       "\t\t2. user is not an administrator, or\n" +
       "\t\t3. the directory does not exist or is a file, or\n";
       "\t\t3. the directory does not exist or is a file, or\n";
@@ -161,7 +161,7 @@ public class DFSAdmin extends FsShell {
     private static final String USAGE = "-"+NAME+" <dirname>...<dirname>";
     private static final String USAGE = "-"+NAME+" <dirname>...<dirname>";
     private static final String DESCRIPTION = USAGE + ": " +
     private static final String DESCRIPTION = USAGE + ": " +
     "Clear the disk space quota for each directory <dirName>.\n" +
     "Clear the disk space quota for each directory <dirName>.\n" +
-    "\t\tBest effort for the directory. with fault reported if\n" +
+    "\t\tFor each directory, attempt to clear the quota. An error will be reported if\n" +
     "\t\t1. the directory does not exist or is a file, or\n" +
     "\t\t1. the directory does not exist or is a file, or\n" +
     "\t\t2. user is not an administrator.\n" +
     "\t\t2. user is not an administrator.\n" +
     "\t\tIt does not fault if the directory has no quota.";
     "\t\tIt does not fault if the directory has no quota.";
@@ -207,7 +207,7 @@ public class DFSAdmin extends FsShell {
       "\t\ta 1GB file with replication of 3 consumes 3GB of the quota.\n\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\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\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" +
+      "\t\tFor each directory, attempt to set the quota. An error will be reported if\n" +
       "\t\t1. N is not a positive integer, or\n" +
       "\t\t1. N is not a positive integer, or\n" +
       "\t\t2. user is not an administrator, or\n" +
       "\t\t2. user is not an administrator, or\n" +
       "\t\t3. the directory does not exist or is a file, or\n";
       "\t\t3. the directory does not exist or is a file, or\n";

+ 3 - 3
src/test/hdfs/org/apache/hadoop/cli/testHDFSConf.xml

@@ -16006,7 +16006,7 @@
         </comparator>
         </comparator>
         <comparator>
         <comparator>
           <type>RegexpComparator</type>
           <type>RegexpComparator</type>
-          <expected-output>^( |\t)*Best effort for the directory, with faults reported if( )*</expected-output>
+          <expected-output>^( |\t)*For each directory, attempt to set the quota. An error will be reported if( )*</expected-output>
         </comparator>
         </comparator>
         <comparator>
         <comparator>
           <type>RegexpComparator</type>
           <type>RegexpComparator</type>
@@ -16037,7 +16037,7 @@
         </comparator>
         </comparator>
         <comparator>
         <comparator>
           <type>RegexpComparator</type>
           <type>RegexpComparator</type>
-          <expected-output>^( |\t)*Best effort for the directory. with fault reported if( )*</expected-output>
+          <expected-output>^( |\t)*For each directory, attempt to clear the quota. An error will be reported if( )*</expected-output>
         </comparator>
         </comparator>
         <comparator>
         <comparator>
           <type>RegexpComparator</type>
           <type>RegexpComparator</type>
@@ -16095,7 +16095,7 @@
         </comparator>
         </comparator>
         <comparator>
         <comparator>
           <type>RegexpComparator</type>
           <type>RegexpComparator</type>
-          <expected-output>^( |\t)*Best effort for the directory. with fault reported if( )*</expected-output>
+          <expected-output>^( |\t)*For each directory, attempt to clear the quota. An error will be reported if( )*</expected-output>
         </comparator>
         </comparator>
         <comparator>
         <comparator>
           <type>RegexpComparator</type>
           <type>RegexpComparator</type>