Package org.apache.jackrabbit.oak.query
Class QueryEngineSettings
- java.lang.Object
-
- org.apache.jackrabbit.oak.query.QueryEngineSettings
-
- All Implemented Interfaces:
QueryEngineSettingsMBean,QueryLimits
public class QueryEngineSettings extends Object implements QueryEngineSettingsMBean, QueryLimits
Settings of the query engine.
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_FAST_QUERY_SIZEstatic intDEFAULT_PREFETCH_COUNTstatic longDEFAULT_QUERY_LIMIT_IN_MEMORYstatic longDEFAULT_QUERY_LIMIT_READSstatic StringFT_NAME_IMPROVED_IS_NULL_COSTstatic StringFT_NAME_PREFETCH_FOR_QUERIESstatic StringFT_OPTIMIZE_IN_RESTRICTIONS_FOR_FUNCTIONSstatic StringFT_SORT_UNION_QUERY_BY_SCOREstatic StringOAK_INFERENCE_ENABLEDstatic StringOAK_QUERY_FAIL_TRAVERSALstatic StringOAK_QUERY_LIMIT_IN_MEMORYstatic StringOAK_QUERY_LIMIT_READSstatic StringOAK_QUERY_PREFETCH_COUNTstatic StringSQL2_OPTIMISATION_FLAGthe flag used to turn on/off the optimisations on top of theorg.apache.jackrabbit.oak.query.Queryobject.static StringSQL2_OPTIMISATION_FLAG_2static booleanSQL2_OPTIMIZATION_2-
Fields inherited from interface org.apache.jackrabbit.oak.api.jmx.QueryEngineSettingsMBean
TYPE
-
-
Constructor Summary
Constructors Constructor Description QueryEngineSettings()QueryEngineSettings(StatisticsProvider statisticsProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryOptions.AutomaticQueryOptionsMappinggetAutomaticQueryOptions()StringgetAutoOptionsMappingJson()Get the automatic query options mapping.booleangetFailTraversal()Whether queries that don't use an index will fail (throw an exception).booleangetFullTextComparisonWithoutIndex()@NotNull String[]getIgnoredClassNamesInCallTrace()Retrieve the java package names / full qualified class names which should be ignored when finding the class starting a querybooleangetImprovedIsNullCost()See OAK-10532.longgetLimitInMemory()Get the limit on how many nodes a query may read at most into memory, for "order by" and "distinct" queries.longgetLimitReads()Get the limit on how many nodes a query may read at most (raw read operations, including skipped nodes).booleangetOptimizeInRestrictionsForFunctions()See OAK-11214.intgetPrefetchCount()Get the prefetch count.longgetQueryLengthErrorLimit()longgetQueryLengthWarnLimit()QueryStatsMBeangetQueryStats()QueryStatsReportergetQueryStatsReporter()QueryValidatorgetQueryValidator()StringgetQueryValidatorJson()StatisticsProvidergetStatisticsProvider()StringgetStrictPathRestriction()Whether Path restrictions are enabled while figuring out index planbooleanisFastQuerySize()Whether the query result size should return an estimation for large queries.booleanisInferenceEnabled()Get whether the query engine will parse the query and infers inference configbooleanisSortUnionQueryByScoreEnabled()booleanisSql2Optimisation()voidsetAutoOptionsMappingJson(String json)Change the automatic query options mapping.voidsetFailTraversal(boolean failTraversal)Set whether queries that don't use an index will fail (throw an exception).voidsetFastQuerySize(boolean fastQuerySize)voidsetFullTextComparisonWithoutIndex(boolean fullTextComparisonWithoutIndex)voidsetIgnoredClassNamesInCallTrace(@NotNull String[] packageNames)Set or remove java package/class names which are ignored from finding the invoking class for queries.voidsetImprovedIsNullCostFeature(@Nullable Feature feature)voidsetInferenceEnabled(boolean isInferenceEnabled)Set whether to parse for inference index config to use from query.voidsetLimitInMemory(long limitInMemory)Change the limit.voidsetLimitReads(long limitReads)Change the limit.voidsetOptimizeInRestrictionsForFunctions(@Nullable Feature feature)voidsetPrefetchCount(int prefetchCount)Change the prefetch count.voidsetPrefetchFeature(@Nullable Feature prefetch)voidsetQueryValidatorPattern(String key, String pattern, String comment, boolean failQuery)Set or remove a query validator pattern.voidsetSortUnionQueryByScoreFeature(@Nullable Feature feature)voidsetStrictPathRestriction(String strictPathRestriction)Whether path restrictions of indexes (excludedPaths / includedPaths) are taken into account during query execution, for Lucene indexes.StringtoString()
-
-
-
Field Detail
-
SQL2_OPTIMISATION_FLAG
public static final String SQL2_OPTIMISATION_FLAG
the flag used to turn on/off the optimisations on top of theorg.apache.jackrabbit.oak.query.Queryobject.-Doak.query.sql2optimisation- See Also:
- Constant Field Values
-
SQL2_OPTIMISATION_FLAG_2
public static final String SQL2_OPTIMISATION_FLAG_2
- See Also:
- Constant Field Values
-
SQL2_OPTIMIZATION_2
public static final boolean SQL2_OPTIMIZATION_2
-
OAK_QUERY_LIMIT_IN_MEMORY
public static final String OAK_QUERY_LIMIT_IN_MEMORY
- See Also:
- Constant Field Values
-
DEFAULT_QUERY_LIMIT_IN_MEMORY
public static final long DEFAULT_QUERY_LIMIT_IN_MEMORY
-
OAK_QUERY_LIMIT_READS
public static final String OAK_QUERY_LIMIT_READS
- See Also:
- Constant Field Values
-
DEFAULT_QUERY_LIMIT_READS
public static final long DEFAULT_QUERY_LIMIT_READS
-
OAK_QUERY_PREFETCH_COUNT
public static final String OAK_QUERY_PREFETCH_COUNT
- See Also:
- Constant Field Values
-
FT_NAME_PREFETCH_FOR_QUERIES
public static final String FT_NAME_PREFETCH_FOR_QUERIES
- See Also:
- Constant Field Values
-
FT_NAME_IMPROVED_IS_NULL_COST
public static final String FT_NAME_IMPROVED_IS_NULL_COST
- See Also:
- Constant Field Values
-
FT_OPTIMIZE_IN_RESTRICTIONS_FOR_FUNCTIONS
public static final String FT_OPTIMIZE_IN_RESTRICTIONS_FOR_FUNCTIONS
- See Also:
- Constant Field Values
-
FT_SORT_UNION_QUERY_BY_SCORE
public static final String FT_SORT_UNION_QUERY_BY_SCORE
- See Also:
- Constant Field Values
-
DEFAULT_PREFETCH_COUNT
public static final int DEFAULT_PREFETCH_COUNT
-
OAK_QUERY_FAIL_TRAVERSAL
public static final String OAK_QUERY_FAIL_TRAVERSAL
- See Also:
- Constant Field Values
-
OAK_INFERENCE_ENABLED
public static final String OAK_INFERENCE_ENABLED
- See Also:
- Constant Field Values
-
DEFAULT_FAST_QUERY_SIZE
public static final boolean DEFAULT_FAST_QUERY_SIZE
-
-
Constructor Detail
-
QueryEngineSettings
public QueryEngineSettings()
-
QueryEngineSettings
public QueryEngineSettings(StatisticsProvider statisticsProvider)
-
-
Method Detail
-
getQueryLengthWarnLimit
public long getQueryLengthWarnLimit()
-
getQueryLengthErrorLimit
public long getQueryLengthErrorLimit()
-
setPrefetchFeature
public void setPrefetchFeature(@Nullable @Nullable Feature prefetch)
-
getLimitInMemory
public long getLimitInMemory()
Description copied from interface:QueryEngineSettingsMBeanGet 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:
getLimitInMemoryin interfaceQueryEngineSettingsMBean- Specified by:
getLimitInMemoryin interfaceQueryLimits- Returns:
- the limit
-
setLimitInMemory
public void setLimitInMemory(long limitInMemory)
Description copied from interface:QueryEngineSettingsMBeanChange the limit.- Specified by:
setLimitInMemoryin interfaceQueryEngineSettingsMBean- Parameters:
limitInMemory- the new limit
-
getLimitReads
public long getLimitReads()
Description copied from interface:QueryEngineSettingsMBeanGet 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:
getLimitReadsin interfaceQueryEngineSettingsMBean- Specified by:
getLimitReadsin interfaceQueryLimits- Returns:
- the limit
-
setLimitReads
public void setLimitReads(long limitReads)
Description copied from interface:QueryEngineSettingsMBeanChange the limit.- Specified by:
setLimitReadsin interfaceQueryEngineSettingsMBean- Parameters:
limitReads- the new limit
-
setPrefetchCount
public void setPrefetchCount(int prefetchCount)
Description copied from interface:QueryEngineSettingsMBeanChange the prefetch count.- Specified by:
setPrefetchCountin interfaceQueryEngineSettingsMBean- Parameters:
prefetchCount- the new count
-
getPrefetchCount
public int getPrefetchCount()
Description copied from interface:QueryEngineSettingsMBeanGet the prefetch count.- Specified by:
getPrefetchCountin interfaceQueryEngineSettingsMBean- Returns:
- the count
-
setAutoOptionsMappingJson
public void setAutoOptionsMappingJson(String json)
Description copied from interface:QueryEngineSettingsMBeanChange the automatic query options mapping.- Specified by:
setAutoOptionsMappingJsonin interfaceQueryEngineSettingsMBean- Parameters:
json- the new mapping, in Json format
-
getAutoOptionsMappingJson
public String getAutoOptionsMappingJson()
Description copied from interface:QueryEngineSettingsMBeanGet the automatic query options mapping.- Specified by:
getAutoOptionsMappingJsonin interfaceQueryEngineSettingsMBean- Returns:
- the mapping, in Json format
-
getAutomaticQueryOptions
public QueryOptions.AutomaticQueryOptionsMapping getAutomaticQueryOptions()
-
getFailTraversal
public boolean getFailTraversal()
Description copied from interface:QueryEngineSettingsMBeanWhether queries that don't use an index will fail (throw an exception). The default is false.- Specified by:
getFailTraversalin interfaceQueryEngineSettingsMBean- Specified by:
getFailTraversalin interfaceQueryLimits- Returns:
- true if they fail
-
setFailTraversal
public void setFailTraversal(boolean failTraversal)
Description copied from interface:QueryEngineSettingsMBeanSet whether queries that don't use an index will fail (throw an exception).- Specified by:
setFailTraversalin interfaceQueryEngineSettingsMBean- Parameters:
failTraversal- the new value for this setting
-
isInferenceEnabled
public boolean isInferenceEnabled()
Description copied from interface:QueryEngineSettingsMBeanGet whether the query engine will parse the query and infers inference config- Specified by:
isInferenceEnabledin interfaceQueryEngineSettingsMBean- Specified by:
isInferenceEnabledin interfaceQueryLimits- Returns:
- true if inference is enabled
-
setInferenceEnabled
public void setInferenceEnabled(boolean isInferenceEnabled)
Description copied from interface:QueryEngineSettingsMBeanSet whether to parse for inference index config to use from query.- Specified by:
setInferenceEnabledin interfaceQueryEngineSettingsMBean- Parameters:
isInferenceEnabled- the new value for this setting
-
isFastQuerySize
public boolean isFastQuerySize()
Description copied from interface:QueryEngineSettingsMBeanWhether the query result size should return an estimation for large queries.- Specified by:
isFastQuerySizein interfaceQueryEngineSettingsMBean- Returns:
- true if enabled
-
setFastQuerySize
public void setFastQuerySize(boolean fastQuerySize)
- Specified by:
setFastQuerySizein interfaceQueryEngineSettingsMBean
-
setImprovedIsNullCostFeature
public void setImprovedIsNullCostFeature(@Nullable @Nullable Feature feature)
-
getImprovedIsNullCost
public boolean getImprovedIsNullCost()
Description copied from interface:QueryLimitsSee OAK-10532. This method is used for backward compatibility (bug compatibility) only.- Specified by:
getImprovedIsNullCostin interfaceQueryLimits- Returns:
- true, except when backward compatibility for OAK-10532 is enabled
-
setOptimizeInRestrictionsForFunctions
public void setOptimizeInRestrictionsForFunctions(@Nullable @Nullable Feature feature)
-
getOptimizeInRestrictionsForFunctions
public boolean getOptimizeInRestrictionsForFunctions()
Description copied from interface:QueryLimitsSee OAK-11214. This method is used for backward compatibility (bug compatibility) only.- Specified by:
getOptimizeInRestrictionsForFunctionsin interfaceQueryLimits- Returns:
- true, except when backward compatibility for OAK-11214 is enabled
-
setSortUnionQueryByScoreFeature
public void setSortUnionQueryByScoreFeature(@Nullable @Nullable Feature feature)
-
isSortUnionQueryByScoreEnabled
public boolean isSortUnionQueryByScoreEnabled()
-
getStrictPathRestriction
public String getStrictPathRestriction()
Description copied from interface:QueryEngineSettingsMBeanWhether Path restrictions are enabled while figuring out index plan- Specified by:
getStrictPathRestrictionin interfaceQueryEngineSettingsMBean- Specified by:
getStrictPathRestrictionin interfaceQueryLimits- Returns:
- true if enabled
-
setStrictPathRestriction
public void setStrictPathRestriction(String strictPathRestriction)
Description copied from interface:QueryEngineSettingsMBeanWhether 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:
setStrictPathRestrictionin 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:
getFullTextComparisonWithoutIndexin interfaceQueryLimits
-
isSql2Optimisation
public boolean isSql2Optimisation()
-
getQueryStats
public QueryStatsMBean getQueryStats()
-
getQueryStatsReporter
public QueryStatsReporter getQueryStatsReporter()
-
getStatisticsProvider
public StatisticsProvider getStatisticsProvider()
-
setQueryValidatorPattern
public void setQueryValidatorPattern(String key, String pattern, String comment, boolean failQuery)
Description copied from interface:QueryEngineSettingsMBeanSet or remove a query validator pattern.- Specified by:
setQueryValidatorPatternin 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
public String getQueryValidatorJson()
- Specified by:
getQueryValidatorJsonin interfaceQueryEngineSettingsMBean
-
getQueryValidator
public QueryValidator getQueryValidator()
-
setIgnoredClassNamesInCallTrace
public void setIgnoredClassNamesInCallTrace(@NotNull @NotNull String[] packageNames)Description copied from interface:QueryEngineSettingsMBeanSet 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:
setIgnoredClassNamesInCallTracein interfaceQueryEngineSettingsMBean- Parameters:
packageNames- the class names to be ignored.
-
getIgnoredClassNamesInCallTrace
@NotNull public @NotNull String[] getIgnoredClassNamesInCallTrace()
Description copied from interface:QueryLimitsRetrieve the java package names / full qualified class names which should be ignored when finding the class starting a query- Specified by:
getIgnoredClassNamesInCallTracein interfaceQueryEngineSettingsMBean- Specified by:
getIgnoredClassNamesInCallTracein interfaceQueryLimits- Returns:
- the name of the packages / full qualified class names
-
-