You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-commits@hadoop.apache.org by cm...@apache.org on 2013/11/26 22:38:46 UTC

svn commit: r1545850 - in /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java src/test/resources/testCacheAdminConf.xml

Author: cmccabe
Date: Tue Nov 26 21:38:46 2013
New Revision: 1545850

URL: http://svn.apache.org/r1545850
Log:
HDFS-5565. CacheAdmin help should match against non-dashed commands (wang via cmccabe)

Modified:
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testCacheAdminConf.xml

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1545850&r1=1545849&r2=1545850&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Tue Nov 26 21:38:46 2013
@@ -405,6 +405,9 @@ Trunk (Unreleased)
     HDFS-5543. Fix narrow race condition in TestPathBasedCacheRequests
     (cmccabe)
 
+    HDFS-5565. CacheAdmin help should match against non-dashed commands
+    (wang via cmccabe)
+
 Release 2.3.0 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java?rev=1545850&r1=1545849&r2=1545850&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java Tue Nov 26 21:38:46 2013
@@ -822,14 +822,15 @@ public class CacheAdmin extends Configur
         return 0;
       }
       String commandName = args.get(0);
-      Command command = determineCommand(commandName);
+      // prepend a dash to match against the command names
+      Command command = determineCommand("-"+commandName);
       if (command == null) {
         System.err.print("Sorry, I don't know the command '" +
           commandName + "'.\n");
-        System.err.print("Valid command names are:\n");
+        System.err.print("Valid help command names are:\n");
         String separator = "";
         for (Command c : COMMANDS) {
-          System.err.print(separator + c.getName());
+          System.err.print(separator + c.getName().substring(1));
           separator = ", ";
         }
         System.err.print("\n");

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testCacheAdminConf.xml
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testCacheAdminConf.xml?rev=1545850&r1=1545849&r2=1545850&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testCacheAdminConf.xml (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testCacheAdminConf.xml Tue Nov 26 21:38:46 2013
@@ -387,7 +387,7 @@
     <test>
       <description>Testing the help usage</description>
       <test-commands>
-        <cache-admin-command>-help -addPool</cache-admin-command>
+        <cache-admin-command>-help addPool</cache-admin-command>
       </test-commands>
       <cleanup-commands>
       </cleanup-commands>