okumin commented on code in PR #6928:
URL: https://github.com/apache/hive/pull/6928#discussion_r4442343873
##########
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:
I am wondering if we can implement it as follows,
```
private void setupRestrictList() {
restrictList.clear();
restrictList.addAll(HiveConfUtil.getRestrictedSet(this));
}
```
, similarly to the other ones.
https://github.com/apache/hive/blob/17b46d256a0866b2cf4fad20a54ac77bf9707b56/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java#L6651-L6655
--
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]