bharatviswa504 commented on a change in pull request #930: HDDS-1651. Create a 
http.policy config for Ozone
URL: https://github.com/apache/hadoop/pull/930#discussion_r293660938
 
 

 ##########
 File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsUtils.java
 ##########
 @@ -426,6 +430,20 @@ public static long getUtcTime() {
     return Calendar.getInstance(UTC_ZONE).getTimeInMillis();
   }
 
+  public static Policy getHttpPolicy(Configuration conf) {
+    String policyStr = conf.get("ozone.http.policy", 
OzoneConfigKeys.OZONE_HTTP_POLICY);
+    if(policyStr == null || policyStr.length() == 0) {
+      policyStr = conf.get("dfs.http.policy", 
DFSConfigKeys.DFS_HTTP_POLICY_DEFAULT);
+    }
+    Policy policy = Policy.fromString(policyStr);
+    if (policy == null) {
+      throw new HadoopIllegalArgumentException("Unrecognized value '" + 
policyStr + "' for " + "dfs.http.policy");
+    } else {
+      conf.set("dfs.http.policy", policy.name());
 
 Review comment:
   Why do we need to set it back?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to