Package org.elasticsearch.script
Class ScriptService
org.elasticsearch.script.ScriptService
- All Implemented Interfaces:
,
,
ClusterStateApplier
,ScriptCompiler
-
Field Summary
Modifier and TypeFieldDescriptionstatic
static <>>
static Setting.AffixSetting<org.elasticsearch.core.TimeValue>
static >
static >
static Setting<org.elasticsearch.core.TimeValue>
static >
static Setting<ScriptCache.CompilationRate>
static >
static <>>
Fields inherited from interface org.elasticsearch.script.ScriptCompiler
NONE
-
Constructor Summary
ConstructorDescriptionScriptService(Settings settings, <,ScriptEngine> engines, <,ScriptContext<?>> contexts)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyClusterState(ClusterChangedEvent event)
Called when a new cluster state (ClusterChangedEvent.state()
needs to be applied.void
close()
<FactoryType>
FactoryTypecompile(Script script, ScriptContext<FactoryType> context)
Compiles a script using the given context.void
deleteStoredScript(ClusterService clusterService, DeleteStoredScriptRequest request, ActionListener<AcknowledgedResponse> listener)
<,ScriptContext<?>>
protected StoredScriptSource
id)
getStoredScript(ClusterState state, GetStoredScriptRequest request)
boolean
boolean
isContextEnabled(ScriptContext<?> scriptContext)
boolean
lang)
boolean
isTypeEnabled(ScriptType scriptType)
void
putStoredScript(ClusterService clusterService, PutStoredScriptRequest request, ActionListener<AcknowledgedResponse> listener)
stats()
Methods inherited from class java.lang.
, , , , , , , , , ,
-
Field Details
-
SCRIPT_GENERAL_CACHE_SIZE_SETTING
public static final > SCRIPT_GENERAL_CACHE_SIZE_SETTING -
SCRIPT_GENERAL_CACHE_EXPIRE_SETTING
-
SCRIPT_MAX_SIZE_IN_BYTES
public static final > SCRIPT_MAX_SIZE_IN_BYTES -
SCRIPT_GENERAL_MAX_COMPILATIONS_RATE_SETTING
public static final Setting<ScriptCache.CompilationRate> SCRIPT_GENERAL_MAX_COMPILATIONS_RATE_SETTING -
SCRIPT_CACHE_SIZE_SETTING
public static final > SCRIPT_CACHE_SIZE_SETTING -
SCRIPT_CACHE_EXPIRE_SETTING
public static final Setting.AffixSetting<org.elasticsearch.core.TimeValue> SCRIPT_CACHE_EXPIRE_SETTING -
SCRIPT_MAX_COMPILATIONS_RATE_SETTING
public static final Setting.AffixSetting<ScriptCache.CompilationRate> SCRIPT_MAX_COMPILATIONS_RATE_SETTING -
SCRIPT_DISABLE_MAX_COMPILATIONS_RATE_SETTING
public static final > SCRIPT_DISABLE_MAX_COMPILATIONS_RATE_SETTING -
ALLOW_NONE
public static final ALLOW_NONE- See Also:
- Constant Field Values
-
TYPES_ALLOWED_SETTING
public static final <>> TYPES_ALLOWED_SETTING -
CONTEXTS_ALLOWED_SETTING
public static final <>> CONTEXTS_ALLOWED_SETTING
-
-
Constructor Details
-
ScriptService
-
-
Method Details
-
close
public void close() throws- Specified by:
in interface
- Specified by:
in interface
- Throws:
-
getScriptContexts
- Returns:
- an unmodifiable of available script context names to
ScriptContext
s
-
compile
Compiles a script using the given context.- Specified by:
compile
in interfaceScriptCompiler
- Type Parameters:
FactoryType
- the class of the compiled Script factory- Parameters:
script
- the Script to compilecontext
- the ScriptContext defining how to compile the script- Returns:
- a compiled script which may be used to construct instances of a script for the given context
-
isLangSupported
public boolean isLangSupported( lang) -
isTypeEnabled
-
isContextEnabled
-
isAnyContextEnabled
public boolean isAnyContextEnabled() -
getScriptFromClusterState
protected id) -
putStoredScript
public void putStoredScript(ClusterService clusterService, PutStoredScriptRequest request, ActionListener<AcknowledgedResponse> listener) -
deleteStoredScript
public void deleteStoredScript(ClusterService clusterService, DeleteStoredScriptRequest request, ActionListener<AcknowledgedResponse> listener) -
getStoredScript
-
getContextInfos
-
getScriptLanguages
-
stats
-
cacheStats
-
applyClusterState
Description copied from interface:ClusterStateApplier
Called when a new cluster state (ClusterChangedEvent.state()
needs to be applied. The cluster state to be applied is already committed when this method is called, so an applier must therefore be prepared to deal with any state it receives without throwing an exception. Throwing an exception from an applier is very bad because it will stop the application of this state before it has reached all the other appliers, and will likely result in another attempt to apply the same (or very similar) cluster state which might continue until this node is removed from the cluster.- Specified by:
applyClusterState
in interfaceClusterStateApplier
-