drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paul-rogers <...@git.apache.org>
Subject [GitHub] drill pull request #868: DRILL-5547:Linking config options with system optio...
Date Tue, 11 Jul 2017 23:54:49 GMT
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/868#discussion_r126834151
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/server/options/SystemOptionManager.java
---
    @@ -314,6 +370,31 @@ public void deleteAllOptions(OptionType type) {
         }
       }
     
    +  public void populateDefualtValues(Map<String, OptionValidator> VALIDATORS) {
    +
    +    // populate the options from the config
    +    final Map<String, OptionValidator> tmp = new HashMap<>();
    +    for (final Map.Entry<String, OptionValidator> entry : VALIDATORS.entrySet())
{
    +
    +      OptionValidator validator = entry.getValue();
    +      final OptionValue.Kind kind = validator.getKind();
    +      String name = entry.getValue().getOptionName();
    +      OptionValue value;
    +      String configPath = "drill.exec.options.";
    +      String configName = configPath + name;
    +      try {
    +        value = validator.loadConfigDefault(bootConfig,name,configPath);
    +        validator.setDefaultValue(value);
    +        tmp.put(name, validator);
    +      } catch (ConfigException.Missing e) {
    +        logger.error(e.getMessage(), e);
    --- End diff --
    
    Seems we'd want to throw a fatal exception here, such as `IllegalStateException` because
this indicates, to the developers, that the developer forgot to externalize the config default
when they created the validator.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message