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 Details

    • SQL2_OPTIMISATION_FLAG

      public static final String SQL2_OPTIMISATION_FLAG
      the flag used to turn on/off the optimisations on top of the org.apache.jackrabbit.oak.query.Query object. -Doak.query.sql2optimisation
      See Also:
    • SQL2_OPTIMISATION_FLAG_2

      public static final String SQL2_OPTIMISATION_FLAG_2
      See Also:
    • 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:
    • 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:
    • 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:
    • FT_NAME_PREFETCH_FOR_QUERIES

      public static final String FT_NAME_PREFETCH_FOR_QUERIES
      See Also:
    • FT_NAME_IMPROVED_IS_NULL_COST

      public static final String FT_NAME_IMPROVED_IS_NULL_COST
      See Also:
    • FT_OPTIMIZE_IN_RESTRICTIONS_FOR_FUNCTIONS

      public static final String FT_OPTIMIZE_IN_RESTRICTIONS_FOR_FUNCTIONS
      See Also:
    • DEFAULT_PREFETCH_COUNT

      public static final int DEFAULT_PREFETCH_COUNT
    • OAK_QUERY_FAIL_TRAVERSAL

      public static final String OAK_QUERY_FAIL_TRAVERSAL
      See Also:
    • OAK_INFERENCE_ENABLED

      public static final String OAK_INFERENCE_ENABLED
      See Also:
    • DEFAULT_FAST_QUERY_SIZE

      public static final boolean DEFAULT_FAST_QUERY_SIZE
  • Constructor Details

    • QueryEngineSettings

      public QueryEngineSettings()
    • QueryEngineSettings

      public QueryEngineSettings(StatisticsProvider statisticsProvider)
  • Method Details

    • getQueryLengthWarnLimit

      public long getQueryLengthWarnLimit()
    • getQueryLengthErrorLimit

      public long getQueryLengthErrorLimit()
    • setPrefetchFeature

      public void setPrefetchFeature(@Nullable @Nullable Feature prefetch)
    • 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 interface QueryEngineSettingsMBean
      Specified by:
      getLimitInMemory in interface QueryLimits
      Returns:
      the limit
    • setLimitInMemory

      public void setLimitInMemory(long limitInMemory)
      Description copied from interface: QueryEngineSettingsMBean
      Change the limit.
      Specified by:
      setLimitInMemory in interface QueryEngineSettingsMBean
      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 interface QueryEngineSettingsMBean
      Specified by:
      getLimitReads in interface QueryLimits
      Returns:
      the limit
    • setLimitReads

      public void setLimitReads(long limitReads)
      Description copied from interface: QueryEngineSettingsMBean
      Change the limit.
      Specified by:
      setLimitReads in interface QueryEngineSettingsMBean
      Parameters:
      limitReads - the new limit
    • setPrefetchCount

      public void setPrefetchCount(int prefetchCount)
      Description copied from interface: QueryEngineSettingsMBean
      Change the prefetch count.
      Specified by:
      setPrefetchCount in interface QueryEngineSettingsMBean
      Parameters:
      prefetchCount - the new count
    • getPrefetchCount

      public int getPrefetchCount()
      Description copied from interface: QueryEngineSettingsMBean
      Get the prefetch count.
      Specified by:
      getPrefetchCount in interface QueryEngineSettingsMBean
      Returns:
      the count
    • setAutoOptionsMappingJson

      public void setAutoOptionsMappingJson(String json)
      Description copied from interface: QueryEngineSettingsMBean
      Change the automatic query options mapping.
      Specified by:
      setAutoOptionsMappingJson in interface QueryEngineSettingsMBean
      Parameters:
      json - the new mapping, in Json format
    • getAutoOptionsMappingJson

      public String getAutoOptionsMappingJson()
      Description copied from interface: QueryEngineSettingsMBean
      Get the automatic query options mapping.
      Specified by:
      getAutoOptionsMappingJson in interface QueryEngineSettingsMBean
      Returns:
      the mapping, in Json format
    • getAutomaticQueryOptions

      public QueryOptions.AutomaticQueryOptionsMapping 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 interface QueryEngineSettingsMBean
      Specified by:
      getFailTraversal in interface QueryLimits
      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 interface QueryEngineSettingsMBean
      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 interface QueryEngineSettingsMBean
      Specified by:
      isInferenceEnabled in interface QueryLimits
      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 interface QueryEngineSettingsMBean
      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 interface QueryEngineSettingsMBean
      Returns:
      true if enabled
    • setFastQuerySize

      public void setFastQuerySize(boolean fastQuerySize)
      Specified by:
      setFastQuerySize in interface QueryEngineSettingsMBean
    • setImprovedIsNullCostFeature

      public void setImprovedIsNullCostFeature(@Nullable @Nullable Feature feature)
    • 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 interface QueryLimits
      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: QueryLimits
      See OAK-11214. This method is used for backward compatibility (bug compatibility) only.
      Specified by:
      getOptimizeInRestrictionsForFunctions in interface QueryLimits
      Returns:
      true, except when backward compatibility for OAK-11214 is enabled
    • getStrictPathRestriction

      public String getStrictPathRestriction()
      Description copied from interface: QueryEngineSettingsMBean
      Whether Path restrictions are enabled while figuring out index plan
      Specified by:
      getStrictPathRestriction in interface QueryEngineSettingsMBean
      Specified by:
      getStrictPathRestriction in interface QueryLimits
      Returns:
      true if enabled
    • setStrictPathRestriction

      public void setStrictPathRestriction(String strictPathRestriction)
      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 interface QueryEngineSettingsMBean
      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 interface QueryLimits
    • 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: QueryEngineSettingsMBean
      Set or remove a query validator pattern.
      Specified by:
      setQueryValidatorPattern in interface QueryEngineSettingsMBean
      Parameters:
      key - the key
      pattern - the regular expression pattern (empty to remove the pattern)
      comment - a comment
      failQuery - whether matching queries should fail (true) or just log a warning (false)
    • getQueryValidatorJson

      public String getQueryValidatorJson()
      Specified by:
      getQueryValidatorJson in interface QueryEngineSettingsMBean
    • getQueryValidator

      public QueryValidator getQueryValidator()
    • setIgnoredClassNamesInCallTrace

      public void setIgnoredClassNamesInCallTrace(@NotNull @NotNull String[] packageNames)
      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 interface QueryEngineSettingsMBean
      Parameters:
      packageNames - the class names to be ignored.
    • getIgnoredClassNamesInCallTrace

      @NotNull public @NotNull String[] 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 interface QueryEngineSettingsMBean
      Specified by:
      getIgnoredClassNamesInCallTrace in interface QueryLimits
      Returns:
      the name of the packages / full qualified class names
    • toString

      public String toString()
      Overrides:
      toString in class Object