Package org.apache.jackrabbit.oak.query
Class QueryEngineSettings
java.lang.Object
org.apache.jackrabbit.oak.query.QueryEngineSettings
- All Implemented Interfaces:
QueryEngineSettingsMBean
,QueryLimits
Settings of the query engine.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
static final int
static final long
static final long
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
the flag used to turn on/off the optimisations on top of theorg.apache.jackrabbit.oak.query.Query
object.static final String
static final boolean
Fields inherited from interface org.apache.jackrabbit.oak.api.jmx.QueryEngineSettingsMBean
TYPE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the automatic query options mapping.boolean
Whether queries that don't use an index will fail (throw an exception).boolean
@NotNull String[]
Retrieve the java package names / full qualified class names which should be ignored when finding the class starting a queryboolean
See OAK-10532.long
Get the limit on how many nodes a query may read at most into memory, for "order by" and "distinct" queries.long
Get the limit on how many nodes a query may read at most (raw read operations, including skipped nodes).boolean
See OAK-11214.int
Get the prefetch count.long
long
Whether Path restrictions are enabled while figuring out index planboolean
Whether the query result size should return an estimation for large queries.boolean
Get whether the query engine will parse the query and infers inference configboolean
void
Change the automatic query options mapping.void
setFailTraversal
(boolean failTraversal) Set whether queries that don't use an index will fail (throw an exception).void
setFastQuerySize
(boolean fastQuerySize) void
setFullTextComparisonWithoutIndex
(boolean fullTextComparisonWithoutIndex) void
setIgnoredClassNamesInCallTrace
(@NotNull String[] packageNames) Set or remove java package/class names which are ignored from finding the invoking class for queries.void
setImprovedIsNullCostFeature
(@Nullable Feature feature) void
setInferenceEnabled
(boolean isInferenceEnabled) Set whether to parse for inference index config to use from query.void
setLimitInMemory
(long limitInMemory) Change the limit.void
setLimitReads
(long limitReads) Change the limit.void
setOptimizeInRestrictionsForFunctions
(@Nullable Feature feature) void
setPrefetchCount
(int prefetchCount) Change the prefetch count.void
setPrefetchFeature
(@Nullable Feature prefetch) void
setQueryValidatorPattern
(String key, String pattern, String comment, boolean failQuery) Set or remove a query validator pattern.void
setStrictPathRestriction
(String strictPathRestriction) Whether path restrictions of indexes (excludedPaths / includedPaths) are taken into account during query execution, for Lucene indexes.toString()
-
Field Details
-
SQL2_OPTIMISATION_FLAG
the flag used to turn on/off the optimisations on top of theorg.apache.jackrabbit.oak.query.Query
object.-Doak.query.sql2optimisation
- See Also:
-
SQL2_OPTIMISATION_FLAG_2
- See Also:
-
SQL2_OPTIMIZATION_2
public static final boolean SQL2_OPTIMIZATION_2 -
OAK_QUERY_LIMIT_IN_MEMORY
- See Also:
-
DEFAULT_QUERY_LIMIT_IN_MEMORY
public static final long DEFAULT_QUERY_LIMIT_IN_MEMORY -
OAK_QUERY_LIMIT_READS
- See Also:
-
DEFAULT_QUERY_LIMIT_READS
public static final long DEFAULT_QUERY_LIMIT_READS -
OAK_QUERY_PREFETCH_COUNT
- See Also:
-
FT_NAME_PREFETCH_FOR_QUERIES
- See Also:
-
FT_NAME_IMPROVED_IS_NULL_COST
- See Also:
-
FT_OPTIMIZE_IN_RESTRICTIONS_FOR_FUNCTIONS
- See Also:
-
DEFAULT_PREFETCH_COUNT
public static final int DEFAULT_PREFETCH_COUNT -
OAK_QUERY_FAIL_TRAVERSAL
- See Also:
-
OAK_INFERENCE_ENABLED
- See Also:
-
DEFAULT_FAST_QUERY_SIZE
public static final boolean DEFAULT_FAST_QUERY_SIZE
-
-
Constructor Details
-
QueryEngineSettings
public QueryEngineSettings() -
QueryEngineSettings
-
-
Method Details
-
getQueryLengthWarnLimit
public long getQueryLengthWarnLimit() -
getQueryLengthErrorLimit
public long getQueryLengthErrorLimit() -
setPrefetchFeature
-
getLimitInMemory
public long getLimitInMemory()Description copied from interface:QueryEngineSettingsMBean
Get the limit on how many nodes a query may read at most into memory, for "order by" and "distinct" queries. If this limit is exceeded, the query throws an exception.- Specified by:
getLimitInMemory
in interfaceQueryEngineSettingsMBean
- Specified by:
getLimitInMemory
in interfaceQueryLimits
- Returns:
- the limit
-
setLimitInMemory
public void setLimitInMemory(long limitInMemory) Description copied from interface:QueryEngineSettingsMBean
Change the limit.- Specified by:
setLimitInMemory
in interfaceQueryEngineSettingsMBean
- Parameters:
limitInMemory
- the new limit
-
getLimitReads
public long getLimitReads()Description copied from interface:QueryEngineSettingsMBean
Get the limit on how many nodes a query may read at most (raw read operations, including skipped nodes). If this limit is exceeded, the query throws an exception.- Specified by:
getLimitReads
in interfaceQueryEngineSettingsMBean
- Specified by:
getLimitReads
in interfaceQueryLimits
- Returns:
- the limit
-
setLimitReads
public void setLimitReads(long limitReads) Description copied from interface:QueryEngineSettingsMBean
Change the limit.- Specified by:
setLimitReads
in interfaceQueryEngineSettingsMBean
- Parameters:
limitReads
- the new limit
-
setPrefetchCount
public void setPrefetchCount(int prefetchCount) Description copied from interface:QueryEngineSettingsMBean
Change the prefetch count.- Specified by:
setPrefetchCount
in interfaceQueryEngineSettingsMBean
- Parameters:
prefetchCount
- the new count
-
getPrefetchCount
public int getPrefetchCount()Description copied from interface:QueryEngineSettingsMBean
Get the prefetch count.- Specified by:
getPrefetchCount
in interfaceQueryEngineSettingsMBean
- Returns:
- the count
-
setAutoOptionsMappingJson
Description copied from interface:QueryEngineSettingsMBean
Change the automatic query options mapping.- Specified by:
setAutoOptionsMappingJson
in interfaceQueryEngineSettingsMBean
- Parameters:
json
- the new mapping, in Json format
-
getAutoOptionsMappingJson
Description copied from interface:QueryEngineSettingsMBean
Get the automatic query options mapping.- Specified by:
getAutoOptionsMappingJson
in interfaceQueryEngineSettingsMBean
- Returns:
- the mapping, in Json format
-
getAutomaticQueryOptions
-
getFailTraversal
public boolean getFailTraversal()Description copied from interface:QueryEngineSettingsMBean
Whether queries that don't use an index will fail (throw an exception). The default is false.- Specified by:
getFailTraversal
in interfaceQueryEngineSettingsMBean
- Specified by:
getFailTraversal
in interfaceQueryLimits
- Returns:
- true if they fail
-
setFailTraversal
public void setFailTraversal(boolean failTraversal) Description copied from interface:QueryEngineSettingsMBean
Set whether queries that don't use an index will fail (throw an exception).- Specified by:
setFailTraversal
in interfaceQueryEngineSettingsMBean
- Parameters:
failTraversal
- the new value for this setting
-
isInferenceEnabled
public boolean isInferenceEnabled()Description copied from interface:QueryEngineSettingsMBean
Get whether the query engine will parse the query and infers inference config- Specified by:
isInferenceEnabled
in interfaceQueryEngineSettingsMBean
- Specified by:
isInferenceEnabled
in interfaceQueryLimits
- Returns:
- true if inference is enabled
-
setInferenceEnabled
public void setInferenceEnabled(boolean isInferenceEnabled) Description copied from interface:QueryEngineSettingsMBean
Set whether to parse for inference index config to use from query.- Specified by:
setInferenceEnabled
in interfaceQueryEngineSettingsMBean
- Parameters:
isInferenceEnabled
- the new value for this setting
-
isFastQuerySize
public boolean isFastQuerySize()Description copied from interface:QueryEngineSettingsMBean
Whether the query result size should return an estimation for large queries.- Specified by:
isFastQuerySize
in interfaceQueryEngineSettingsMBean
- Returns:
- true if enabled
-
setFastQuerySize
public void setFastQuerySize(boolean fastQuerySize) - Specified by:
setFastQuerySize
in interfaceQueryEngineSettingsMBean
-
setImprovedIsNullCostFeature
-
getImprovedIsNullCost
public boolean getImprovedIsNullCost()Description copied from interface:QueryLimits
See OAK-10532. This method is used for backward compatibility (bug compatibility) only.- Specified by:
getImprovedIsNullCost
in interfaceQueryLimits
- Returns:
- true, except when backward compatibility for OAK-10532 is enabled
-
setOptimizeInRestrictionsForFunctions
-
getOptimizeInRestrictionsForFunctions
public boolean getOptimizeInRestrictionsForFunctions()Description copied from interface:QueryLimits
See OAK-11214. This method is used for backward compatibility (bug compatibility) only.- Specified by:
getOptimizeInRestrictionsForFunctions
in interfaceQueryLimits
- Returns:
- true, except when backward compatibility for OAK-11214 is enabled
-
getStrictPathRestriction
Description copied from interface:QueryEngineSettingsMBean
Whether Path restrictions are enabled while figuring out index plan- Specified by:
getStrictPathRestriction
in interfaceQueryEngineSettingsMBean
- Specified by:
getStrictPathRestriction
in interfaceQueryLimits
- Returns:
- true if enabled
-
setStrictPathRestriction
Description copied from interface:QueryEngineSettingsMBean
Whether path restrictions of indexes (excludedPaths / includedPaths) are taken into account during query execution, for Lucene indexes. When enabled, only indexes are considered if the index path restriction is compatible with the query path restrictions. When disabled, only the queryPaths of the index is taken into account.- Specified by:
setStrictPathRestriction
in interfaceQueryEngineSettingsMBean
- Parameters:
strictPathRestriction
- Set path restriction: Expected value is either of ENABLE/DISABLE/WARN ENABLE: enable path restriction- Index won't be used if index definition path restrictions are not compatible with query's path restriction DISABLE: path restrictions are not taken into account while querying WARN: path restrictions are not taken into account but a warning will be logged if query path restrictions are not compatible with index path restrictions
-
setFullTextComparisonWithoutIndex
public void setFullTextComparisonWithoutIndex(boolean fullTextComparisonWithoutIndex) -
getFullTextComparisonWithoutIndex
public boolean getFullTextComparisonWithoutIndex()- Specified by:
getFullTextComparisonWithoutIndex
in interfaceQueryLimits
-
isSql2Optimisation
public boolean isSql2Optimisation() -
getQueryStats
-
getQueryStatsReporter
-
getStatisticsProvider
-
setQueryValidatorPattern
Description copied from interface:QueryEngineSettingsMBean
Set or remove a query validator pattern.- Specified by:
setQueryValidatorPattern
in interfaceQueryEngineSettingsMBean
- Parameters:
key
- the keypattern
- the regular expression pattern (empty to remove the pattern)comment
- a commentfailQuery
- whether matching queries should fail (true) or just log a warning (false)
-
getQueryValidatorJson
- Specified by:
getQueryValidatorJson
in interfaceQueryEngineSettingsMBean
-
getQueryValidator
-
setIgnoredClassNamesInCallTrace
Description copied from interface:QueryEngineSettingsMBean
Set or remove java package/class names which are ignored from finding the invoking class for queries. It can be either Java package names or fully-qualified class names (package + class name).- Specified by:
setIgnoredClassNamesInCallTrace
in interfaceQueryEngineSettingsMBean
- Parameters:
packageNames
- the class names to be ignored.
-
getIgnoredClassNamesInCallTrace
Description copied from interface:QueryLimits
Retrieve the java package names / full qualified class names which should be ignored when finding the class starting a query- Specified by:
getIgnoredClassNamesInCallTrace
in interfaceQueryEngineSettingsMBean
- Specified by:
getIgnoredClassNamesInCallTrace
in interfaceQueryLimits
- Returns:
- the name of the packages / full qualified class names
-
toString
-