From 4203bc738c11aaf083b6d407c6d6b7f4f22fe0d3 Mon Sep 17 00:00:00 2001 From: Vinayakumar B Date: Wed, 8 Aug 2018 12:42:20 +0530 Subject: [PATCH] HDFS-13785. EC: 'removePolicy' is not working for built-in/system Erasure Code policies. Contributed by Ayush Saxena --- .../org/apache/hadoop/hdfs/tools/ECAdmin.java | 4 ++-- .../src/site/markdown/HDFSErasureCoding.md | 4 ++-- .../test/resources/testErasureCodingConf.xml | 22 ++++++++++++++++++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/ECAdmin.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/ECAdmin.java index 9b9fe14e46..56706b279f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/ECAdmin.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/ECAdmin.java @@ -154,7 +154,7 @@ public String getLongUsage() { listing.addRow("", "The path of the xml file which defines the EC policies to add"); return getShortUsage() + "\n" + - "Add a list of erasure coding policies.\n" + + "Add a list of user defined erasure coding policies.\n" + listing.toString(); } @@ -268,7 +268,7 @@ public String getLongUsage() { TableListing listing = AdminHelper.getOptionDescriptionListing(); listing.addRow("", "The name of the erasure coding policy"); return getShortUsage() + "\n" + - "Remove an erasure coding policy.\n" + + "Remove an user defined erasure coding policy.\n" + listing.toString(); } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSErasureCoding.md b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSErasureCoding.md index 60fd3abf18..6ae20862d5 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSErasureCoding.md +++ b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSErasureCoding.md @@ -203,7 +203,7 @@ Below are the details about each command. * `[-addPolicies -policyFile ]` - Add a list of erasure coding policies. Please refer etc/hadoop/user_ec_policies.xml.template for the example policy file. The maximum cell size is defined in property 'dfs.namenode.ec.policies.max.cellsize' with the default value 4MB. Currently HDFS allows the user to add 64 policies in total, and the added policy ID is in range of 64 to 127. Adding policy will fail if there are already 64 policies added. + Add a list of user defined erasure coding policies. Please refer etc/hadoop/user_ec_policies.xml.template for the example policy file. The maximum cell size is defined in property 'dfs.namenode.ec.policies.max.cellsize' with the default value 4MB. Currently HDFS allows the user to add 64 policies in total, and the added policy ID is in range of 64 to 127. Adding policy will fail if there are already 64 policies added. * `[-listCodecs]` @@ -211,7 +211,7 @@ Below are the details about each command. * `[-removePolicy -policy ]` - Remove an erasure coding policy. + Remove an user defined erasure coding policy. * `[-enablePolicy -policy ]` diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testErasureCodingConf.xml b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testErasureCodingConf.xml index 2f7a6a7fde..9070367924 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testErasureCodingConf.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testErasureCodingConf.xml @@ -154,7 +154,7 @@ SubstringComparator - Add a list of erasure coding policies + Add a list of user defined erasure coding policies SubstringComparator @@ -163,6 +163,26 @@ + + help: removePolicy command + + -fs NAMENODE -help removePolicy + + + + + + + SubstringComparator + Remove an user defined erasure coding policy + + + SubstringComparator + [-removePolicy -policy <policy>] + + + + help: enablePolicy command