[
https://issues.apache.org/jira/browse/DRILL-5547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16083208#comment-16083208
]
ASF GitHub Bot commented on DRILL-5547:
---------------------------------------
Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/868#discussion_r126832436
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/server/options/SystemOptionManager.java
---
@@ -48,11 +50,46 @@
* Only one instance of this class exists per drillbit. Options set at the
system level affect the entire system and
* persist between restarts.
*/
+
+/**
+ * Drill has two different config systems each with its own
namespace.First being the HOCON based boot time config
+ * system.This is a hierarchical system where the top layers override the
bottom ones in the following order
+ *
+ * Java System Options
+ * distrib.conf
+ * drill-override.conf
+ * drill-module.conf
+ *
+ * These are the options that are set before the drill starts.But once
drill starts System or session options can be
+ * modified using ALTER SYSTEM/SESSION.Even this system provides
inheritance sytle in the following order
+
+ * Session options
+ * System options
+ * Hardcoded defaults
+
+ * But system/session options have a validator and the validator has a
hard coded default value for every option. In
--- End diff --
This description would be great as a comment for the pull request. Now,
image that this code is committed to Drill, and someone reads this a year from
now. By then, the comment will be describing ancient history.
We can see that this kind of comment should describe the system the way it
is (or will be) after this change without need to reference history. For those
who might be familiar with the old way, we often point them to the JIRA that
describes the change.
Example:
"Default for system properties are externalized to the boot-time config
file. See DRILL-5547. ..."
> Drill config options and session options do not work as intended
> ----------------------------------------------------------------
>
> Key: DRILL-5547
> URL: https://issues.apache.org/jira/browse/DRILL-5547
> Project: Apache Drill
> Issue Type: Bug
> Components: Server
> Affects Versions: 1.10.0
> Reporter: Karthikeyan Manivannan
> Assignee: Venkata Jyothsna Donapati
> Fix For: Future
>
>
> In Drill, session options should take precedence over config options. But
> several of these session options are assigned hard-coded default values when
> the option validators are initialized. Because of this config options will
> never be read and honored even if the user did not specify the session
> option.
> ClassCompilerSelector.JAVA_COMPILER_VALIDATOR uses CompilerPolicy.DEFAULT as
> the default value. This default value gets into the session options map via
> the initialization of validators in SystemOptionManager.
> Now any piece of code that tries to check if a session option is set will
> never see a null, so it will always use that value and never try to look into
> the config options. For example, in the following piece of code from
> ClassCompilerSelector (), the policy will never be read from the config file.
> policy = CompilerPolicy.valueOf((value != null) ?
> value.string_val.toUpperCase() :
> config.getString(JAVA_COMPILER_CONFIG).toUpperCase());
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)