HDFS-9937. Update dfsadmin command line help and HdfsQuotaAdminGuide. Contributed by Kai Sasaki.

(cherry picked from commit 25f0a9b3ab)
This commit is contained in:
Wei-Chiu Chuang 2016-07-26 08:00:32 -07:00
parent e5a4b6cb94
commit 0ee1644e39
2 changed files with 22 additions and 7 deletions

View File

@ -165,7 +165,7 @@ private static class SetQuotaCommand extends DFSAdminCommand {
private static final String NAME = "setQuota"; private static final String NAME = "setQuota";
private static final String USAGE = private static final String USAGE =
"-"+NAME+" <quota> <dirname>...<dirname>"; "-"+NAME+" <quota> <dirname>...<dirname>";
private static final String DESCRIPTION = private static final String DESCRIPTION =
"-setQuota <quota> <dirname>...<dirname>: " + "-setQuota <quota> <dirname>...<dirname>: " +
"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" +
@ -217,7 +217,13 @@ private static class ClearSpaceQuotaCommand extends DFSAdminCommand {
"\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.\n" + "\t\tIt does not fault if the directory has no quota.\n" +
"\t\tThe storage type specific quota is cleared when -storageType option is specified."; "\t\tThe storage type specific quota is cleared when -storageType option is specified." +
"\t\tAvailable storageTypes are \n" +
"\t\t- RAM_DISK\n" +
"\t\t- DISK\n" +
"\t\t- SSD\n" +
"\t\t- ARCHIVE";
private StorageType type; private StorageType type;
@ -275,7 +281,12 @@ private static class SetSpaceQuotaCommand extends DFSAdminCommand {
"\t\t1. quota is not a positive integer or zero, or\n" + "\t\t1. quota is not a positive integer or zero, 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.\n" + "\t\t3. the directory does not exist or is a file.\n" +
"\t\tThe storage type specific quota is set when -storageType option is specified.\n"; "\t\tThe storage type specific quota is set when -storageType option is specified.\n" +
"\t\tAvailable storageTypes are \n" +
"\t\t- RAM_DISK\n" +
"\t\t- DISK\n" +
"\t\t- SSD\n" +
"\t\t- ARCHIVE";
private long quota; // the quota to be set private long quota; // the quota to be set
private StorageType type; private StorageType type;
@ -570,7 +581,7 @@ public void report(String[] argv, int i) throws IOException {
/** /**
* Safe mode maintenance command. * Safe mode maintenance command.
* Usage: hdfs dfsadmin -safemode [enter | leave | get] * Usage: hdfs dfsadmin -safemode [enter | leave | get | wait | forceExit]
* @param argv List of of command line parameters. * @param argv List of of command line parameters.
* @param idx The index of the command that is being processed. * @param idx The index of the command that is being processed.
* @exception IOException if the filesystem does not exist. * @exception IOException if the filesystem does not exist.
@ -1778,7 +1789,8 @@ private static void printUsage(String cmd) {
+ " [-refreshCallQueue]"); + " [-refreshCallQueue]");
} else if ("-reconfig".equals(cmd)) { } else if ("-reconfig".equals(cmd)) {
System.err.println("Usage: hdfs dfsadmin" System.err.println("Usage: hdfs dfsadmin"
+ " [-reconfig <namenode|datanode> <host:port> <start|status>]"); + " [-reconfig <namenode|datanode> <host:port> "
+ "<start|status|properties>]");
} else if ("-refresh".equals(cmd)) { } else if ("-refresh".equals(cmd)) {
System.err.println("Usage: hdfs dfsadmin" System.err.println("Usage: hdfs dfsadmin"
+ " [-refresh <hostname:port> <resource_identifier> [arg1..argn]"); + " [-refresh <hostname:port> <resource_identifier> [arg1..argn]");

View File

@ -100,14 +100,17 @@ Quotas are managed by a set of commands available only to the administrator.
gigabytes and 2t for 2 terabytes etc. Best effort for each gigabytes and 2t for 2 terabytes etc. Best effort for each
directory, with faults reported if N is neither zero nor a positive directory, with faults reported if N is neither zero nor a positive
integer, the directory does not exist or it is a file, or the integer, the directory does not exist or it is a file, or the
directory would immediately exceed the new quota. directory would immediately exceed the new quota. The storage type
specific quota is set when -storageType option is specified. Available
storageTypes are RAM_DISK,DISK,SSD,ARCHIVE.
* `hdfs dfsadmin -clrSpaceQuota -storageType <storagetype> <directory>...<directory>` * `hdfs dfsadmin -clrSpaceQuota -storageType <storagetype> <directory>...<directory>`
Remove storage type quota specified for each directory. Best effort Remove storage type quota specified for each directory. Best effort
for each directory, with faults reported if the directory does not exist or for each directory, with faults reported if the directory does not exist or
it is a file. It is not a fault if the directory has no storage type quota on it is a file. It is not a fault if the directory has no storage type quota on
for storage type specified. for storage type specified. The storage type specific quota is cleared when -storageType
option is specified. Available storageTypes are RAM_DISK,DISK,SSD,ARCHIVE.
Reporting Command Reporting Command
----------------- -----------------