Class ScriptService.ContextSettings

Enclosing class:

public static class ScriptService.ContextSettings extends Object
Collect settings related to script context and general caches. The general cache is used by default. The context cache is used if script.max_compilations_rate is "use-context", a deprecated value. The context cache is used implicitly if script.max_compilations_rate is unset and any of the context cache family of settings is used: script.context.*.max_compilations_rate, ScriptService.SCRIPT_MAX_COMPILATIONS_RATE_SETTING script.context.*.cache_max_size, ScriptService.SCRIPT_CACHE_SIZE_SETTING script.context.*.cache_expire, ScriptService.SCRIPT_CACHE_EXPIRE_SETTING
  • Field Details

    • settings

      public final Settings settings
    • useContextSet

      public final boolean useContextSet
    • isGeneralCompilationRateSet

      public final boolean isGeneralCompilationRateSet
    • generalCompilationRate

      public final ScriptCache.CompilationRate generalCompilationRate
    • compilationContexts

      public final List<String> compilationContexts
    • sizeContexts

      public final List<String> sizeContexts
    • expireContexts

      public final List<String> expireContexts
  • Constructor Details

    • ContextSettings

      public ContextSettings(Settings settings, Set<String> contexts)
    • ContextSettings

      public ContextSettings(Settings settings)
  • Method Details

    • getContexts

      protected static List<String> getContexts(Setting.AffixSetting<?> setting, Settings settings, Set<String> contexts)
    • hasContextSettings

      public boolean hasContextSettings()
      Are there any context specific settings
    • deprecationMessage

      public String deprecationMessage()
      deprecation message for implicitly using the context cache
    • contextCompilationKeys

      public List<String> contextCompilationKeys()
      the context specific max compilation keys
    • fullKeys

      protected static List<String> fullKeys(Setting.AffixSetting<?> affix, List<String> contexts)
      the full keys for the contexts in the context affix setting
    • useContextCache

      public boolean useContextCache()
      Should the context cache be used? This is true if "use-context" is set explicitly or implicitly, see above for implicit definition.
    • implicitContextCache

      public boolean implicitContextCache()
      Implicitly use the script context cache. False if context cache is explicitly used as well as context cache is unused.
    • incompatibleSettings

      public boolean incompatibleSettings()
      Is the set of settings incompatible? This is the case if: 1) script.max_compilations_rate, ScriptService.SCRIPT_GENERAL_MAX_COMPILATIONS_RATE_SETTING is set but not set to "use-context". 2) Any of the context cache family of settings is set.
    • contextSettings

      public List<String> contextSettings()
      All context specific settings
    • incompatibleSettingsMessage

      public String incompatibleSettingsMessage()
      Error message if there are incompatible settings.