okumin commented on code in PR #6928:
URL: https://github.com/apache/hive/pull/6928#discussion_r4442258304


##########
common/src/java/org/apache/hadoop/hive/conf/HiveConfUtil.java:
##########
@@ -97,6 +97,40 @@ public static Set<String> getHiddenSet(Configuration 
configuration) {
     return hiddenSet;
   }
 
+  /**
+   * Getting the set of the configurations which are immutable at runtime. 
Unlike
+   * {@link HiveConf#verifyAndSet(String, String)}, this works on any {@link 
Configuration} and not
+   * only on a {@link HiveConf}, which makes it usable on a JobConf.
+   * @param configuration The original configuration
+   * @return The list of the configuration prefixes which must not be modified 
at runtime
+   */
+  public static Set<String> getRestrictedSet(Configuration configuration) {
+    Set<String> restrictedSet = new HashSet<String>();
+    String restrictedListStr = HiveConf.getVar(configuration, 
HiveConf.ConfVars.HIVE_CONF_RESTRICTED_LIST);
+    if (restrictedListStr != null) {
+      for (String entry : restrictedListStr.split(",")) {
+        restrictedSet.add(entry.trim());
+      }
+    }
+
+    String internalVariableListStr = HiveConf.getVar(configuration, 
ConfVars.HIVE_CONF_INTERNAL_VARIABLE_LIST);
+    if (internalVariableListStr != null) {
+      for (String entry : internalVariableListStr.split(",")) {
+        restrictedSet.add(entry.trim());
+      }
+    }
+
+    restrictedSet.add(ConfVars.HIVE_IN_TEST.varname);
+    restrictedSet.add(ConfVars.HIVE_CONF_RESTRICTED_LIST.varname);
+    restrictedSet.add(ConfVars.HIVE_CONF_HIDDEN_LIST.varname);
+    restrictedSet.add(ConfVars.HIVE_CONF_INTERNAL_VARIABLE_LIST.varname);
+    restrictedSet.add(ConfVars.HIVE_CONF_LOCKED_LIST.varname);
+    restrictedSet.add(ConfVars.HIVE_COMPACTOR_CONF_ALLOWLIST.varname);
+    restrictedSet.add(ConfVars.HIVE_COMPACTOR_CONF_ALLOWLIST_APPEND.varname);
+    restrictedSet.add(ConfVars.HIVE_COMPACTOR_CONF_DENYLIST.varname);
+    return restrictedSet;
+  }

Review Comment:
   Semantically, I'd say the set of parameters needs to be synchronized. 
Otherwise, the term "restricted" becomes ambiguous in our domain. If the new 
method's semantics were not identical to the existing restricted list, we would 
be able to give another name to the new one.
   Regarding the implementation, I originally though we can just 
`restrictList.addAll(HiveConfUti.getRestrictedSet(this)`, but I could be wrong. 
I am checking out this branch and verifying that point.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to