Class ExecutionControls.ControlsOptionValidator

Enclosing class:
ExecutionControls

public static class ExecutionControls.ControlsOptionValidator extends TypeValidators.TypeValidator
The JSON specified for the ExecConstants.DRILLBIT_CONTROL_INJECTIONS option is validated using this class. Controls are short-lived options.
  • Constructor Details

    • ControlsOptionValidator

      public ControlsOptionValidator(String name, int ttl, OptionValidator.OptionDescription description)
      Constructor for controls option validator.
      Parameters:
      name - the name of the validator
      ttl - the number of queries for which this option should be valid
      description - Description of the option
  • Method Details

    • getTtl

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

      public boolean isShortLived()
      Description copied from class: OptionValidator
      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 OptionValidator.getTtl(). E.g. ExecutionControls.ControlsOptionValidator
      Overrides:
      isShortLived in class OptionValidator
      Returns:
      if this validator is for a short-lived option
    • validate

      public void validate(OptionValue v, OptionMetaData metaData, OptionSet manager)
      Description copied from class: OptionValidator
      Validates the option value.
      Overrides:
      validate in class TypeValidators.TypeValidator
      Parameters:
      v - the value to validate
      manager - the manager for accessing validation dependencies (options)