From 77afc605fd30accef9ac6059e26879d971f013b0 Mon Sep 17 00:00:00 2001 From: Colin McCabe Date: Thu, 7 Nov 2013 19:58:52 +0000 Subject: [PATCH] HDFS-5468. CacheAdmin help command does not recognize commands (Stephen Chu via Colin Patrick McCabe) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1539786 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/hdfs/tools/CacheAdmin.java | 5 ++--- .../src/test/resources/testCacheAdminConf.xml | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 8d453757ea..96c3b333db 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -354,6 +354,9 @@ Trunk (Unreleased) HDFS-5419. Fixup test-patch.sh warnings on HDFS-4949 branch. (wang) + HDFS-5468. CacheAdmin help command does not recognize commands (Stephen + Chu via Colin Patrick McCabe) + Release 2.3.0 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java index 40af431f4b..19855a5494 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java @@ -261,13 +261,13 @@ public String getName() { @Override public String getShortUsage() { - return "[" + getName() + " ]\n"; + return "[" + getName() + " -path ]\n"; } @Override public String getLongUsage() { TableListing listing = getOptionDescriptionListing(); - listing.addRow("", "The path of the cache directives to remove. " + + listing.addRow("-path ", "The path of the cache directives to remove. " + "You must have write permission on the pool of the directive in order " + "to remove it. To see a list of cache directives, use the " + "-listDirectives command."); @@ -720,7 +720,6 @@ public int run(Configuration conf, List args) throws IOException { return 0; } String commandName = args.get(0); - commandName = commandName.replaceAll("^[-]*", ""); Command command = determineCommand(commandName); if (command == null) { System.err.print("Sorry, I don't know the command '" + diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testCacheAdminConf.xml b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testCacheAdminConf.xml index b3edc17256..8d389b4b74 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testCacheAdminConf.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testCacheAdminConf.xml @@ -358,5 +358,20 @@ + + Testing the help usage + + -help -addPool + + + + + + SubstringComparator + Add a new cache pool. + + + +