Class OptionValidator
java.lang.Object
org.apache.drill.exec.server.options.OptionValidator
- Direct Known Subclasses:
TypeValidators.TypeValidator
Validates the values provided to Drill options.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionOptionValidator
(String optionName, OptionValidator.OptionDescription description) By default, if admin option value is not specified, it would be set to false. -
Method Summary
Modifier and TypeMethodDescriptionabstract OptionValue.Kind
getKind()
Gets the kind of this option value for this validator.Get the option description (long and short)Gets the name of the option for this validator.int
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.abstract void
validate
(OptionValue value, OptionMetaData optionMetaData, OptionSet manager) Validates the option value.
-
Constructor Details
-
OptionValidator
By default, if admin option value is not specified, it would be set to false.
-
-
Method Details
-
getOptionName
Gets the name of the option for this validator.- Returns:
- the option name
-
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 throughgetTtl()
. 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 atisShortLived()
- Returns:
- number of queries for which the option should be valid
-
validate
Validates the option value.- Parameters:
value
- the value to validatemanager
- the manager for accessing validation dependencies (options)- Throws:
UserException
- message to describe error with value, including range or list of expected values
-
getKind
Gets the kind of this option value for this validator.- Returns:
- kind of this option value
-
getConfigProperty
-