HDFS-9097. Erasure coding: update EC command "-s" flag to "-p" when specifying policy. Contributed by Zhe Zhang.

Change-Id: I82919e55c4a0d8646d25a53aac757098a56b3029
This commit is contained in:
Zhe Zhang 2015-09-17 14:52:37 -07:00
parent e36129b61a
commit 607bda2a21
4 changed files with 15 additions and 12 deletions

View File

@ -429,3 +429,6 @@
(Rakesh R via zhz)
HDFS-9088. Cleanup erasure coding documentation. (wang via zhz)
HDFS-9097. Erasure coding: update EC command "-s" flag to "-p" when
specifying policy. (zhz)

View File

@ -80,11 +80,11 @@ protected void processPath(PathData item) throws IOException {
*/
static class SetECPolicyCommand extends ECCommand {
public static final String NAME = "setPolicy";
public static final String USAGE = "[-s <policyName>] <path>";
public static final String USAGE = "[-p <policyName>] <path>";
public static final String DESCRIPTION =
"Set a specified erasure coding policy to a directory\n"
+ "Options :\n"
+ " -s <policyName> : erasure coding policy name to encode files. "
+ " -p <policyName> : erasure coding policy name to encode files. "
+ "If not passed the default policy will be used\n"
+ " <path> : Path to a directory. Under this directory "
+ "files will be encoded using specified erasure coding policy";
@ -93,7 +93,7 @@ static class SetECPolicyCommand extends ECCommand {
@Override
protected void processOptions(LinkedList<String> args) throws IOException {
ecPolicyName = StringUtils.popOptionWithArgument("-s", args);
ecPolicyName = StringUtils.popOptionWithArgument("-p", args);
if (args.isEmpty()) {
throw new HadoopIllegalArgumentException("<path> is missing");
}

View File

@ -110,7 +110,7 @@ Deployment
HDFS provides an `erasurecode` subcommand to perform administrative commands related to erasure coding.
hdfs erasurecode [generic options]
[-setPolicy [-s <policyName>] <path>]
[-setPolicy [-p <policyName>] <path>]
[-getPolicy <path>]
[-listPolicies]
[-usage [cmd ...]]
@ -118,7 +118,7 @@ Deployment
Below are the details about each command.
* `[-setPolicy [-s <policyName>] <path>]`
* `[-setPolicy [-p <policyName>] <path>]`
Sets an ErasureCoding policy on a directory at the specified path.

View File

@ -61,7 +61,7 @@
</comparator>
<comparator>
<type>RegexpComparator</type>
<expected-output>^-setPolicy \[-s &lt;policyName&gt;\] &lt;path&gt;(.)*</expected-output>
<expected-output>^-setPolicy \[-p &lt;policyName&gt;\] &lt;path&gt;(.)*</expected-output>
</comparator>
</comparators>
</test>
@ -109,7 +109,7 @@
<description>setPolicy : set erasure coding policy on a directory to encode files</description>
<test-commands>
<command>-fs NAMENODE -mkdir /ecdir</command>
<ec-admin-command>-fs NAMENODE -setPolicy -s RS-6-3-64k /ecdir</ec-admin-command>
<ec-admin-command>-fs NAMENODE -setPolicy -p RS-6-3-64k /ecdir</ec-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rmdir /ecdir</command>
@ -179,7 +179,7 @@
<description>getPolicy : get EC policy information at specified path, which doesn't have an EC policy</description>
<test-commands>
<command>-fs NAMENODE -mkdir /ecdir</command>
<ec-admin-command>-fs NAMENODE -setPolicy -s RS-6-3-64k /ecdir</ec-admin-command>
<ec-admin-command>-fs NAMENODE -setPolicy -p RS-6-3-64k /ecdir</ec-admin-command>
<ec-admin-command>-fs NAMENODE -getPolicy /ecdir</ec-admin-command>
</test-commands>
<cleanup-commands>
@ -197,7 +197,7 @@
<description>getPolicy : get EC policy information at specified path, which doesn't have an EC policy</description>
<test-commands>
<command>-fs NAMENODE -mkdir /ecdir</command>
<ec-admin-command>-fs NAMENODE -setPolicy -s RS-6-3-64k /ecdir</ec-admin-command>
<ec-admin-command>-fs NAMENODE -setPolicy -p RS-6-3-64k /ecdir</ec-admin-command>
<command>-fs NAMENODE -touchz /ecdir/ecfile</command>
<ec-admin-command>-fs NAMENODE -getPolicy /ecdir/ecfile</ec-admin-command>
</test-commands>
@ -250,7 +250,7 @@
<description>setPolicy : illegal parameters - policy name is missing</description>
<test-commands>
<command>-fs NAMENODE -mkdir /ecdir</command>
<ec-admin-command>-fs NAMENODE -setPolicy -s</ec-admin-command>
<ec-admin-command>-fs NAMENODE -setPolicy -p</ec-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rmdir /ecdir</command>
@ -258,7 +258,7 @@
<comparators>
<comparator>
<type>RegexpComparator</type>
<expected-output>^-setPolicy: option -s requires 1 argument(.)*</expected-output>
<expected-output>^-setPolicy: option -p requires 1 argument(.)*</expected-output>
</comparator>
</comparators>
</test>
@ -284,7 +284,7 @@
<description>setPolicy : illegal parameters - invalidpolicy</description>
<test-commands>
<command>-fs NAMENODE -mkdir /ecdir</command>
<ec-admin-command>-fs NAMENODE -setPolicy -s invalidpolicy /ecdir</ec-admin-command>
<ec-admin-command>-fs NAMENODE -setPolicy -p invalidpolicy /ecdir</ec-admin-command>
</test-commands>
<cleanup-commands>
<command>-fs NAMENODE -rmdir /ecdir</command>