From 8c6ae0d6199efa327d8f2761f2ad2163a60e5508 Mon Sep 17 00:00:00 2001 From: cnauroth Date: Fri, 20 Feb 2015 12:21:46 -0800 Subject: [PATCH] HDFS-7814. Fix usage string of storageType parameter for "dfsadmin -setSpaceQuota/clrSpaceQuota". Contributed by Xiaoyu Yao. --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java | 8 ++++---- .../hadoop-hdfs/src/test/resources/testHDFSConf.xml | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 71ce48fc96..7d9d0eaf9c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -995,6 +995,9 @@ Release 2.7.0 - UNRELEASED HDFS-7788. Post-2.6 namenode may not start up with an image containing inodes created with an old release. (Rushabh Shah via kihwal) + HDFS-7814. Fix usage string of storageType parameter for + "dfsadmin -setSpaceQuota/clrSpaceQuota". (Xiaoyu Yao via cnauroth) + BREAKDOWN OF HDFS-7584 SUBTASKS AND RELATED JIRAS HDFS-7720. Quota by Storage Type API, tools and ClientNameNode diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java index ae9088cd3e..6ba778f347 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java @@ -207,9 +207,9 @@ public void run(Path path) throws IOException { /** A class that supports command clearSpaceQuota */ private static class ClearSpaceQuotaCommand extends DFSAdminCommand { private static final String NAME = "clrSpaceQuota"; - private static final String USAGE = "-"+NAME+" ... -storageType "; + private static final String USAGE = "-"+NAME+" [-storageType ] ..."; private static final String DESCRIPTION = USAGE + ": " + - "Clear the disk space quota for each directory .\n" + + "Clear the space quota for each directory .\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\t2. user is not an administrator.\n" + @@ -259,9 +259,9 @@ public void run(Path path) throws IOException { private static class SetSpaceQuotaCommand extends DFSAdminCommand { private static final String NAME = "setSpaceQuota"; private static final String USAGE = - "-"+NAME+" ... -storageType "; + "-"+NAME+" [-storageType ] ..."; private static final String DESCRIPTION = USAGE + ": " + - "Set the disk space quota for each directory .\n" + + "Set the space quota for each directory .\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" + diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml index 935cd58c9f..2d3de1f99b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testHDFSConf.xml @@ -15711,7 +15711,7 @@ RegexpComparator - ^-setSpaceQuota <quota> <dirname>...<dirname> -storageType <storagetype>: Set the disk space quota <quota> for each directory <dirName>.( )* + ^-setSpaceQuota <quota> \[-storageType <storagetype>\] <dirname>...<dirname>: Set the space quota <quota> for each directory <dirName>.( )* RegexpComparator @@ -15746,7 +15746,7 @@ RegexpComparator - ^-clrSpaceQuota <dirname>...<dirname> -storageType <storagetype>: Clear the disk space quota for each directory <dirName>.( )* + ^-clrSpaceQuota \[-storageType <storagetype>\] <dirname>...<dirname>: Clear the space quota for each directory <dirName>.( )* RegexpComparator