kuczoram commented on code in PR #6928:
URL: https://github.com/apache/hive/pull/6928#discussion_r4437640960
##########
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:
Do you mean calling this method (HiveConfUtil.getRestrictedSet) in
HiveConf.setupRestrictedList so we can avoid code duplication or using the
HiveConf.setupRestrictedList instead of this one?
The problem with using the HiveConf.setupRestrictedList is that it is only
for HiveConf, but in MRCompactor we have JobConf, and we need the restricted
list there as well.
--
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]