Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/923#discussion_r136656530
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/server/options/SystemOptionManager.java
---
@@ -70,11 +69,13 @@
* </p>
*/
-public class SystemOptionManager extends BaseOptionManager implements
OptionManager, AutoCloseable {
+public class SystemOptionManager extends BaseOptionManager implements
AutoCloseable {
private static final org.slf4j.Logger logger =
org.slf4j.LoggerFactory.getLogger(SystemOptionManager.class);
- private CaseInsensitiveMap<OptionValidator> VALIDATORS;
- public void populateValidators() {
+ public static final CaseInsensitiveMap<OptionValidator>
DEFAULT_VALIDATORS =
--- End diff --
This change reverses a change made by Jyothsna. While it seems reasonable
to create a static table of validators, there is a subtle problem which
Jyothsna's fix addressed.
Under normal operation, we have exactly one Drillbit per process and thus
exactly one system option manager.
But, we have unit tests that create multiple Drillbits per process. This is
the most convenient way to test concurrency issues in unit tests. In general,
each Drillbit could define a different default value for the system/session
option; perhaps to check forward/backward compatibility when the time comes to
support rolling upgrades.
In this model, each Drillbit will have a slightly different set of
defaults. Thus, the option validator table must be a member variable of the
system option manager; it cannot be global.
Note also, in the existing tests with multiple Drillbits, a global table
runs into a race condition during reading defaults from the config file if we
use a single table. But, if we have a separate table per Drillbit, the race
condition disappears.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---