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
ConstructorsConstructorDescriptionControlsOptionValidator(String name, int ttl, OptionValidator.OptionDescription description) Constructor for controls option validator. -
Method Summary
Modifier and TypeMethodDescriptionintgetTtl()If an option is short-lived, this method returns the number of queries for which the option is valid.booleanThis function returns true if and only if this validator is meant for a short-lived option.voidvalidate(OptionValue v, OptionMetaData metaData, OptionSet manager) Validates the option value.Methods inherited from class org.apache.drill.exec.server.options.TypeValidators.TypeValidator
getConfigProperty, getKindMethods 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:OptionValidatorIf 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:
getTtlin classOptionValidator- Returns:
- number of queries for which the option should be valid
-
isShortLived
public boolean isShortLived()Description copied from class:OptionValidatorThis 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:
isShortLivedin classOptionValidator- Returns:
- if this validator is for a short-lived option
-
validate
Description copied from class:OptionValidatorValidates the option value.- Overrides:
validatein classTypeValidators.TypeValidator- Parameters:
v- the value to validatemanager- the manager for accessing validation dependencies (options)
-