浏览代码

HDFS-5373. hdfs cacheadmin -addDirective short usage does not mention -replication parameter. Contributed by Chris Nauroth.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-4949@1532888 13f79535-47bb-0310-9956-ffa450edef68
Chris Nauroth 11 年之前
父节点
当前提交
8da82eba1c

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-4949.txt

@@ -93,3 +93,6 @@ HDFS-4949 (Unreleased)
 
     HDFS-5348. Fix error message when dfs.datanode.max.locked.memory is
     improperly configured. (Colin Patrick McCabe)
+
+    HDFS-5373. hdfs cacheadmin -addDirective short usage does not mention
+    -replication parameter. (cnauroth)

+ 2 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java

@@ -131,7 +131,8 @@ public class CacheAdmin extends Configured implements Tool {
 
     @Override
     public String getShortUsage() {
-      return "[" + getName() + " -path <path> -pool <pool-name>]\n";
+      return "[" + getName() +
+          " -path <path> -replication <replication> -pool <pool-name>]\n";
     }
 
     @Override

+ 6 - 1
hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testCacheAdminConf.xml

@@ -167,6 +167,7 @@
         <cache-admin-command>-addPool pool1</cache-admin-command>
         <cache-admin-command>-addDirective -path /foo -pool pool1</cache-admin-command>
         <cache-admin-command>-addDirective -path /bar -pool pool1</cache-admin-command>
+        <cache-admin-command>-addDirective -path /baz -replication 2 -pool pool1</cache-admin-command>
         <cache-admin-command>-listDirectives -pool pool1</cache-admin-command>
       </test-commands>
       <cleanup-commands>
@@ -175,7 +176,7 @@
       <comparators>
         <comparator>
           <type>SubstringComparator</type>
-          <expected-output>Found 2 entries</expected-output>
+          <expected-output>Found 3 entries</expected-output>
         </comparator>
         <comparator>
           <type>SubstringComparator</type>
@@ -185,6 +186,10 @@
           <type>SubstringComparator</type>
           <expected-output>2   pool1  /bar</expected-output>
         </comparator>
+        <comparator>
+          <type>SubstringComparator</type>
+          <expected-output>3   pool1  /baz</expected-output>
+        </comparator>
       </comparators>
     </test>