drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansinha100 <...@git.apache.org>
Subject [GitHub] drill pull request #534: [DRILL-4743] HashJoin's not fully parallelized in q...
Date Tue, 19 Jul 2016 21:09:40 GMT
Github user amansinha100 commented on a diff in the pull request:

    https://github.com/apache/drill/pull/534#discussion_r71424000
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/server/options/TypeValidators.java
---
    @@ -90,6 +91,62 @@ public void validate(OptionValue v) {
         }
       }
     
    +  public static class MinRangeDoubleValidator extends RangeDoubleValidator {
    +    private final double min;
    +    private final double max;
    +    private final String maxValidatorName;
    +
    +    public MinRangeDoubleValidator(String name, double min, double max, double def, String
maxValidatorName) {
    +      super(name, min, max, def);
    +      this.min = min;
    +      this.max = max;
    +      this.maxValidatorName = maxValidatorName;
    +    }
    +
    +    @Override
    +    public void validate(OptionValue v, final OptionManager manager) {
    +      super.validate(v, manager);
    +      if (manager != null) {
    +        OptionValue maxValue = manager.getOption(maxValidatorName);
    +
    +        if (v.float_val > maxValue.float_val) {
    +          throw UserException.validationError()
    +                  .message(String.format("Option %s must be less than or equal to Option
%s",
    +                          getOptionName(), maxValidatorName))
    +                  .build(logger);
    +        }
    +      }
    +    }
    +  }
    +
    +  public static class MaxRangeDoubleValidator extends RangeDoubleValidator {
    +    private final double min;
    +    private final double max;
    +    private final String minValidatorName;
    +
    +    public MaxRangeDoubleValidator(String name, double min, double max, double def, String
minValidatorName) {
    +      super(name, min, max, def);
    +      this.min = min;
    +      this.max = max;
    +      this.minValidatorName = minValidatorName;
    +    }
    +
    +    @Override
    +    public void validate(OptionValue v, final OptionManager manager) {
    --- End diff --
    
    you could make the 1st argument final too since it is read-only. 


---
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