Package org.apache.drill.exec.testing
Class ExecutionControls.ControlsOptionValidator
java.lang.Object
org.apache.drill.exec.server.options.OptionValidator
org.apache.drill.exec.server.options.TypeValidators.TypeValidator
org.apache.drill.exec.testing.ExecutionControls.ControlsOptionValidator
- Enclosing class:
- ExecutionControls
The JSON specified for the
ExecConstants.DRILLBIT_CONTROL_INJECTIONS
option is validated using this class. Controls are short-lived options.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.drill.exec.server.options.OptionValidator
OptionValidator.OptionDescription
-
Constructor Summary
ConstructorDescriptionControlsOptionValidator
(String name, int ttl, OptionValidator.OptionDescription description) Constructor for controls option validator. -
Method Summary
Modifier and TypeMethodDescriptionint
getTtl()
If an option is short-lived, this method returns the number of queries for which the option is valid.boolean
This function returns true if and only if this validator is meant for a short-lived option.void
validate
(OptionValue v, OptionMetaData metaData, OptionSet manager) Validates the option value.Methods inherited from class org.apache.drill.exec.server.options.TypeValidators.TypeValidator
getConfigProperty, getKind
Methods inherited from class org.apache.drill.exec.server.options.OptionValidator
getOptionDescription, getOptionName
-
Constructor Details
-
ControlsOptionValidator
Constructor for controls option validator.- Parameters:
name
- the name of the validatorttl
- the number of queries for which this option should be validdescription
- 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 atOptionValidator.isShortLived()
- Overrides:
getTtl
in classOptionValidator
- 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 throughOptionValidator.getTtl()
. E.g.ExecutionControls.ControlsOptionValidator
- Overrides:
isShortLived
in classOptionValidator
- Returns:
- if this validator is for a short-lived option
-
validate
Description copied from class:OptionValidator
Validates the option value.- Overrides:
validate
in classTypeValidators.TypeValidator
- Parameters:
v
- the value to validatemanager
- the manager for accessing validation dependencies (options)
-