[ 
https://issues.apache.org/jira/browse/HDFS-14113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16708483#comment-16708483
 ] 

Vinayakumar B commented on HDFS-14113:
--------------------------------------


Thanks [~ayushtkn] for the patch.
Please find the comments below.
{code}
+
+    userDefinedAllowed = conf.getBoolean(
+        DFSConfigKeys.DFS_NAMENODE_EC_POLICIES_USSERPOLICIES_ALLOWED_KEY,
+        DFSConfigKeys.
+            DFS_NAMENODE_EC_POLICIES_USSERPOLICIES_ALLOWED_KEY_DEFAULT);
   }
{code}
Please correct the Typo.

{code}
   public synchronized ErasureCodingPolicy addPolicy(
       ErasureCodingPolicy policy) {
+    if (!userDefinedAllowed) {
+      throw new HadoopIllegalArgumentException(
+          "Addition of user defined erasure coding policy is disabled.");
+    }
+
{code}
Instead of throwing {{HadoopIllegalArgumentException}}, can throw 
{{UnsuportedOperationException}} with proper message.

> EC : Add Configuration to restrict UserDefined Policies
> -------------------------------------------------------
>
>                 Key: HDFS-14113
>                 URL: https://issues.apache.org/jira/browse/HDFS-14113
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: erasure-coding
>            Reporter: Ayush Saxena
>            Assignee: Ayush Saxena
>            Priority: Major
>         Attachments: HDFS-14113-01.patch, HDFS-14113-02.patch
>
>
> By default addition of erasure coding policies is enabled for users.We need 
> to add configuration whether to allow addition of new User Defined policies 
> or not.Which can be configured in for of a Boolean value at the server side.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to