Class QueryEvaluationHint
java.lang.Object
tools.refinery.interpreter.matchers.backend.QueryEvaluationHint
Provides Refinery Interpreter with additional hints on how a query should be evaluated. The same hint can be provided
to multiple queries.
This class is immutable. Overriding options will create a new instance.
Here be dragons: for advanced users only.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionQueryEvaluationHint
(Map<QueryHintOption<?>, Object> backendHintSettings, IQueryBackendFactory queryBackendFactory) Specifies the suggested query backend, and value settings for additional backend-specific options.QueryEvaluationHint
(Map<QueryHintOption<?>, Object> backendHintSettings, QueryEvaluationHint.BackendRequirement backendRequirementType) Specifies the suggested query backend requirements, and value settings for additional backend-specific options. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Map
<QueryHintOption<?>, Object> Each entry in the immutable map overrides backend-specific options regarding query evaluation.A suggestion for choosing the query evaluator algorithm.Returns the backend requirement described by this hint.<HintValue>
HintValuegetValueOrDefault
(QueryHintOption<HintValue> option) Returns the value of the given hint option from the given hint collection, or the default value if not defined.<HintValue>
HintValuegetValueOrNull
(QueryHintOption<HintValue> option) Returns the value of the given hint option from the given hint collection, or null if not defined.int
hashCode()
boolean
isOptionOverridden
(QueryHintOption<?> option) Returns whether the given hint option is overridden.overrideBy
(QueryEvaluationHint overridingHint) Override values in this hint and return a consolidated instance.toString()
-
Constructor Details
-
QueryEvaluationHint
public QueryEvaluationHint(Map<QueryHintOption<?>, Object> backendHintSettings, QueryEvaluationHint.BackendRequirement backendRequirementType) Specifies the suggested query backend requirements, and value settings for additional backend-specific options.The backend requirement type must not be
QueryEvaluationHint.BackendRequirement.SPECIFIC
- for that case, use the constructorQueryEvaluationHint(Map, IQueryBackendFactory)
.- Parameters:
backendHintSettings
- if non-null, each entry in the map overrides backend-specific options regarding query evaluation (null-valued map entries permitted to erase hints); passing null means default options associated with the querybackendRequirementType
- defines the kind of backend requirement- Since:
- 2.0
-
QueryEvaluationHint
public QueryEvaluationHint(Map<QueryHintOption<?>, Object> backendHintSettings, IQueryBackendFactory queryBackendFactory) Specifies the suggested query backend, and value settings for additional backend-specific options. The first parameter can be null; if the second parameter is null, it is expected that the other constructor is called instead with aQueryEvaluationHint.BackendRequirement.UNSPECIFIED
parameter.- Parameters:
backendHintSettings
- if non-null, each entry in the map overrides backend-specific options regarding query evaluation (null-valued map entries permitted to erase hints); passing null means default options associated with the queryqueryBackendFactory
- overrides the query evaluator algorithm; passing null retains the default algorithm associated with the query- Since:
- 1.5
-
-
Method Details
-
getQueryBackendRequirementType
Returns the backend requirement described by this hint. If a specific backend is required, that can be queried bygetQueryBackendFactory()
.- Since:
- 2.0
-
getQueryBackendFactory
A suggestion for choosing the query evaluator algorithm.Returns null iff
getQueryBackendRequirementType()
does not returnQueryEvaluationHint.BackendRequirement.SPECIFIC
; in such cases a corresponding default backend is selected inside the engine -
getBackendHintSettings
Each entry in the immutable map overrides backend-specific options regarding query evaluation.The map is non-null, even if empty. Null-valued map entries are also permitted to erase hints via
overrideBy(QueryEvaluationHint)
.- Since:
- 1.5
-
overrideBy
Override values in this hint and return a consolidated instance.- Since:
- 1.4
-
isOptionOverridden
Returns whether the given hint option is overridden.- Since:
- 1.5
-
getValueOrNull
Returns the value of the given hint option from the given hint collection, or null if not defined.- Since:
- 1.5
-
getValueOrDefault
Returns the value of the given hint option from the given hint collection, or the default value if not defined. Intended to be called by backends to find out the definitive value that should be considered.- Since:
- 1.5
-
hashCode
public int hashCode() -
equals
-
toString
-