Class OptionValidator

java.lang.Object
org.apache.drill.exec.server.options.OptionValidator
Direct Known Subclasses:
TypeValidators.TypeValidator

public abstract class OptionValidator extends Object
Validates the values provided to Drill options.
  • Constructor Details

  • Method Details

    • getOptionName

      public String getOptionName()
      Gets the name of the option for this validator.
      Returns:
      the option name
    • getOptionDescription

      public OptionValidator.OptionDescription getOptionDescription()
      Get the option description (long and short)
      Returns:
      the description
    • isShortLived

      public boolean isShortLived()
      This function returns true if and only if this validator is meant for a short-lived option. NOTE: By default, options are not short-lived. So, if a derived class is meant for a short-lived option, that class must do two things: (1) override this method to return true, and (2) return the number of queries for which the option is valid through getTtl(). E.g. ExecutionControls.ControlsOptionValidator
      Returns:
      if this validator is for a short-lived option
    • getTtl

      public int getTtl()
      If an option is short-lived, this method returns the number of queries for which the option is valid. Please read the note at isShortLived()
      Returns:
      number of queries for which the option should be valid
    • validate

      public abstract void validate(OptionValue value, OptionMetaData optionMetaData, OptionSet manager)
      Validates the option value.
      Parameters:
      value - the value to validate
      manager - the manager for accessing validation dependencies (options)
      Throws:
      UserException - message to describe error with value, including range or list of expected values
    • getKind

      public abstract OptionValue.Kind getKind()
      Gets the kind of this option value for this validator.
      Returns:
      kind of this option value
    • getConfigProperty

      public String getConfigProperty()